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

You added a teammate's age key to `.sops.yaml`, but they still cannot decrypt the existing files

IntermediateTroubleshootingSecrets management: Vault, External Secrets and SOPS
Answer

Likely causes → .sops.yaml creation rules only apply when a file is encrypted. Existing files keep the data key wrapped for the old recipients.

Diagnose → yq '.sops.age[].recipient' file.enc.yaml does not list the new key.

Fix → Someone who can decrypt re-wraps the data key:

find . -name '*.enc.yaml' -exec sops updatekeys -y {} \;
git commit -am "sops: add recipient for new team member"

When someone leaves, updatekeys is not enough because they may already hold the data key. Run sops rotate -i and rotate the actual secret values too.

Prevent → Make recipient changes PR-driven with a script that runs updatekeys across the repo.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Secrets management: Vault, External Secrets and SOPS