fireman classify#
classify walks every policy of a workspace and reports each rule that is
shadowed, redundant, correlated, a generalization or empty, together with the
rules that cause it. Concepts explains each anomaly. Clean policies
have no rows in the table. Findings are cached per firewall, so a second run on
an unchanged estate skips the work.
Synopsis#
fireman classify [--name WORKSPACE] [--format table|json|yaml] [--no-implicit-deny] [--no-cache]
Option |
Meaning |
Default |
|---|---|---|
|
Workspace to read |
|
|
|
|
|
Don’t add the final deny-all rule (see the implicit deny) |
off |
|
Recompute every firewall and refresh the cache |
off |
Examples#
With the sample estate loaded (fireman load estate.yaml):
estate.yaml
# A small estate: one firewall, `edge`, between the internet, a DMZ and the LAN.
# The docs use it throughout. `inbound` is seeded with anomalies; `outbound` is
# clean.
addresses:
- name: lan
values: [10.1.0.0/16]
- name: dmz
values: [192.168.10.0/24]
- name: web-servers
values: [192.168.10.10, 192.168.10.11, 192.168.10.12]
fqdns:
- name: update-server
fqdn: updates.example.com
addresses: [203.0.113.10]
resolved_at: 2026-11-20T08:00:00Z
- name: partner-api
fqdn: api.partner.example
addresses: [203.0.113.50]
resolved_at: 2026-11-20T08:00:00Z
services:
- name: web
entries:
- {protocol: 6, ports: [80, 80]}
- {protocol: 6, ports: [443, 443]}
- name: ssh
entries:
- {protocol: 6, ports: [22, 22]}
- name: dns
entries:
- {protocol: 17, ports: [53, 53]}
- {protocol: 6, ports: [53, 53]}
groups:
# Every DMZ host except the web servers. A global group sees the global
# `web-servers`, even inside `edge`, which has its own.
- name: dmz-hosts
kind: address
include: [dmz]
exclude: [web-servers]
firewalls:
- name: edge
addresses:
# edge publishes only two of the three web servers.
- name: web-servers
values: [192.168.10.10, 192.168.10.11]
policies:
- name: inbound
rules:
- order_id: 10
name: block-abusers
action: deny
sources: [198.51.100.0/24]
destinations: [web-servers]
services: [web]
- order_id: 20
name: allow-web
action: accept
sources: [any]
destinations: [web-servers]
services: [web]
- order_id: 30
name: allow-partner-https
action: accept
sources: [203.0.113.0/24]
destinations: [web-servers]
services:
- {protocol: 6, ports: [443, 443]}
- order_id: 40
name: block-scanners
action: deny
sources: [192.0.2.0/24]
destinations: [web-servers]
services: [web]
- order_id: 50
name: allow-partner-api
action: accept
sources: [partner-api]
destinations: [web-servers]
services: [web]
- order_id: 60
name: allow-admin-ssh
action: accept
sources: [lan]
destinations: [dmz-hosts]
services: [ssh]
- name: outbound
rules:
- order_id: 10
name: allow-dns
action: accept
sources: [lan]
destinations: [any]
services: [dns]
- order_id: 20
name: allow-updates
action: accept
sources: [dmz-hosts]
destinations: [update-server]
services: [web]
- order_id: 30
name: allow-web-out
action: accept
sources: [lan]
destinations: [lan, dmz]
destination_negate: true
services: [web]
- order_id: 40
name: allow-ping
action: accept
sources: [lan]
destinations: [any]
services:
- {protocol: 1, icmp_type: 8}
fireman classify
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) │
└──────────┴─────────┴───────────────────────────────────┴────────────────┴─────────────────────────────┘
0 of 1 firewall from cache
The last line goes to stderr (see the cache). One row per finding, in rule order. Read it as “Rule is Anomaly because of Related”:
allow-webaccepts the web traffic thatblock-abusersalready denies for one range. It contains that rule entirely, so it is both a generalization and correlated: the usual “exception first” pattern.allow-partner-httpsandallow-partner-apionly allow whatallow-webalready allows: redundant.block-scannerswould deny traffic thatallow-webhas already accepted: it never fires and is shadowed.
The same findings as YAML, with the clean outbound policy listed too:
fireman classify --format yaml
- firewall: edge
policy: inbound
findings:
- rule:
order_id: 20
name: allow-web
anomaly: generalization
related:
- order_id: 10
name: block-abusers
- rule:
order_id: 20
name: allow-web
anomaly: correlated
related:
- order_id: 10
name: block-abusers
- rule:
order_id: 30
name: allow-partner-https
anomaly: redundant
related:
- order_id: 20
name: allow-web
- rule:
order_id: 40
name: block-scanners
anomaly: shadowed
related:
- order_id: 20
name: allow-web
- rule:
order_id: 50
name: allow-partner-api
anomaly: redundant
related:
- order_id: 20
name: allow-web
cached: false
- firewall: edge
policy: outbound
findings: []
cached: false
Each policy carries cached: true when its firewall’s findings came from the
cache, false when they were just computed (the run above is a first run).
--format json gives the same structure. A rule without a name has
name: null and is labelled order_id 30 in the table.
The cache#
Each firewall’s findings are stored under a digest of the Fireman version, the
--no-implicit-deny setting, the global objects and that firewall. Change any
of them and the firewall is recomputed; the rest come from the cache. The
findings are the same either way, so you never need to clear it for correctness.
After the report, a line on stderr says how many of the workspace’s firewalls
were reused, for example 1 of 1 firewall from cache; with --no-cache it
reads 0 of 1 firewall from cache. Every firewall counts, including one with
no policies, and a workspace with none prints 0 of 0 firewalls from cache.
Stdout stays clean, so JSON and YAML still parse.
--no-cache forces a full recompute and refreshes the stored findings, and
fireman cache deletes them.
Common errors#
Message |
Exit |
Cause |
|---|---|---|
|
2 |
Nothing loaded under that name here |
|
2 |
Stored by an older Fireman |
|
1 |
See global options |