SegAudit
Guides pages21 pages
Guides

Open source firewall audit tools and their limits

Open source tools for a firewall audit: Batfish for configs, Capirca for policy as code, Malcolm, Zeek and Wireshark for OT traffic, and where each one stops.

No single open source tool runs a whole firewall audit, but a few cover parts of one well, and an engineer with a free afternoon and a Python prompt can get a long way. Batfish reads firewall and router configurations offline and answers what the rules allow, including rule lines that can never match. Capirca writes access lists from a policy you keep as code, rather than auditing an existing rulebase. Malcolm, Zeek and Wireshark show the traffic, with parsers for industrial protocols. What none of them does on its own is join the rules, the traffic and the zone design into findings, a decision for each rule and a change plan with a rollback. That joining is most of the work in an OT review, and it is the part that ends up in a spreadsheet.

This guide covers what each tool does, where it stops, and how to fill the gaps.

What a firewall audit needs

A firewall rule audit in OT has five parts, and it helps to judge each tool against them:

  1. Read the rulebase. Rules in evaluation order with the objects they use, including any shared rules a manager pushes.
  2. Check rule hygiene. Shadowed, redundant, disabled and unlogged rules, and any-any allows.
  3. Read the rules against the zone design. Which paths the rules allow between zones, and which of those the design forbids.
  4. Read the rules against the traffic. Which paths carry sessions, which rules are unused, and which flows cross the design.
  5. Decide and plan. A decision for each rule, then ordered changes with a rollback for each, and evidence the asset owner can sign.

Batfish: what the rules allow

Batfish is a network configuration analysis tool released under the Apache 2.0 license. It reads configuration files for many platforms, among them Cisco IOS, IOS XE and ASA, Juniper including SRX, Palo Alto Networks, Fortinet and Check Point, and builds a model of the network that you query from Python.

For a firewall review, its filter questions do most of the work:

  • filterLineReachability returns lines in ACLs and firewall rules that can never match, because an earlier line shadows them or their match is empty.
  • searchFilters finds flows a filter permits or denies, so you can ask whether anything from a business subnet reaches a controller subnet.
  • testFilters shows how one flow is handled and which line it matches.

Where it stops. Batfish has no traffic log, so it cannot say which allowed paths are in use or which rules are unused. It has no model of OT zones or Purdue levels: the zone design has to be written as your own queries, and kept current when the site changes. It does not decide what happens to each rule, and it does not write a change plan or a rollback. It is a strong engine for parts 1 to 3 if someone on the team owns the queries, because the queries are the audit.

Capirca: policy as code

Capirca, released by Google under the Apache 2.0 license, generates access lists for many platforms from shared network and service definitions and high-level policy files. Its outputs include Cisco, Cisco ASA, Juniper SRX, Palo Alto PAN⁠-⁠OS and iptables.

Where it stops. Capirca reads its own policy format, not an exported firewall configuration, so it does not audit the rulebase a site already runs. It helps after an audit: once the conduits are agreed, a policy kept as code makes the next review a diff instead of a reading exercise.

Malcolm, Zeek and Wireshark: the traffic

The traffic side has mature open source tools, and they speak industrial protocols:

  • Malcolm, from Idaho National Laboratory and published through CISA under the Apache 2.0 license, analyzes packet captures, Zeek logs and Suricata alerts. Its Zeek parsers cover industrial protocols including Modbus, DNP3, EtherNet/IP and CIP, S7comm, BACnet and PROFINET, many of them from CISA’s ICSNPP project.
  • Zeek turns packet captures into connection and protocol logs, and is the engine under much of Malcolm.
  • Wireshark decodes single captures, with dissectors for Modbus/TCP, DNP3 and many other industrial protocols.

Where they stop. They show the traffic where the capture was taken, not what the firewall rules allow or which rule matched each session. A path the rules allow but nobody used in the capture window is invisible to them, and an attacker is not limited to the paths in use. A span port or tap in an OT network is also a change of its own, with its own window. The firewall’s traffic log already records the rule that matched each session, which is why an audit starts there.

GRASSMARLIN, the NSA’s passive ICS network mapper, still appears in older guides. Its repository was archived in April 2023 and is read-only.

Filling the gaps

Put together, the open source tools leave three parts of the audit to people:

  • Joining rules to traffic. Matching each session in the firewall log to the rule that allowed it, and each rule to the zones on either side, so a finding names the rule, the sessions and the hosts.
  • The decision on each rule. Keep, narrow, recertify, remove or retire, with its evidence and the owner’s sign-off.
  • The change plan. Ordered changes in the firewall’s own commands, each with pre-checks, verification and a rollback written first.

A spreadsheet and a careful engineer can do all three; the cost is that the next audit starts from a blank sheet. The OT firewall audit checklist lists every step so nothing is missed; customers and trial holders can download it as a printable PDF.

Where SegAudit fits

SegAudit is not open source. It covers the parts above that the open source tools leave to people: it reads the firewall configuration and its traffic log together, with the zone map you confirm, and writes the findings, the rule review and the change plan with a rollback for each change. Like Batfish, it runs offline; it never uploads the files and never connects to a firewall. The firewall audit tool page lists what it reads and produces, SegAudit for consultants covers client engagements, and the download page has the editions and requirements.

Common questions

Is there an open source firewall audit tool?

There are open source tools for parts of an audit. Batfish analyzes firewall and router configurations offline and finds rule lines that never match. Malcolm, Zeek and Wireshark analyze traffic, including industrial protocols. None of them joins rules, traffic and zone design into findings, rule decisions and a change plan with rollback.

Can Batfish audit a firewall for OT segmentation?

It can answer whether the rules allow traffic between two subnets and find shadowed lines, which covers much of the rule side. It has no model of OT zones or Purdue levels and no traffic log, so the zone design has to be written as queries, and it cannot say which allowed paths are in use.

Do I need packet captures to audit an OT firewall?

No. The firewall’s own traffic log records each session and the rule that matched it, which is what a rule review needs. Packet captures from tools such as Malcolm or Wireshark add protocol detail inside a zone, but adding a span port or tap in OT is a change that needs its own window.

Run the free Quick checkSee a sample deliverable

Last updated .