Interview Prep/DevSecOps/Secrets Management Architecture

How do you rotate a secret without downtime?

IntermediateProductionSecrets Management Architecture
Answer

Use a dual-credential pattern so old and new are both valid during the switch:

  1. Create the new credential while the old remains valid (alternating users strategy or two active API keys).
  2. Roll the new value out to all consumers (apps re-read from the secrets manager or get restarted).
  3. Verify no traffic uses the old credential (DB logs, provider "last used" timestamps).
  4. Revoke the old one.

Apps must fetch secrets at runtime with caching and refresh, not bake them in at build time. AWS's "alternating users" rotation strategy implements this for databases.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Secrets Management Architecture