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.13 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.1.1

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.1.1
File Size Uploaded Provenance Actions
fireman-0.1.1.tar.gz 79.9 kB With provenance Details for fireman-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 179.5 kB

Release files / fireman-0.1.1.tar.gz

Download URL fireman-0.1.1.tar.gz
Size 79.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ceb04013fb77a286f37d7b4e2becfb4f2acfb1971b0c503db69fcc7cb9e23a33
BLAKE2b-256 checksum
How to use checksums
911ef2537c7d50182912afbe0c99d5dfa4023cdaac14086bc7f89e4c5d227fb9
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 Nov 29, 2026.

Transparency log

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

Download URL fireman-0.1.1-py3-none-any.whl
Size 99.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1c406f9c7d961e6d1636b6c847c66ddf03f652b5fc79570599b6174caf7dbca
BLAKE2b-256 checksum
How to use checksums
bc2b23dc9a5d044cde73f7c4e33ca2772787c52c10d0776c7611a1e7f20b8669
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 Nov 29, 2026.

Transparency log

Security for fireman 0.1.1

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.1.1.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 Nov 29, 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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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