Firewall Rule Review: Finding Shadowed and Overly Broad Rules
A practical method for reviewing firewall rules: spot shadowed, redundant and duplicate entries and risky open ports, then clean up without lockouts.

Firewall Rule Review: Finding Shadowed and Overly Broad Rules
Firewalls rarely fail because of the product. They fail because of the rule set: hundreds of lines added over years, each reasonable at the time, nobody sure which ones still matter. NIST's firewall guidance recommends periodic rule reviews, and most compliance frameworks ask for evidence of them. Here is a method you can apply to a Linux host, a router ACL, a cloud security group or a Windows server.
Export the rules as text
Every platform can dump its rules. On Linux use iptables-save or nft list ruleset. On Cisco devices, show running-config or show access-lists. In AWS, aws ec2 describe-security-groups returns JSON. On Windows, netsh advfirewall firewall show rule name=all prints every rule with its fields. Work on the export, not the live device.
Understand how the platform decides
The review depends on evaluation order.
- First match wins. iptables, nftables and Cisco ACLs read rules top to bottom per chain or list, and stop at the first match.
- No order, allow only. AWS security groups combine all their rules; anything allowed by any rule is allowed.
- Block beats allow. Windows Firewall applies block rules before allow rules, regardless of where they appear.
Keep this in mind, because the same pair of rules can be fine on one platform and broken on another.
Look for four kinds of problem
Shadowed rules. A later rule can never match because an earlier rule with a different action already catches all of its traffic. The classic case is a deny for one abusive address placed below an allow for everyone on port 443: the address was never blocked. Shadowed rules are dangerous because people believe they work.
Redundant rules. A later rule repeats a decision an earlier one already made, for example SSH allowed from a partner network below a rule that allows SSH from anywhere. Harmless in effect, but it hides the real exposure and makes changes riskier.
Duplicates. Identical lines, often left by scripts that append rules on every run.
Broad rules. Allow rules from 0.0.0.0/0 to administrative or database ports such as 22, 3389, 445, 3306, 5432, 6379 or 27017, rules that open thousands of ports, and any-any rules. These are the ones attackers find with internet-wide scans within hours.
Also check the default policy. An input chain with a default of ACCEPT means anything you forgot to block is open.
Compare rules properly
Deciding whether one rule covers another means comparing protocols, source ranges, destination ranges and port ranges at the same time. A /24 is inside a /16, port 443 is inside 1-1024, a Cisco wildcard mask of 0.0.0.255 is a /24, and www means port 80. Interfaces, connection state and Windows profiles must match as well. Doing this by eye across a few hundred lines is where reviews go wrong, which is why a tool helps.
Using the analyzer
The Firewall Rule Analyzer reads all five export formats and detects which one you pasted. It parses each rule into protocol, source, destination and ports, applies the right evaluation model for the platform, and lists shadowed, redundant, duplicate, broad and default-allow findings with a severity and a suggested fix. The parsed-rules tab shows exactly how each line was understood, so you can check edge cases. The cleanup tab produces an edited copy with removable rules commented out, and a CSV for your change ticket. It runs in the browser, so internal addresses never leave your machine.
Clean up without locking yourself out
Change control matters more than speed here.
- Confirm intent with the rule owners, especially for shadowed rules, because fixing one may block traffic that has silently worked for years.
- Remove duplicates and redundant lines first; they do not change behaviour.
- Narrow broad rules next, starting with internet-facing administrative ports, ideally moving access behind a VPN or bastion.
- Keep a console or out-of-band session open while applying changes, and schedule a rollback.
- Re-export and re-run the analysis to confirm the result.
Limits of any text review
A text review cannot see object groups defined elsewhere, routing, NAT or upstream filters, and it cannot tell whether a port actually has a service listening. Treat it as a structured first pass that makes the human review faster and more complete, not as a certificate of safety.



