Firewall Ruleset Analyser
Paste a firewall ruleset and see what it really allows — and which rules can never fire.
A firewall ruleset is the list of rules that decides which packets get in, which get out, and which are dropped. It usually grows one rule at a time — a port opened for a project, a host allowed for a migration — and nobody deletes the old ones. This analyser reads the ruleset the way your firewall does, rule by rule in order, and audits it: rules that let the whole internet in, dangerous ports left open, rules that can never fire because an earlier rule already matched, duplicates, and the order problems that turn a deny into decoration. It parses iptables-save, nftables, pf.conf and Windows Firewall (netsh) exports. The companion article how to audit a firewall ruleset walks through a real ruleset by hand, and the SSH server config auditor is the same idea for a different config file.
Last updated:
Audit a ruleset
Results
Findings
Parsed rules
🔒 The ruleset is parsed and audited in your browser. Nothing is uploaded, nothing is sent anywhere — a firewall config names your internal network, and it stays on your machine.
The four formats this reads
iptables-save is the text form of the Linux iptables ruleset: a table header such as *filter, chain policies such as :INPUT DROP [0:0], and one rule per line starting with -A — match conditions first, then -j and the verdict (ACCEPT, DROP, REJECT, LOG). A chain is checked top to bottom and the first matching rule wins, so order is the policy.
nftables is the newer Linux format (nft list ruleset): tables containing chains, each chain with a hook (input, output, forward) and a policy, and rules written as match statements followed by a verdict — tcp dport 22 accept, ct state established,related accept. Anonymous sets such as { 80, 443 } are read as port lists; named sets (@name) are kept as names, because their contents are not in the export.
pf.conf is the OpenBSD (and macOS) packet filter: pass and block rules with a direction (in/out), an interface, a protocol, and from/to addresses with optional ports. PF has no chain policy — its default is to pass everything unless a block rule exists — and its rules are last-match unless marked quick. This audit reads pf rules as first-match, the way quick-heavy rulesets behave; a last-match ruleset without quick can shadow differently than reported.
The Windows Firewall export is the text of netsh advfirewall firewall show rule name=all: blocks keyed by Rule Name: with Enabled, Direction, LocalIP/RemoteIP, Protocol, ports and Action. Only enabled rules are audited — disabled rules are not live. Windows Firewall is stateful by default and the export carries no default policy, so the stateful-rule, default-policy and loopback checks are skipped for this format.
What this analyser does — and what it does not
It parses and audits — in the browser. The parser reads your pasted text or file into one rule model (chain, direction, protocol, addresses, ports, verdict), then the audit walks the rules in order: it checks each rule against the whole internet, checks each rule against the rules before it for shadowing, duplication and accept-before-deny order problems, and checks each chain for a default policy, a stateful rule, a loopback rule and a final deny. Every finding names the rule’s line number and its raw text.
It does not test the live firewall. Nothing here sends a packet, opens a port or connects to your server — the audit is a reading of the text you pasted. It does not know which interfaces face the internet, what sits behind the firewall, or whether a rule you meant to delete is still there because the export is old. A score of 100 means the text passes these checks, not that the network is safe.
It does not guess at what it cannot read. A line the parser does not understand is reported as unparsed — with its line number — and the audit does not judge it. Named sets (@name in nftables, <table> in pf) are compared by name only: two rules using the same named set are treated as matching the same traffic, but the contents of the set are never assumed. IPv6 addresses are compared by exact text, not by prefix arithmetic.
Be honest with yourself before you trust a score
A high score is not a safe network. The audit checks the shape of the ruleset — open ports, order, defaults — not whether the services behind the open ports are patched, whether the passwords are strong, or whether the interface you think is internal is actually reachable. Treat the score as a hygiene check, the way a linter treats code.
A low score can be deliberate. A lab box, a honeypot, or a host behind another firewall may genuinely want a permissive ruleset. The findings are questions to answer ("do we mean to expose RDP to the world?"), not orders — fix the ones whose answer is no.
Order is the firewall. Most findings on this page are order problems, not typos: a deny written after the accept that already matched, a specific rule written after the broad rule that swallows it. When you fix a finding, re-run the audit — moving one rule can un-shadow another, and the score only counts the ruleset in front of it.
Key facts
| First match wins | In iptables and nftables, a packet takes the verdict of the first rule it matches; later rules never see it. In pf, the last matching rule wins unless the rule is marked quick. |
| Default policy | What happens to a packet that matches no rule. DROP (or a block-all rule) is the safe default; ACCEPT means everything not explicitly denied gets in. |
| Shadowed rule | A rule that can never fire because an earlier rule in the same chain already matches all of its traffic. It is dead weight — and usually a sign the author meant the opposite order. |
| Stateful rule | A rule that accepts return traffic for connections you started — conntrack ESTABLISHED,RELATED in iptables, ct state established,related in nftables, keep state in pf. Without one, every reply packet must match an explicit rule. |
| Dangerous ports | Ports that should almost never answer the whole internet: remote access (22, 23, 3389, 5900), databases (3306, 5432, 1433, 1521, 27017), caches (6379, 11211), and file sharing (445, 2049). |
| The score | 0–100: 90+ Excellent, 75–89 Good, 50–74 Fair, 25–49 Poor, below 25 Critical. Each finding deducts points by severity; unparsed lines deduct a little, capped at 6. |
Frequently asked questions
Is it safe to paste my firewall ruleset here?
Yes — the text never leaves your browser. The parser and the audit run as JavaScript on this page; there is no upload, no server call, and nothing is stored. A ruleset names your internal subnets and hosts, which is exactly why the tool is built this way — the same reason the SSH server config auditor and the systemd unit auditor run locally.
My ruleset scored low but the server is behind another firewall — is that fine?
Probably. The audit scores the text in front of it, not your network topology — it cannot see the outer firewall, the VPN, or the cloud security group in front of the host. If the exposure is deliberate, the findings are still worth reading once: they are the list of what an attacker would find if that outer layer ever went away.
Why is a rule "shadowed" — and how do I fix it?
A rule is shadowed when an earlier rule in the same chain already matches all of its traffic, so packets never reach it. The usual cause is order: a broad allow was added above a narrow deny. Fix it by moving the narrow rule above the broad one — or by narrowing the broad rule — and re-run the audit to confirm the finding is gone.