fireman covered#

covered answers “is this already allowed?” (or blocked). For each request it tells you whether the policy gives all of that traffic the action you want, and which rules decide each part. The exit code carries the answer, so it works as a check in scripts. It takes exactly the same inputs as fireman place, and compiles only the chosen policy.

Synopsis#

fireman covered --firewall FW --policy P [--action accept|deny]
                (--src V... --dst V... SERVICE... | --requests FILE)
                [--name WORKSPACE] [--no-implicit-deny] [--format table|json|yaml]

The options are those of place; see its table. In short: --firewall and --policy are required, the request comes from --src/--dst plus services (--service, --tcp, --udp, --tcp-range, --udp-range, --icmp, --icmp-code, --protocol) or from --requests FILE, and --action applies to requests without their own.

Exit codes:

Code

Meaning

0

Every request is covered

1

At least one request is not

2

Bad input; nothing was checked

An empty requests file, or one holding [], is bad input (exit 2), so a CI gate never passes on zero requests.

Traffic no rule decides (possible with --no-implicit-deny) is not covered.

Examples#

Load the sample estate first (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}

Is HTTPS from the partner network to the web servers allowed?

fireman covered --firewall edge --policy inbound --action accept \
  --src 203.0.113.0/24 --dst web-servers --tcp 443
echo $?
                                       Coverage
┏━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓
┃ Request ┃ Action ┃ Covered ┃ Decided by                                  ┃ Missing ┃
┡━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩
│ #1      │ accept │ yes     │ allow-web (order_id 20)                     │         │
│         │        │         │ 203.0.113.0/24 > 192.168.10.10/31 : tcp 443 │         │
└─────────┴────────┴─────────┴─────────────────────────────────────────────┴─────────┘
0

Decided by lists each rule that gives part of the request the wanted action, with that part as sources > destinations : services. Missing does the same for the parts that get the other action, or none. Here web-servers is edge’s own two servers, 192.168.10.10/31.

The same check as JSON, for scripts:

fireman covered --firewall edge --policy inbound --action accept \
  --src 203.0.113.0/24 --dst web-servers --tcp 443 --format json
[
  {
    "name": null,
    "coverage": {
      "action": "accept",
      "covered": true,
      "granted": [
        {
          "rule": {
            "order_id": 20,
            "name": "allow-web"
          },
          "traffic": [
            {
              "sources": [
                "203.0.113.0/24"
              ],
              "destinations": [
                "192.168.10.10/31"
              ],
              "services": [
                "tcp 443"
              ]
            }
          ]
        }
      ],
      "missing": []
    }
  }
]

In missing, a rule with order_id and name both null is the implicit deny, and a rule that is itself null is undecided traffic.

Every request in requests.yaml:

requests.yaml
# Requests against edge/inbound, for `fireman place` and `fireman covered`.
- name: partner-https
  action: accept
  sources: [203.0.113.0/24]
  destinations: [web-servers]
  services:
    - {protocol: 6, ports: [443, 443]}
- name: admin-ssh
  action: accept
  sources: [lan]
  destinations: [dmz-hosts]
  services: [ssh]
- name: monitoring-ping
  action: accept
  sources: [10.1.20.0/24]
  destinations: [dmz]
  services:
    - {protocol: 1, icmp_type: 8}
- name: block-scanners
  action: deny
  sources: [192.0.2.0/24]
  destinations: [web-servers]
  services: [web]
fireman covered --firewall edge --policy inbound --requests requests.yaml
echo $?
                                                        Coverage
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Request         ┃ Action ┃ Covered ┃ Decided by                             ┃ Missing                                ┃
┡━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ partner-https   │ accept │ yes     │ allow-web (order_id 20)                │                                        │
│                 │        │         │ 203.0.113.0/24 > 192.168.10.10/31 :    │                                        │
│                 │        │         │ tcp 443                                │                                        │
│ admin-ssh       │ accept │ yes     │ allow-admin-ssh (order_id 60)          │                                        │
│                 │        │         │ 10.1.0.0/16 > 192.168.10.0/29,         │                                        │
│                 │        │         │ 192.168.10.8/31, 192.168.10.13/32,     │                                        │
│                 │        │         │ 192.168.10.14/31, 192.168.10.16/28,    │                                        │
│                 │        │         │ 192.168.10.32/27, 192.168.10.64/26,    │                                        │
│                 │        │         │ 192.168.10.128/25 : tcp 22             │                                        │
│ monitoring-ping │ accept │ no      │                                        │ implicit deny                          │
│                 │        │         │                                        │ 10.1.20.0/24 > 192.168.10.0/24 : icmp  │
│                 │        │         │                                        │ type 8                                 │
│ block-scanners  │ deny   │ no      │                                        │ allow-web (order_id 20)                │
│                 │        │         │                                        │ 192.0.2.0/24 > 192.168.10.10/31 : tcp  │
│                 │        │         │                                        │ 80, tcp 443                            │
└─────────────────┴────────┴─────────┴────────────────────────────────────────┴────────────────────────────────────────┘
1

Two requests are not covered, so the exit code is 1. admin-ssh shows how dmz-hosts resolves: the DMZ minus the three global web servers, as prefixes. Run fireman place with the same file to see how to fix the other two.

Common errors#

The same as for place, all with exit 2, including a request that matches no traffic (an empty group never counts as covered). One more you may meet with a requests file:

Error: requests[1].sources: unknown address name or invalid address 'lab'

lab in the second request (admin-ssh, index from 0) is neither a name in the workspace nor an address.