Lion Cipher Lab

Audit SSH authorized_keys across a fleet for leaver, shared, weak and unrestricted keys

Why it matters

Most organisations that use SSH have never counted their keys. Every authorized_keys file is a small, local list of 'whoever holds the matching private key may log in here', and nothing in SSH itself expires those entries, ties them to a person, or tells HR when one is left behind. So the key of an engineer who left in July still opens the database server in October, a contractor's key quietly sits on the root account, three people share one private key so nobody can be held to what it did, and a CI pipeline's key can open an interactive shell from anywhere. NIST wrote a whole report (IR…

What you'll learn

Steps in this lab

  1. What you are auditing, with every term defined once
  2. What this is NOT: where it sits next to its neighbours
  3. Set up: open a terminal, check Python and ssh-keygen, make a folder
  4. Read one authorized_keys line the way sshd does
  5. Inside the base64: parse the key blob and compute the fingerprint
  6. Build the synthetic fleet, the roster, the inventory and the entitlements
  7. Write the auditor: seven rules, each tied to a reason
  8. Run it twice, and watch the naive scope miss keys
  9. Measure it: the comment field is not an owner
  10. Remediate, then re-measure: once from the naive scan, once properly
  11. When NOT to trust a clean report: what a file audit cannot see
  12. How a pro does it, and the long-term fix
  13. Where this goes next

Open the full interactive lab →