Interview Prep/DevSecOps/Secrets Management and Identity

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 -.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Secrets Management and Identity