Repository navigation
feat: support S3 SSE-C (customer-provided encryption keys) #1017
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
Open
schaurian
wants to merge
7
commits into
cloudnative-pg:main
Choose a base branch
from
schaurian:feat/s3-sse-c
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+313
−4
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ba74d62
feat: support S3 SSE-C (customer-provided encryption keys)
schaurian eed228a
fix: grant the instance role access to the SSE-C key secret
andrein 09adaa8
fix: use a separate SSE-C key file for each object store
armru 22bb659
Merge remote-tracking branch 'origin/main' into feat/s3-sse-c
armru 14d9d9c
feat: reject ObjectStores combining SSE-C with bucket-managed encryption
armru a7480c8
test: cover SSE-C with a different key for each object store
armru eac4007
fix: let object stores with an SSE-C key start WAL archiving
armru File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -314,6 +314,31 @@ spec: | |||||||||||||
| - key | ||||||||||||||
| - name | ||||||||||||||
| type: object | ||||||||||||||
| sseCustomerKey: | ||||||||||||||
| description: |- | ||||||||||||||
| The reference to the secret containing the key for | ||||||||||||||
| Server-Side Encryption with Customer-provided keys (SSE-C). | ||||||||||||||
| When set, every object barman-cloud uploads to and downloads from | ||||||||||||||
| S3 is encrypted with this key using the AWS SSE-C protocol | ||||||||||||||
| (the `--sse-customer-key` barman-cloud option). | ||||||||||||||
|
Comment on lines
+321
to
+323
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Following the same suggestion I left in: https://github.com/cloudnative-pg/barman-cloud/pull/284/changes#r4197823691
Suggested change
|
||||||||||||||
| The referenced value must be a base64-encoded 256-bit (32-byte) | ||||||||||||||
| AES key. This is meant for S3-compatible providers that only | ||||||||||||||
| support customer-provided keys (e.g. Hetzner Object Storage) and | ||||||||||||||
| cannot be combined with the bucket-managed `encryption` field | ||||||||||||||
| (SSE-S3/SSE-KMS), which barman-cloud rejects together with SSE-C. | ||||||||||||||
| It can be combined with any authentication method, including | ||||||||||||||
| inheritFromIAMRole. | ||||||||||||||
| properties: | ||||||||||||||
| key: | ||||||||||||||
| description: The key to select | ||||||||||||||
| type: string | ||||||||||||||
| name: | ||||||||||||||
| description: Name of the referent. | ||||||||||||||
| type: string | ||||||||||||||
| required: | ||||||||||||||
| - key | ||||||||||||||
| - name | ||||||||||||||
| type: object | ||||||||||||||
| type: object | ||||||||||||||
| serverName: | ||||||||||||||
| description: |- | ||||||||||||||
|
|
@@ -411,6 +436,16 @@ spec: | |||||||||||||
| message: use the 'serverName' plugin parameter in the Cluster resource | ||||||||||||||
| reason: FieldValueForbidden | ||||||||||||||
| rule: '!has(self.serverName)' | ||||||||||||||
| - fieldPath: .data.encryption | ||||||||||||||
| message: cannot be used together with s3Credentials.sseCustomerKey | ||||||||||||||
| reason: FieldValueForbidden | ||||||||||||||
| rule: '!has(self.s3Credentials) || !has(self.s3Credentials.sseCustomerKey) | ||||||||||||||
| || !has(self.data) || !has(self.data.encryption)' | ||||||||||||||
| - fieldPath: .wal.encryption | ||||||||||||||
| message: cannot be used together with s3Credentials.sseCustomerKey | ||||||||||||||
| reason: FieldValueForbidden | ||||||||||||||
| rule: '!has(self.s3Credentials) || !has(self.s3Credentials.sseCustomerKey) | ||||||||||||||
| || !has(self.wal) || !has(self.wal.encryption)' | ||||||||||||||
| instanceSidecarConfiguration: | ||||||||||||||
| description: The configuration for the sidecar that runs in the instance | ||||||||||||||
| pods | ||||||||||||||
|
|
||||||||||||||
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Following the same suggestion I left in: https://github.com/cloudnative-pg/barman-cloud/pull/284/changes#r4197823691