Lion Cipher Lab

Issue dynamic, short-lived database credentials with Vault

Why it matters

Almost every application talks to a database, and the overwhelmingly common way it authenticates is a single long-lived password. That one password gets copied into every app config, every deployment manifest, every developer's .env, and — because it is easy — into git history where it lives forever. It is shared, so when it leaks you cannot tell WHICH service or person used it, you cannot revoke one consumer without breaking all of them, and in practice it never gets rotated because rotating it means coordinating a change across everything that holds a copy. That is the static-secret problem…

What you'll learn

Steps in this lab

  1. The problem: one shared database password, copied everywhere and never rotated
  2. Recap: start Postgres in a container and a Vault dev server (own machine only)
  3. Give Vault its own admin user in Postgres (don't reuse the superuser)
  4. Enable the database engine and configure the Postgres connection
  5. Create a role: the template that mints a short-lived, least-privilege user
  6. Generate creds and USE them — and prove two reads give two users
  7. Measure revocation: revoke the lease, watch the same creds STOP working
  8. Judgment: when dynamic secrets win — and the honest costs of adopting them

Open the full interactive lab →