Interview Prep/Real-World Interview/Multi-env and multi-account

How do you make sure production secrets never end up in dev or in someone's laptop?

BeginnerScenarioMulti-env and multi-account
Answer

Situation read → Separate secrets by environment at the storage and access level, so the dev identity simply can't read prod values.

What I'd do →

  1. Store secrets per account: prod secrets live only in the prod account's Secrets Manager.
  2. Access via workload identity (IRSA, Pod Identity) scoped to specific secret ARNs; humans don't have read access by default.
  3. Use different values per environment; never copy prod passwords to staging "to make it work".
  4. Block secrets from Git with pre-commit scanning (gitleaks) and GitHub push protection.
  5. Alert on reads of prod secrets by human principals (CloudTrail GetSecretValue).

Why → Account and IAM boundaries enforce separation; conventions alone don't.

Interview tip → Mention push protection; it blocks the commit before it ever reaches the remote.

All Real-World Interview questions Roadmap: Interview readiness

More on Multi-env and multi-account