Lion Cipher Lab

Sandbox a systemd service: drop its power with exec directives and score it with systemd-analyze

Why it matters

Almost every daemon on a Linux box starts life with far more power than its job requires: it can write anywhere its user can, see the real /tmp and every other process's files there, open raw and packet sockets, load kernel modules, call the entire system-call surface, and keep a fistful of capabilities it will never use. That surplus power is exactly what an attacker inherits the moment they exploit the service — the gap between what a program NEEDS and what it CAN do is the blast radius of every compromise. systemd already runs your services, and it can strip that surplus on the way up with…

What you'll learn

Steps in this lab

  1. The one idea: your services run with power they never use
  2. Get a real systemd box — and why WSL1 and most containers will not do
  3. Stand up a small service to harden
  4. Baseline: score the unhardened unit and read the table
  5. Harden with a drop-in — and what each directive buys you
  6. Prove it bites, and watch the score fall
  7. The tuning reality: over-restrict, read the journal, loosen one thing
  8. The judgment: what this is, what it is not, and the pro workflow

Open the full interactive lab →