Lion Cipher Lab

Get secrets out of your code with SOPS + age (a real secrets manager)

Why it matters

A 'secret' is any value that proves who you are or unlocks something — an API key, a database password, a token. Hardcoding one in your code is the single most common way credentials leak, because the moment that code is pushed anywhere, the secret is out of your hands. A .gitignore'd .env keeps it out of git, but it's still a plaintext file one bad copy-paste away from exposure, and it can't be shared with a teammate safely. A secrets manager fixes this: the secret lives encrypted, and only decrypts at the moment a program needs it. SOPS + age do this with zero infrastructure and zero cost —…

What you'll learn

Steps in this lab

  1. The problem, and what SOPS + age actually do
  2. Install age and SOPS
  3. Generate an age keypair (your lock and your key)
  4. Make a tiny project with a hardcoded secret — the thing we're fixing
  5. Tell SOPS which key to use, then encrypt the secret
  6. Take the secret OUT of the code and pull it back at runtime
  7. Commit safely — encrypted file yes, private key NEVER
  8. Rotation — the part everyone skips
  9. Why a committed secret is so hard to undo
  10. What you just did — and where it fits

Open the full interactive lab →