Skip to content

Course

Secrets Management in Practice

Vault leases, KMS envelopes, SOPS ciphertext committed to git, OIDC instead of stored cloud keys, rotation that survives connection pools, and what the first ten minutes of a leaked credential actually look like.

12 lessons

Course Q&A

Keep reading

Related articles from the SudoSecurity blog.

Reviews

Enrolled members can rate this course.

No reviews yet.

Where Secrets Actually Live

What .env files, environment variables, and git history do with a credential once it leaves your editor.

  1. 01The .env File TrapA .env file is a plaintext file your whole process can read, and everything downstream of that process inherits what it loaded.14mOpen
  2. 02Environment Variables Are Not PrivateAnything in a process's environment is readable by its owner through /proc, inherited by every child, visible to orchestrators, and frozen into core dumps.15mOpen
  3. 03Secrets in Git Never DieA committed credential lives in every clone, fork, reflog, and pull-request ref, and deleting it adds a commit — it never removes the blob.13mOpen

Secrets in Git, Safely

SOPS, sealed-secrets, and OIDC let ciphertext and identity live in the repo while plaintext never does.

  1. 01SOPS: Ciphertext in Gitsops encrypts each value under a per-file AES-256-GCM data key wrapped to your recipients, so secrets can live in the repo with full diff and review history.16mOpen
  2. 02Kubernetes Secrets and Sealed SecretsA Secret is base64 in etcd, readable by anyone with get rights in the namespace — encrypt at rest and deliver via sealed-secrets or an external store.17mOpen
  3. 03CI Secrets and OIDCStored cloud keys in CI are standing credentials waiting for a leak; OIDC federation and environment gates replace them with short-lived proof of what ran.15mOpen

Brokers, Envelopes, and Identity

Vault as a credential factory, KMS as an encryption API, and workload identity that mints short-lived proof instead of storing keys.

  1. 01Vault: Leases, Not a SafeVault brokers identity into short-lived credentials — database users it creates on demand, transit crypto as an API, and leases it can revoke mid-incident.18mOpen
  2. 02KMS Is an API, Not a StoreKMS never exports keys and caps Encrypt at about 4KB — the envelope pattern does the real work, and the secret stores are different services entirely.15mOpen
  3. 03Workload Identity and SSH CAsAttested, short-lived certificates — SPIFFE SVIDs, OIDC workload identity, SSH certs signed for hours — replace stored machine credentials entirely.16mOpen

Rotation and Leaks

Rotation as an overlap problem, the scrape-to-quarantine timeline of a public commit, and canaries that page you when quiet creds get used.

  1. 01Rotation Is an Overlap ProblemRotating a live credential without downtime means running two valid credentials through a drain window — pools, JWTs, and mounted files all hold the old one.14mOpen
  2. 02When a Secret LeaksPublic commits hit scraper feeds in seconds and AWS quarantine in minutes; the runbook is revoke first, investigate second, and rotate before you write the ticket.15mOpen
  3. 03Canaries and Audit TrailsValid credentials used correctly look like normal traffic — canary tokens fire on first use and decrypt-level audit logs show who unwrapped what.12mOpen