Secrets Management
How do you securely manage secrets (passwords, API keys, certificates) in a DevOps environment?
How do you securely manage secrets (passwords, API keys, certificates) in a DevOps environment?
Secrets management involves storing, accessing, and rotating sensitive data securely. Best practices: 1) Never commit secrets to version control. 2) Use dedicated secrets managers (HashiCorp Vault, AWS Secrets Manager, Azure Key Vault). 3) Inject secrets at runtime via environment variables or mounted volumes. 4) Implement least-privilege access. 5) Rotate secrets regularly. 6) Audit secret access. In Kubernetes, use external secrets operators rather than plain Secrets objects which are only base64-encoded.
Secrets in plain text are a security nightmare - leaked .env files, commits with passwords, and config files in logs cause breaches. Modern secrets management provides encryption at rest and in transit, access logging, automatic rotation, and centralized control. This is a critical security domain that every DevOps engineer must understand.
HashiCorp Vault basic usage
External Secrets Operator
- Storing secrets in environment variables in Dockerfiles (visible in image history)
- Using Kubernetes Secrets without encryption (they're only base64 encoded)
- Not rotating secrets after a team member leaves
- How would you implement secret rotation without application downtime?
- What is the difference between encryption at rest and in transit?
- How do you handle secrets in CI/CD pipelines securely?
More Security interview questions
Also worth your time on this topic
How to Decode a Kubernetes Secret
Kubernetes secrets store sensitive data in base64-encoded form. Learn how to safely decode and inspect these secrets using kubectl and command-line tools.
Infrastructure Security with Vault and SOPS
Implement enterprise-grade secret management using HashiCorp Vault and SOPS for encrypted GitOps workflows.
100 minutes
Terraform Repository Structure Checklist
Best practices for organizing and structuring your Terraform projects for maintainability and scalability.
30-45 minutes