Lion Cipher Lab

Sign your own kernel modules and enforce signature verification with kernel lockdown

Why it matters

The kernel is the most privileged code on the machine: it is ring 0, it mediates every process, every file, every packet, and it can see and rewrite anything. A loadable kernel module (a `.ko` file) runs at exactly that privilege — and by default, on a stock Linux box, ANY process with root can load ANY module. Sit with what that means: the moment an attacker has root, they can drop a kernel module that hides their processes, hooks the system-call table, disables your logging, and survives reboots — a kernel ROOTKIT — and the kernel will happily load it, because the kernel's default policy is…

What you'll learn

Steps in this lab

  1. First, the danger and the throwaway rule
  2. Build a hello-world kernel module and watch ANY root load it
  3. Generate an X.509 module-signing key pair
  4. Sign the module with the kernel's scripts/sign-file
  5. Turn on enforcement — and watch even your SIGNED module get rejected
  6. Trust your key with MOK enrollment, and understand lockdown
  7. Prove the control: unsigned, untrusted, and TAMPERED are all rejected
  8. The named failure modes, said plainly
  9. Judgment: what this buys you, and what it does not
  10. The way a pro does it — and what you actually built

Open the full interactive lab →