-
Notifications
You must be signed in to change notification settings - Fork 259
feat: add GCS customer-supplied encryption key (CSEK) support #1316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good example for vibe-coding, thanks, but this is useless because it can't allow partial upload/download and will work slow for multi-terabyte backups, better try to modify pkg/storage/gcs.go and pkg/config/config.go to add support for GCS encryption keys
Add support for encrypting GCS backup data using customer-supplied
encryption keys (CSEK). This provides client-side encryption where
the encryption key is controlled by the user, not Google.
Changes:
- Add `encryption_key` config field to GCSConfig (GCS_ENCRYPTION_KEY env var)
- Validate and decode base64 encryption key on connect (must be 256-bit)
- Apply encryption to all object operations: read, write, stat, copy
- Update documentation with usage instructions
Usage:
gcs:
encryption_key: "" # base64-encoded 256-bit key
# Generate with: openssl rand -base64 32
See: https://cloud.google.com/storage/docs/encryption/customer-supplied-keys
Co-Authored-By: Claude Opus 4.5 <[email protected]>
b0bbde9 to
929adfc
Compare
|
Looks much better. Thanks for contribution. Could you add separate test case |
Add tests for GCS Customer-Supplied Encryption Key (CSEK) validation: - TestGCSEncryptionKeyValidation: validates key length and base64 encoding - TestGCSApplyEncryption: tests encryption application to object handles - TestGCSEncryptionKeyDecoding: tests base64 key decoding Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add TestGCSEncryptionKey integration test that validates the CSEK (Customer-Supplied Encryption Key) feature works end-to-end with backup and restore operations. - Add config-gcs-encrypted.yml with encryption_key from GCS_ENCRYPTION_KEY env var - Add TestGCSEncryptionKey test function that skips if env var not set Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
Added integration test as requested:
The test skips if |
Analysis of CI Test FailuresI've investigated the failing integration tests and found that the failures are not caused by the GCS encryption feature. Key Findings:
Recommendation:The CI failures appear to be pre-existing flaky tests unrelated to the GCS encryption changes. A re-run of the failed jobs may resolve the issue. |
|
--- SKIP: TestGCS (0.00s) yep, i missed these tests requires some secrets to properly pass CI/CD |
Signed-off-by: slach <[email protected]>
Pull Request Test Coverage Report for Build 21044602531Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
…to apply encryption to exist keys Signed-off-by: slach <[email protected]>
… it allows properly execute CI/CD for Altinity#1316
Summary
Changes:
encryption_keyconfig field toGCSConfig(GCS_ENCRYPTION_KEYenv var)Usage:
Or via environment variable:
See: https://cloud.google.com/storage/docs/encryption/customer-supplied-keys
Test plan
GCS_ENCRYPTION_KEYwith a valid 256-bit base64 keyclickhouse-backup create+upload- verify objects are encrypted in GCSclickhouse-backup download+restore- verify decryption worksclickhouse-backup list remote- verify metadata is accessible--tablesflag - verify single table restore works🤖 Generated with Claude Code