Lion Cipher Lab

Enforce Linux runtime file integrity with IMA + EVM (get -EPERM when a signed file is tampered)

Why it matters

Most integrity tools tell you about a change AFTER it happened: AIDE runs from cron, hashes your files, and emails you that /usr/bin/sshd is different than it was last night — useful, but the attacker already ran their code. IMA + EVM is the Linux kernel's answer to the harder question: don't just detect the tampered file, REFUSE TO USE IT. IMA can measure every file into an append-only list (the basis for remote attestation), and — the part this lab drives home — it can APPRAISE a file against a cryptographic signature before any process is allowed to read or execute it, returning -EPERM the…

What you'll learn

Steps in this lab

  1. The mental model: measure, appraise, audit — and where EVM fits
  2. Stand up the disposable VM, install the tools, and confirm IMA is present
  3. Generate an IMA signing key and import the public cert into the .ima keyring
  4. Build a THROWAWAY filesystem to appraise — and scope the whole exercise to it
  5. LABEL first: sign the files (write security.ima) before any enforcement
  6. Turn on enforce (safely) and load the scoped appraisal policy
  7. The money shot: signed reads work, one tampered byte returns -EPERM
  8. The named failure modes — including the boot LOCKOUT and how to recover
  9. The judgment: IMA/EVM vs AIDE vs dm-verity vs fapolicyd, and how a pro ships it

Open the full interactive lab →