The thing that has bitten me more than once about firewall review is that a ruleset is reviewed as text and behaves as a set of permitted packets, and the two do not line up.
First-match evaluation is what breaks the correspondence. A one-line edit is never local. If you tighten a source range on an early rule, a later rule that was shadowed, and therefore dead, can come back to life and start matching traffic that nobody has thought about since it was written. Nothing in a unified diff shows you that. The changed line looks small and the review approves it.
I wrote a tool that does the comparison at the level the firewall actually works at. It takes two rulesets, compiles each into the set of packets it permits, and prints where the sets differ, along with which rules changed status:
NEWLY BLOCKED (permitted before, denied now)
all entries: in not lo, tcp
10.1.0.0/16 -> 10.5.0.0/16 :502 was allowed by rule 04, now denied by rule 05
STRUCTURAL
rule 03 now load-bearing it was redundant before this change
rule 05 now reachable previously shadowed by rule 04
The "now reachable" line is the one I actually built it for.
What it will not do, so nobody wastes their time: single base chain filter tables only. Any user-defined chain, jump, goto or return is rejected with a file, line and column rather than analysed. Docker adds chains, so plenty of real hosts are out of scope today. NAT is rejected for the same reason, since translation changes packet identity in transit and analysing it with NAT ignored would produce confident nonsense. It also assumes return traffic is permitted, which means it cannot verify a stateful policy, only a stateless approximation of one.
There is an HTML report mode that writes a single file with no scripts, no webfonts and no remote images, so it opens on an air-gapped machine. That was not a stylistic choice. A report describing exactly where an air-gapped network's trust boundaries sit is not something you want fetching a CDN when someone opens it. CI greps the generated file for those patterns on every run.
Correctness checking is a differential harness: the ruleset gets loaded into a real kernel namespace and fwdelta's verdict is compared against what nftables does, with fault injection so the harness proves it can fail. Right now that covers the input hook only.
Apache-2.0, and the musl binary is reproducible with the toolchain pinned:
https://github.com/Sbharadwaj05/fwdelta