A legacy app reads its config only from environment variables, and security says env vars are unsafe. How do you handle it?
IntermediateScenarioSecrets and Identity Management
Answer
Situation read → Env vars leak through /proc/<pid>/environ, crash dumps, debug pages and child processes. But a rewrite is not happening this quarter.
What I'd do →
- Keep values out of the manifest: source the env vars from a Secret synced by ESO, not from literal YAML.
- Restrict
pods/execand secret read access in RBAC. - Disable debug endpoints and error pages that dump the environment.
- Plan the move to file-mounted secrets read at startup, which also allows hot reload.
- Make sure log shippers do not capture environment dumps.
Why → Pragmatic risk reduction now, cleaner design later.
Interview tip → Show you can reduce risk without blocking delivery.
More on Secrets and Identity Management
A team stores database passwords in a `.env` file committed to a private repo. How do you migrate them out?BeginnerYour CI pipeline uses long-lived AWS access keys stored as repository secrets. How do you replace them?IntermediateAn auditor asks how often you rotate database credentials. You currently never do. What do you build?IntermediatePods need AWS access. A developer mounted an IAM user's keys as a Kubernetes Secret. What do you propose instead?BeginnerShould you use Kubernetes Secrets, Sealed Secrets, External Secrets Operator or the Secrets Store CSI driver?IntermediateA Slack webhook URL and a Stripe live key were posted in a public GitHub issue. What is your response sequence?Beginner