From 73b43c5e736b4f012cb866baae4f7d4a0260901a Mon Sep 17 00:00:00 2001 From: Jiffin Tony Thottan Date: Tue, 20 Apr 2021 17:22:16 +0530 Subject: [PATCH] docs: update the vault kms documentation for RGW This changes documentation from `ceph-cluster-crd.md` to `ceph-object-store-crd.md`. Signed-off-by: Jiffin Tony Thottan --- Documentation/ceph-cluster-crd.md | 17 ---------- Documentation/ceph-object-store-crd.md | 32 ++++++++++++++++++- .../kubernetes/ceph/object-openshift.yaml | 26 ++++++++++++++- cluster/examples/kubernetes/ceph/object.yaml | 25 +++++++++++++++ 4 files changed, 81 insertions(+), 19 deletions(-) diff --git a/Documentation/ceph-cluster-crd.md b/Documentation/ceph-cluster-crd.md index 468ab8d05..03f4f52f2 100755 --- a/Documentation/ceph-cluster-crd.md +++ b/Documentation/ceph-cluster-crd.md @@ -1468,10 +1468,6 @@ By default, the Key Encryption Keys (also known as Data Encryption Keys) are sto However, if a Key Management System exists Rook is capable of using it. HashiCorp Vault is the only KMS currently supported by Rook. Please refer to the next section. -Ceph RGW supports encryption via KMS using HashiCorp Vault. If the below settings are defined, then RGW establish a connection between Vault -and whenever S3 client sends a request with Server Side Encryption, it encrypts that using the key specified by the client. -For more details w.r.t RGW, please refer [Ceph Vault documentation](https://docs.ceph.com/en/latest/radosgw/vault/) - The `security` section contains settings related to encryption of the cluster. * `security`: @@ -1588,16 +1584,3 @@ data: Note: if you are using self-signed certificates (not known/approved by a proper CA) you must pass `VAULT_SKIP_VERIFY: true`. Communications will remain encrypted but the validity of the certificate will not be verified. - -For RGW, please note the following: - -* `VAULT_SECRET_ENGINE` option is specifically for RGW to mention about the secret engine which can be used, currently supports two: [kv](https://www.vaultproject.io/docs/secrets/kv) and [transit](https://www.vaultproject.io/docs/secrets/transit). -* The Storage administrator needs to create a secret in the Vault server so that S3 clients use that key for encryption -```console -# kv engine -vault kv put rook/mybucketkey key=$(openssl rand -base64 32) - -# transit engine -vault write -f transit/keys/mybucketkey exportable=true -``` -* TLS authentication with custom certs between Vault and RGW are yet to support. diff --git a/Documentation/ceph-object-store-crd.md b/Documentation/ceph-object-store-crd.md index 14f2b1c93..73061d3d8 100644 --- a/Documentation/ceph-object-store-crd.md +++ b/Documentation/ceph-object-store-crd.md @@ -37,7 +37,7 @@ spec: preservePoolsOnDelete: true gateway: type: s3 - sslCertificateRef: + # sslCertificateRef: port: 80 # securePort: 443 instances: 1 @@ -169,3 +169,33 @@ The endpoint health check procedure is the following: 6. Update CR health status check Rook-Ceph always keeps the bucket and the user for the health check, it just does a PUT and GET of an s3 object since creating a bucket is an expensive operation. + +## Security settings + +Ceph RGW supports encryption via Key Management System (KMS) using HashiCorp Vault. Refer to the [vault kms section](ceph-cluster-crd.md#vault-kms) for detailed explanation. +If these settings are defined, then RGW establish a connection between Vault and whenever S3 client sends a request with Server Side Encryption, +it encrypts that using the key specified by the client. For more details w.r.t RGW, please refer [Ceph Vault documentation](https://docs.ceph.com/en/latest/radosgw/vault/) + +The `security` section contains settings related to KMS encryption of the RGW. + +```yaml +security: + kms: + connectionDetails: + KMS_PROVIDER: vault + VAULT_ADDR: http://vault.default.svc.cluster.local:8200 + VAULT_BACKEND_PATH: rgw + VAULT_SECRET_ENGINE: kv + VAULT_BACKEND: v2 + # name of the k8s secret containing the kms authentication token + tokenSecretName: rgw-vault-token +``` + +For RGW, please note the following: + +* `VAULT_SECRET_ENGINE` option is specifically for RGW to mention about the secret engine which can be used, currently supports two: [kv](https://www.vaultproject.io/docs/secrets/kv) and [transit](https://www.vaultproject.io/docs/secrets/transit). And for kv engine only version 2 is supported. +* The Storage administrator needs to create a secret in the Vault server so that S3 clients use that key for encryption +$ vault kv put rook/ key=$(openssl rand -base64 32) # kv engine +$ vault write -f transit/keys/ exportable=true # transit engine + +* TLS authentication with custom certs between Vault and RGW are yet to be supported. diff --git a/cluster/examples/kubernetes/ceph/object-openshift.yaml b/cluster/examples/kubernetes/ceph/object-openshift.yaml index a4fab585c..7c8355962 100644 --- a/cluster/examples/kubernetes/ceph/object-openshift.yaml +++ b/cluster/examples/kubernetes/ceph/object-openshift.yaml @@ -106,7 +106,31 @@ spec: # Configure the pod liveness probe for the rgw daemon livenessProbe: disabled: false - + # security oriented settings + # security: + # To enable the KMS configuration properly don't forget to uncomment the Secret at the end of the file + # kms: + # # name of the config map containing all the kms connection details + # connectionDetails: + # KMS_PROVIDER: "vault" + # VAULT_ADDR: VAULT_ADDR_CHANGE_ME # e,g: http://vault.my-domain.com:8200 + # VAULT_BACKEND_PATH: "rook" + # VAULT_SECRET_ENGINE: "kv" + # VAULT_BACKEND: v2 + # # name of the secret containing the kms authentication token + # tokenSecretName: rook-vault-token +# # UNCOMMENT THIS TO ENABLE A KMS CONNECTION +# # Also, do not forget to replace both: +# # * ROOK_TOKEN_CHANGE_ME: with a base64 encoded value of the token to use +# # * VAULT_ADDR_CHANGE_ME: with the Vault address +# --- +# apiVersion: v1 +# kind: Secret +# metadata: +# name: rook-vault-token +# namespace: rook-ceph # namespace:cluster +# data: +# token: ROOK_TOKEN_CHANGE_ME --- apiVersion: route.openshift.io/v1 kind: Route diff --git a/cluster/examples/kubernetes/ceph/object.yaml b/cluster/examples/kubernetes/ceph/object.yaml index 2b59c94d4..80ba09073 100644 --- a/cluster/examples/kubernetes/ceph/object.yaml +++ b/cluster/examples/kubernetes/ceph/object.yaml @@ -110,3 +110,28 @@ spec: # Configure the pod liveness probe for the rgw daemon livenessProbe: disabled: false + # security oriented settings + # security: + # To enable the KMS configuration properly don't forget to uncomment the Secret at the end of the file + # kms: + # # name of the config map containing all the kms connection details + # connectionDetails: + # KMS_PROVIDER: "vault" + # VAULT_ADDR: VAULT_ADDR_CHANGE_ME # e,g: http://vault.my-domain.com:8200 + # VAULT_BACKEND_PATH: "rook" + # VAULT_SECRET_ENGINE: "kv" + # VAULT_BACKEND: v2 + # # name of the secret containing the kms authentication token + # tokenSecretName: rook-vault-token +# # UNCOMMENT THIS TO ENABLE A KMS CONNECTION +# # Also, do not forget to replace both: +# # * ROOK_TOKEN_CHANGE_ME: with a base64 encoded value of the token to use +# # * VAULT_ADDR_CHANGE_ME: with the Vault address +# --- +# apiVersion: v1 +# kind: Secret +# metadata: +# name: rook-vault-token +# namespace: rook-ceph # namespace:cluster +# data: +# token: ROOK_TOKEN_CHANGE_ME