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

`vault kv get secret/app/db` returns `Code: 403. Errors: * permission denied` although the policy allows `secret/app/*`

BeginnerTroubleshootingSecrets management: Vault, External Secrets and SOPS
Answer

Likely causes → The mount is KV v2. The CLI hides it, but the real API paths are secret/data/app/db (read) and secret/metadata/app/db (list). A policy written for secret/app/* matches nothing.

Diagnose →

vault secrets list -detailed | grep '^secret/'        # options: map[version:2]
vault token capabilities secret/data/app/db           # shows "deny"

Fix →

path "secret/data/app/*"     { capabilities = ["read"] }
path "secret/metadata/app/*" { capabilities = ["list", "read"] }

Prevent → Write policies with the data/ and metadata/ prefixes and test each one with vault token capabilities in CI before applying.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Secrets management: Vault, External Secrets and SOPS