API keys, DB passwords, and TLS private keys are secrets—never in git, screenshots, or client-side mobile apps.
Storage
Environment variables via secret managers (AWS Secrets Manager, HashiCorp Vault, Doppler)—inject at runtime in CI/CD.
Rotation
Rotate after staff departures and suspected leaks; automate where possible.
Client apps
Mobile/SPA cannot hide embedded keys—use backend proxy for third-party APIs.
Important interview questions and answers
- Q: .env in git?
A: Historic breach vector—use git-secrets scanning. - Q: 12-factor config?
A: Store config in environment, not code.
Self-check
- Where should production DB password live?
- Why can't SPA hide API keys?
Pitfall: Secrets in CI logs—mask outputs and use OIDC to cloud roles.
Interview prep
- Secrets in git?
Never—use secret manager and scanning.