Interview Prep/DevSecOps/Secrets management: Vault, External Secrets and SOPS

You enabled etcd encryption at rest, but `etcdctl get /registry/secrets/prod/db` still returns readable plaintext

AdvancedTroubleshootingSecrets management: Vault, External Secrets and SOPS
Answer

Likely causes → Encryption applies only on write. Secrets created before the change stay in plaintext until they are rewritten. Another cause: identity {} is listed first in the EncryptionConfiguration providers, so new writes are also unencrypted.

Diagnose →

ETCDCTL_API=3 etcdctl get /registry/secrets/prod/db | hexdump -C | head
# Encrypted values start with k8s:enc:aescbc:v1: or k8s:enc:kms:v2:

Fix → Put the real provider (kms v2 preferred, or aescbc/secretbox) first and keep identity {} last only for reading. Restart the API servers, then rewrite every Secret:

kubectl get secrets -A -o json | kubectl replace -f -

Prevent → On managed clusters, turn on envelope encryption (EKS KMS secrets encryption, GKE application-layer secrets encryption) at creation, and verify it with an etcd read in a test.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Secrets management: Vault, External Secrets and SOPS