Lion Cipher Lab

Find shadowed and redundant firewall rules with a Python analyzer

Why it matters

Firewall rule bases grow for years. Each change makes sense on the day it is made: open a port for a project, block an abusive network, let a contractor's subnet in. Nobody removes anything, because nobody is sure what will break. The result is a list of hundreds of rules, and almost no one knows which still do anything. That matters because host and network firewalls like iptables evaluate rules top to bottom and act on the first match. A broad ACCEPT near the top silently cancels every more specific DROP below it, even one someone added deliberately after an incident. The ruleset looks…

What you'll learn

Steps in this lab

  1. First match wins: how the firewall reads your rules
  2. Get a ruleset to audit
  3. Write the analyzer
  4. Run it and read the conflicts
  5. Fix the order and re-measure
  6. The honest limit: shadowed by two rules at once

Open the full interactive lab →