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

A long-running service gets `permission denied` from Vault exactly 32 days after deployment

IntermediateTroubleshootingSecrets management: Vault, External Secrets and SOPS
Answer

Likely causes → The service authenticated once and kept renewing its token until it reached the default max_lease_ttl of 768h (32 days). Renewal cannot extend past max TTL.

Diagnose →

vault token lookup <accessor-or-token>   # look at creation_time, expire_time, explicit_max_ttl
vault read sys/mounts/auth/kubernetes/tune

Fix → Have the client log in again when renewal fails. Vault Agent auto-auth and the official SDK lifetime watchers do this. For services that cannot log in again, use a periodic token (period=24h), which can be renewed indefinitely.

Prevent → Use Vault Agent or a CSI provider instead of hand-written token handling, and alert on Vault 403s per service.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Secrets management: Vault, External Secrets and SOPS