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

A new engineer runs `sops -d` on a KMS-encrypted file and gets `AccessDeniedException: ... is not authorized to perform: kms:Decrypt`

BeginnerTroubleshootingSecrets management: Vault, External Secrets and SOPS
Answer

Likely causes → Their IAM role or SSO permission set has no kms:Decrypt on that key, the key policy does not delegate to IAM, or they are logged into the wrong account or profile.

Diagnose →

aws sts get-caller-identity
yq '.sops.kms[].arn' secrets.enc.yaml
aws kms get-key-policy --key-id <arn> --policy-name default

Fix → Grant kms:Decrypt (and kms:Encrypt/kms:GenerateDataKey for editors) to the team role. Or set AWS_PROFILE to the profile mapped to the right account.

Prevent → Grant KMS access to groups or roles, never to individual users, and keep a separate key per environment so dev engineers cannot decrypt prod.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Secrets management: Vault, External Secrets and SOPS