From c6836c474a87944d48e4b41143e80e19b793326c Mon Sep 17 00:00:00 2001 From: Santosh Date: Thu, 2 Apr 2026 21:56:21 +0530 Subject: [PATCH] rgw: support SSE-S3 with vault agent Support using SSE-S3 encryption with RGW using vault Agent auth. RGW sends requests to the agent instead of directly to Vault, and the agent transparently injects the authentication token. This eliminates using and managing a static token Signed-off-by: Santosh --- .../Object-Storage/ceph-object-store-crd.md | 84 +++++++++++++++++++ PendingReleaseNotes.md | 1 + pkg/apis/ceph.rook.io/v1/security.go | 5 ++ pkg/apis/ceph.rook.io/v1/security_test.go | 28 +++++++ pkg/daemon/ceph/osd/kms/kms.go | 2 +- pkg/operator/ceph/object/spec.go | 37 ++++++-- pkg/operator/ceph/object/spec_test.go | 27 ++++++ 7 files changed, 178 insertions(+), 6 deletions(-) diff --git a/Documentation/CRDs/Object-Storage/ceph-object-store-crd.md b/Documentation/CRDs/Object-Storage/ceph-object-store-crd.md index 23716456e..b9c8b04bc 100644 --- a/Documentation/CRDs/Object-Storage/ceph-object-store-crd.md +++ b/Documentation/CRDs/Object-Storage/ceph-object-store-crd.md @@ -381,6 +381,90 @@ vault write -f transit/keys/ exportable=true # transit engine * `tokenSecretName` can be (and often will be) the same for both kms and s3 configurations. +### SSE-S3 with Vault Agent + +Instead of using a static token for SSE-S3, you can use a [Vault Agent](https://developer.hashicorp.com/vault/docs/agent-and-proxy/agent) running as a sidecar in the RGW pod. The agent authenticates to Vault using the pod's Kubernetes service account (via Vault's [Kubernetes auth method](https://developer.hashicorp.com/vault/docs/auth/kubernetes)) and acts as a local proxy, eliminating the need to manage static tokens. + +This approach uses the [Vault Agent Injector](https://developer.hashicorp.com/vault/docs/platform/k8s/injector) (a mutating admission webhook) to automatically inject the Vault Agent sidecar into RGW pods. + +#### Prerequisites + +1. **Deploy the Vault Agent Injector** in the cluster: + + ```bash + helm repo add hashicorp https://helm.releases.hashicorp.com + helm install vault hashicorp/vault \ + --set "injector.enabled=true" \ + --set "server.enabled=false" # if using an external Vault server + ``` + +2. **Configure Vault** with the Kubernetes auth method, a policy, and a role: + + ```bash + # Enable Kubernetes auth method + vault auth enable kubernetes + + # Configure Kubernetes auth + vault write auth/kubernetes/config \ + kubernetes_host="https://$KUBERNETES_HOST:443" + + # Create a policy granting access to the transit engine + vault policy write rgw-sse-s3 - <