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.

Preparing for an interview?

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

← All Security & DevSecOps questions