Course contentsShow
← Cloud and Infrastructure
Lesson 2262 of 2,98948. Secrets ManagementFree lesson

Dynamic Secrets Fundamentals

How Vault generates short-lived credentials on-demand with automatic revocation.

Dynamic Secrets Fundamentals

What you'll learn: How Vault generates short-lived credentials on-demand with automatic revocation, eliminating static credential sprawl.

The Problem with Static Secrets

Traditional secrets management stores fixed credentials—database passwords, API keys—that exist indefinitely. If compromised, they remain valid until manually rotated. This creates a large attack surface and operational overhead.

What Are Dynamic Secrets?

Dynamic secrets are credentials that don't exist until requested. When an application needs database access, Vault:

  1. Generates a unique username/password pair on-demand
  2. Assigns it a short lease (e.g., 1 hour)
  3. Automatically revokes it when the lease expires or the app finishes

Think of it like a valet parking ticket: you get temporary access when needed, and that specific ticket expires after use—no master key floating around forever.

How It Works

When your application authenticates to Vault and requests database credentials:

  • Vault connects to the database system
  • Creates a new user with specific permissions
  • Returns credentials valid only for the lease duration
  • Tracks the lease and deletes the database user upon expiration

This happens transparently—no static passwords stored anywhere. Even if credentials leak, they're useless after minutes or hours.

Key Benefits

  • Zero standing privileges: Credentials exist only during active use
  • Automatic cleanup: No manual rotation needed; Vault handles revocation
  • Audit trail: Every credential generation is logged with requester identity
  • Blast radius reduction: Compromised credentials have minimal validity window

Key Takeaway: Dynamic secrets shift from managing long-lived credentials to generating short-lived, auto-expiring credentials on-demand—Vault becomes the credential factory, not just a credential vault.