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

ExternalSecret shows `SecretSyncedError` with `AccessDeniedException: ... is not authorized to perform: secretsmanager:GetSecretValue`

IntermediateTroubleshootingSecrets management: Vault, External Secrets and SOPS
Answer

Likely causes → The ESO controller (or the SA named in the SecretStore's auth.jwt.serviceAccountRef) has no IRSA role, or the role's policy scopes the wrong ARN. Secret ARNs end in a random 6-character suffix. If the secret uses a customer-managed KMS key, the role also needs kms:Decrypt.

Diagnose →

kubectl describe externalsecret db -n prod
kubectl get sa -n external-secrets external-secrets -o yaml | grep role-arn
aws iam simulate-principal-policy --policy-source-arn <role> \
  --action-names secretsmanager:GetSecretValue --resource-arns <secret-arn>

Fix → Grant secretsmanager:GetSecretValue on arn:aws:secretsmanager:<r>:<acct>:secret:prod/api/* and kms:Decrypt on the CMK. Add the role to the key policy if the policy does not delegate to IAM.

Prevent → Use one SecretStore per namespace with its own narrowly scoped role, not one cluster-wide all-powerful role.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Secrets management: Vault, External Secrets and SOPS