Interview › Security & DevSecOps
What is the difference between static and dynamic secrets? [Intermediate]
Answer
A static secret is created in advance and remains valid until manually changed or rotated. A dynamic secret is generated when requested, has a lease, and can be revoked automatically. Dynamic secrets are safer for systems that support just-in-time credential creation.
Technical explanation
Static secrets are simpler but create long-lived blast radius and rotation burden.
Dynamic secrets reduce credential reuse and support automated expiry.
Not every integration supports dynamic credentials, so teams often combine static secrets with rotation and dynamic secrets where possible.
Hands-on example
Example: a third-party API key may be static and stored in Vault KV with rotation reminders. A PostgreSQL credential can be dynamic through Vault's database engine, issued per workload for 1 hour and revoked after use.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Security & DevSecOps interview questions
- What is secrets management, and how does HashiCorp Vault work at a high level? [Intermediate]
- What is encryption at rest versus in transit, and how do you ensure both? [Advanced]
- How do you apply least privilege to service-to-service communication (e.g., with Istio mTLS)? [Intermediate]
- What is the difference between symmetric and asymmetric encryption? [Advanced]
- What is certificate management, and how do tools like cert-manager help? [Advanced]
- What is the difference between authentication and authorization? [Advanced]
- What is OPA, and what is the Rego language used for? [Intermediate]
- What are Linux capabilities, and why drop them in containers? [Advanced]