How do you enable envelope encryption of Secrets in Kubernetes?
AdvancedConceptSecrets Management and Identity
Answer
Configure the API server with an EncryptionConfiguration using the KMS v2 provider so each secret is encrypted with a data-encryption key (DEK) that the external KMS wraps with a key-encryption key (KEK).
apiVersion: apiserver.config.k8s.io/v1
kind: EncryptionConfiguration
resources:
- resources: [secrets]
providers:
- kms: {apiVersion: v2, name: awskms, endpoint: unix:///var/run/kms.sock}
- identity: {}
Managed services expose it as a checkbox (EKS envelope encryption with a KMS key). After enabling, rewrite existing secrets: kubectl get secrets -A -o json | kubectl replace -f -.
More on Secrets Management and Identity
Why is hard-coding secrets or putting them in environment variables a problem?BeginnerWhat does HashiCorp Vault provide?BeginnerExplain Vault's seal/unseal process.IntermediateWhat are Vault dynamic secrets and why are they better than static ones?IntermediateHow do Kubernetes workloads authenticate to Vault?AdvancedWhat is AWS Secrets Manager and how does it compare with SSM Parameter Store?Beginner