Skip to main content

Fireman

Firewall modelling and analysis, built on the FIREMAN paper.

Fireman reads your firewall policies and points at the rules that don't do what they seem to. Each policy is walked in order with every rule turned into an exact set of packets, so overlaps between address ranges, groups, port ranges and negated fields are worked out, never guessed.

What it finds

  • Shadowed: the rule never fires, and earlier rules give some of its traffic the other action. Usually a mistake.
  • Redundant: removing the rule changes nothing, because earlier rules already give its traffic the same action, or later rules would once it is gone.
  • Correlated: the rule overlaps an earlier rule with the other action, so their order decides what the overlap gets.
  • Generalization: the rule also contains the whole of that earlier rule, a narrow exception before a broad rule. Often intended, worth a look.
  • Empty: the rule matches no traffic, for example through a group that excludes everything it includes.

It also answers the everyday questions: is this traffic already allowed (fireman covered), where would a new rule go (fireman place), and what uses this object (fireman usage).

Install

Fireman needs Python 3.12 or newer. For the fireman command, install it as a tool:

uv tool install fireman     # or: pipx install fireman
fireman --help

To use it from your own Python code, add it to your project instead:

uv add fireman              # or: pip install fireman

Quickstart

Download the sample estate (one firewall, two policies), load it, then classify it:

curl -O https://raw.githubusercontent.com/HorusTheSonOfOsiris/fireman/main/docs/examples/estate.yaml
fireman load estate.yaml
fireman classify
Loaded workspace 'default': 1 firewalls, 2 policies, 10 rules, 10 objects.
                                                Findings
┏━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Firewall ┃ Policy  ┃ Rule                              ┃ Anomaly        ┃ Related                     ┃
┡━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ edge     │ inbound │ allow-web (order_id 20)           │ generalization │ block-abusers (order_id 10) │
│ edge     │ inbound │ allow-web (order_id 20)           │ correlated     │ block-abusers (order_id 10) │
│ edge     │ inbound │ allow-partner-https (order_id 30) │ redundant      │ allow-web (order_id 20)     │
│ edge     │ inbound │ block-scanners (order_id 40)      │ shadowed       │ allow-web (order_id 20)     │
│ edge     │ inbound │ allow-partner-api (order_id 50)   │ redundant      │ allow-web (order_id 20)     │
└──────────┴─────────┴───────────────────────────────────┴────────────────┴─────────────────────────────┘

load validates the file and keeps it as a workspace in .fireman/ in the current directory. Every other command reads from there, so you load once and ask many questions. The outbound policy is clean, so it has no rows.

From Python

The same models back the files, so you can build a policy in code, compile it and classify it:

import click

from fireman import BDDManager, compile_inventory
from fireman.model import Firewall, Inventory, Policy, Rule

https = {"protocol": 6, "ports": [443, 443]}
rules = [
    Rule(
        order_id=10,
        name="allow-lan",
        action="accept",
        sources=["10.0.0.0/8"],
        destinations=["any"],
        services=[https],
    ),
    Rule(
        order_id=20,
        name="block-guests",
        action="deny",
        sources=["10.9.0.0/16"],
        destinations=["any"],
        services=[https],
    ),
]
policy = Policy(name="outbound", rules=rules)
inventory = Inventory(firewalls=[Firewall(name="edge", policies=[policy])])

compiled = compile_inventory(inventory, BDDManager(nodes=1 << 20, cache=1 << 18, threads=1))
for finding in compiled.policies["edge", "outbound"].classify():
    click.echo(f"{finding.rule.name} {finding.anomaly} {[r.name for r in finding.related]}")
block-guests shadowed ['allow-lan']

To read files instead, fireman.Pipeline().load(fireman.yaml_file(path)) gives the same Inventory.

License

Fireman is licensed under the GNU Affero General Public License v3.0. See LICENSE.

Metadata

Release files for fireman 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fireman 0.2.0
File Size Uploaded Provenance Actions
fireman-0.2.0.tar.gz 82.7 kB With provenance Details for fireman-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fireman 0.2.0
File Interpreter ABI Platform Actions
fireman-0.2.0-py3-none-any.whl Python 3 none any Details for fireman-0.2.0-py3-none-any.whl

Total release size: 185.8 kB

Release files / fireman-0.2.0.tar.gz

Download URL fireman-0.2.0.tar.gz
Size 82.7 kB
Tags Source
SHA-256 checksum
How to use checksums
59f8330f38fdf930be64c3d341b84e68e002140c3b80aa84bf31b4efab597173
BLAKE2b-256 checksum
How to use checksums
ccffe4c0575a313da61d0f6612844b0405209a9b1d7dabb7867fa20a92124db7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

Release files / fireman-0.2.0-py3-none-any.whl

Download URL fireman-0.2.0-py3-none-any.whl
Size 103.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c279c74cae4247491a3c271f5b3a4b64384b8fcbe66ac8387996671f9ed7ec39
BLAKE2b-256 checksum
How to use checksums
ac29626f2ae323e7b5ee66cb7756d141034a3958989a52bddb554cccd056d978
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

Security for fireman 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fireman-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page