Feat: add optional AES-256-CTR encryption for S3 backup files - #178
Open
ClaReQurv wants to merge 4 commits into
Open
Feat: add optional AES-256-CTR encryption for S3 backup files#178ClaReQurv wants to merge 4 commits into
ClaReQurv wants to merge 4 commits into
Conversation
Merge develop into main for v0.5.1-rc.1
🥇 Thanks FetchGoat for upgrading to Gold Sponsor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds optional file-level encryption for database dump files before uploading them to S3 storage. When PBW_FILES_ENCRYPTION_KEY is set, dump files are encrypted with AES-256-CTR before upload and automatically decrypted during restore.
Changes
env.example– Added PBW_FILES_ENCRYPTION_KEY environment variable documentationinternal/config/env.go– Added PBW_FILES_ENCRYPTION_KEY as an optional env config fieldinternal/util/cryptoutil/cipher.go– New cryptoutil package providing:EncryptReader– wraps an io.Reader with AES-256-CTR encryption (prepends a random 16-byte nonce)DecryptFile– decrypts a file in-place using the provided passphraseinternal/integration/storage/s3.go– S3Upload now encrypts the file content before sending to S3 when an encryption key is providedinternal/integration/postgres/postgres.go– RestoreZip decrypts the ZIP file before attempting to unzip itinternal/service/executions/run_execution.go– Passes PBW_FILES_ENCRYPTION_KEY to S3Uploadinternal/service/restorations/run_restoration.go– Passes PBW_FILES_ENCRYPTION_KEY to RestoreZipBackward Compatibility
Fully backward compatible. When PBW_FILES_ENCRYPTION_KEY is empty (default), behavior is identical to before — no encryption is applied.