Repository navigation
Conversation
0a40feb to
adb7045
Compare
|
Tested at Two changes were required:
With those:
|
0b42a5f to
eed228a
Compare
|
Thanks for the end-to-end run and the RBAC fix, @andrein — merged schaurian#1 into this branch. Updated the branch (
Local One observation: the plugin does not call |
|
I pushed a few commits on top:
That e2e is what found the |
Surface the new `sseCustomerKey` field on `s3Credentials` through the ObjectStore CRD so users can enable Server-Side Encryption with Customer-provided keys (SSE-C). This is required by S3-compatible providers that only support SSE-C for encryption at rest, such as Hetzner Object Storage. The field flows through the embedded BarmanObjectStoreConfiguration from the barman-cloud library, so this change is limited to bumping the dependency, regenerating the CRD and the consolidated manifest, and documenting usage in the object stores guide. Depends on cloudnative-pg/barman-cloud#284 (temporarily pinned via a replace directive until that change is released). Closes cloudnative-pg#646 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Florian Schauer <florian@schauer.to>
The sidecar reads credential secrets through a Role whose resource names are collected from the credential references. Without the new reference in that list, a key kept in its own secret, as in the docs example, is forbidden and every barman-cloud command fails. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Andrei Nistor <andrei@nistor.tech>
Point the temporary barman-cloud replace at the head of cloudnative-pg/barman-cloud#284 that keeps each SSE-C key in its own file. A replica cluster archives WAL to its own object store while restoring it from the source one in the same sidecar, and with a single shared file each operation could run with the key of the other object store. Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
eac4007 to
f2b80ef
Compare
09e0320 to
7d4f06a
Compare
The barman-cloud CLI refuses --sse-customer-key together with --encryption, so an ObjectStore setting both sseCustomerKey and data or wal encryption was accepted and then failed at its first backup or WAL archive. Reject it when it is created or updated instead. Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Run the replica cluster scenario with the source and the replica object stores each encrypted with its own SSE-C key kept in its own secret. The designated primary archives WAL to one object store while restoring it from the other in the same sidecar, and the switchover exercises both directions. At the end, check that every object in each bucket is readable with its own key only, and that an ObjectStore combining SSE-C with bucket-managed encryption is rejected. Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Point the temporary barman-cloud replace at the head of cloudnative-pg/barman-cloud#284 that stops passing --sse-customer-key to barman-cloud-check-wal-archive. That command rejects the option, and it runs before the first WAL file is archived, so an object store with an SSE-C key could never start archiving. The SSE-C e2e test caught it. Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Point the temporary replace at the current head of barman-cloud#284, which lists the secrets referenced by the credentials. Use it instead of the local list, so a new credential field cannot be left out of the instance role. Keep a role test for the SSE-C key secret. Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Pick up the new description of sseCustomerKey, and the fields that main already carries in the barman-cloud library. Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
7d4f06a to
b360b51
Compare
Add an optional `sseCustomerKey` field to `S3Credentials`. It references a secret with a base64-encoded 256-bit AES key. S3-compatible stores such as Hetzner Object Storage and some Ceph setups only offer SSE-C, so the existing bucket-managed `encryption` field cannot be used there. The key is written to `/controller/.sse-customer-keys/<secret>/<key>` before the auth method is handled, so it works with every auth method, including `inheritFromIAMRole`. The path depends on the secret and key because one process can serve several object stores at once, for example a replica cluster archiving to its own store while restoring from the source one. A shared file would let a command pick up the wrong key. Key files are not removed when the field or the secret goes away. Changing the key makes existing objects unreadable, so a new key needs a new `destinationPath` or `serverName`. The key is passed as `--sse-customer-key file://<path>` to every barman-cloud command except `barman-cloud-check-wal-archive`, which only lists objects and rejects the option. `ValidateBackupConfiguration` rejects `sseCustomerKey` together with `data.encryption` or `wal.encryption`, which barman-cloud refuses at run time. The credentials types now list the secrets they reference through `SecretNames()`, with a test that fails when a new secret field is not listed. Consumers can use it to grant access to those secrets instead of keeping their own list. Requires Barman 3.20.0 or later. The plugin side is cloudnative-pg/plugin-barman-cloud#1017. Refs cloudnative-pg/plugin-barman-cloud#646 Assisted-by: Claude Signed-off-by: Florian Schauer <florian@schauer.to> Signed-off-by: Andrei Nistor <andrei@nistor.tech> Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Co-authored-by: Andrei Nistor <andrei@nistor.tech> Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Drop the temporary replace. The library merged cloudnative-pg#284, and the release that carries it is not out yet. Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
5d91b7c to
7db3aa8
Compare
Replace the em-dashes, split the long closing paragraph, and say that a new key needs a new destinationPath or serverName. Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
7db3aa8 to
522a941
Compare
Call SecretNames on the configuration, as the embedded BarmanCredentials field is promoted. Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Support S3 Server-Side Encryption with Customer-provided keys (SSE-C) in the
ObjectStoreresource. S3-compatible stores such as Hetzner Object Storage and some Ceph setups only offer SSE-C, so the bucket-managedencryptionfield cannot be used there.The new
sseCustomerKeyfield ofs3Credentialsis defined in the barman-cloud library and reaches the plugin through the embedded configuration. It references a secret holding a base64-encoded 256-bit AES key. The library keeps one key file per secret and passes it to every barman-cloud command that accepts it.barman-cloud-check-wal-archiveonly lists objects and rejects the option, so it does not get the key. The instance Role gets access to the key secret through the library helperSecretNames(), which replaces the plugin's own list of credential secrets.An
ObjectStorethat setssseCustomerKeytogether withdata.encryptionorwal.encryptionis rejected at admission with a CEL rule, because barman-cloud refuses that combination at run time. The docs get a new section on SSE-C, including the need to keep the key safe and unchanged.The e2e suite covers a replica cluster whose source and replica object stores use different SSE-C keys, each in its own secret. It checks that every object in each bucket is readable with its own key only.
Closes #646
Merge barman-cloud 0.7.0 before merging this PR.