Interview Prep/DevSecOps/Secrets and Identity Management

An auditor asks how often you rotate database credentials. You currently never do. What do you build?

IntermediateScenarioSecrets and Identity Management
Answer

Situation read → Manual rotation never happens. It has to be automated and the app has to tolerate it.

What I'd do →

  1. Turn on managed rotation: aws secretsmanager rotate-secret --secret-id prod/orders/db --rotation-rules AutomaticallyAfterDays=30, or RDS-managed master passwords.
  2. Use the alternating-users strategy so one credential is always valid during the switch.
  3. Make the app re-read the secret on auth failure or on a short cache TTL instead of only at startup.
  4. Alert on rotation failures through EventBridge or CloudWatch.
  5. Longer term, move to Vault dynamic credentials so each pod gets its own short-lived user.

Why → Rotation that breaks the app gets disabled within a week, so app behaviour matters as much as the schedule.

Interview tip → Say "rotation is an app-design problem, not a cron job".

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Secrets and Identity Management