Lion Cipher Lab

Track /etc configuration drift with git and a Python differ

Why it matters

A freshly hardened server is a snapshot in time. From the moment it goes live, its configuration begins to drift: a teammate loosens an SSH setting to debug something and forgets to revert it, a package update rewrites a config file, someone adds a sudoers rule 'just for now,' or — the case that matters most — an attacker who got in drops a new authorized SSH key or a cron job to keep their foothold. Every one of these looks the same from a distance: a file under /etc is now different from how you left it. The problem is that nobody can hold the known-good state of a few thousand config files…

What you'll learn

Steps in this lab

  1. What drift is, and the baseline idea underneath the fix
  2. Put /etc under version control — capture the baseline
  3. See the raw drift with git diff --name-status
  4. Write the drift classifier
  5. Run it and read the triaged report
  6. Schedule it, and know when to reach for the real tools

Open the full interactive lab →