Lion Cipher Lab

Write a least-privilege sudoers policy that grants one command, not the keys

Why it matters

"Give them sudo" is the most common over-grant in the world. The moment an account can run anything as root, a stolen password, a phished session, or a careless script is a full box takeover — there is nothing left to stop. Real least privilege means an on-call engineer who needs to bounce one service and read one log gets exactly that, and every other privileged action is refused. Writing that policy correctly — and knowing the ways it silently re-widens — is a core identity-and-access skill that shows up in every audit, every incident review, and every hardening baseline.

What you'll learn

Steps in this lab

  1. The idea: authorization is a list of allowed commands, not an on/off switch
  2. When you reach for this — and when you do NOT
  3. Set up a target user and a service to practise on
  4. Measure the BEFORE state: oncall can do nothing (or, wrongly, everything)
  5. Write the drop-in with visudo — never edit sudoers by hand
  6. Validate before you trust it: visudo -c
  7. Measure the AFTER state: exactly two commands work, everything else is refused
  8. The footguns: how a "restricted" grant silently becomes root
  9. The honest limit: when this is NOT enough

Open the full interactive lab →