Interview Prep/DevSecOps/Kubernetes Security

How do you make sure Kubernetes Secrets are encrypted at rest in etcd?

IntermediateScenarioKubernetes Security
Answer

Situation read → Secrets are base64, not encrypted. Anyone with an etcd backup can read them unless encryption is configured.

What I'd do →

  1. Managed: on EKS enable envelope encryption with a KMS key (aws eks associate-encryption-config); recent EKS versions encrypt by default, but a customer KMS key gives control and audit.
  2. Self-managed: EncryptionConfiguration with the kms v2 provider, passed via --encryption-provider-config.
  3. Re-encrypt existing Secrets: kubectl get secrets -A -o json | kubectl replace -f -.
  4. Protect etcd backups and restrict get/list on secrets in RBAC.

Why → Encryption at rest protects against stolen disks and backups, not against users who can read secrets through the API.

Interview tip → Say clearly that base64 is encoding, not encryption.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Kubernetes Security