Interview Prep/Python for DevOps/Automation scripting & CLI design

You need to rotate a credential stored in 12 places (Secrets Manager, two Kubernetes secrets, a Jenkins credential and a config file). How would you automate it?

AdvancedScenarioAutomation scripting & CLI design
Answer

Situation read → Multi-system change; a half-finished rotation is an outage.

What I'd do →

  1. Reduce the 12 places to 1: Secrets Manager as source of truth, with External Secrets Operator syncing into Kubernetes and Jenkins reading from it.
  2. Script the rotation as phases: create new credential (both valid), update the source of truth, wait for consumers to pick it up (verify via health checks), revoke the old one.
  3. Make each step idempotent and log state so a rerun continues from where it stopped.
  4. Prefer Secrets Manager's built-in rotation Lambda for supported databases.

Why → The dual-validity window is what makes rotation zero-downtime.

Interview tip → Say you would fix the sprawl first; automating 12 copies is automating the problem.

All Python for DevOps questions Roadmap: Python for automation

More on Automation scripting & CLI design