Skip to content

Commit 7e458b2

Browse files
authored
Merge pull request #537 from nebari-dev/536-eks-cluster-encryption
Add documentation for amazon_web_services.eks_kms_arn config option
2 parents a89196c + b4813c4 commit 7e458b2

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

docs/docs/explanations/advanced-provider-configuration.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,46 @@ amazon_web_services:
9898
permissions_boundary: arn:aws:iam::01234567890:policy/<permissions-boundary-policy-name>
9999
```
100100

101+
### EKS KMS ARN (Optional)
102+
103+
You can use AWS Key Management Service (KMS) to enhance security by encrypting Kubernetes secrets in
104+
Amazon Elastic Kubernetes Service (EKS). This approach adds an extra layer of protection for sensitive
105+
information, like passwords, credentials, and TLS keys, by applying user-managed encryption keys to Kubernetes
106+
secrets, supporting a [defense-in-depth strategy](https://aws.amazon.com/blogs/containers/using-eks-encryption-provider-support-for-defense-in-depth/).
107+
108+
Nebari supports setting an existing KMS key while deploying Nebari to implement encryption of secrets
109+
created in Nebari's EKS cluster. The KMS key must be a **Symmetric** key set to **encrypt and decrypt** data.
110+
111+
:::warning
112+
Enabling EKS cluster secrets encryption, by setting `amazon_web_services.eks_kms_arn`, is an
113+
_irreversible_ action and re-deploying Nebari to try to remove a previously set `eks_kms_arn` will fail.
114+
On the other hand, if you try to change the KMS key in use for cluster encryption, by re-deploying Nebari
115+
after setting a _different_ key ARN, the re-deploy should succeed but the KMS key used for encryption will
116+
not actually change in the cluster config and the original key will remain set. The integrity of a faulty
117+
deployment can be restored, following a failed re-deploy attempt to remove a previously set KMS key, by
118+
simply re-deploying Nebari while ensuring `eks_kms_arn` is set to the original KMS key ARN.
119+
:::
120+
121+
:::danger
122+
If the KMS key used for envelope encryption of secrets is ever deleted, then there is no way to recover
123+
the EKS cluster.
124+
:::
125+
126+
:::note
127+
After enabling cluster encryption on your cluster, you must encrypt all existing secrets with the
128+
new key by running the following command:
129+
`kubectl get secrets --all-namespaces -o json | kubectl annotate --overwrite -f - kms-encryption-timestamp="time value"`
130+
Consult [Encrypt K8s secrets with AWS KMS on existing clusters](https://docs.aws.amazon.com/eks/latest/userguide/enable-kms.html) for more information.
131+
:::
132+
133+
Here is an example of how you would set KMS key ARN in `nebari-config.yaml`.
134+
135+
```yaml
136+
amazon_web_services:
137+
# the arn for the AWS Key Management Service key
138+
eks_kms_arn: "arn:aws:kms:us-west-2:01234567890:key/<aws-kms-key-id>"
139+
```
140+
101141
### Launch Templates (Optional)
102142

103143
Nebari supports configuring launch templates for your node groups, enabling you to customize settings like the AMI ID and pre-bootstrap commands. This is particularly useful if you need to use a custom AMI or perform specific actions before the node joins the cluster.

0 commit comments

Comments
 (0)