Skip to content

Layered policies

A policy is a set of backend-neutral rules applied to many hosts: SSH only from the admin network, monitoring access, a threat feed block list, a final deny. FireHawk places policy rules around each host’s own rules: top policies before them, bottom policies after them.

Policies are never copied into hosts. They are added at deploy time, so editing a policy changes every affected host on its next deploy.

Creating and editing policies needs the policies.manage permission.

Policies page with top policies applied to all hosts and to host groups

top policies: all hosts → host group → host tags
the host's own rules
bottom policies: host tags → host group → all hosts

All-hosts policies are outermost, then groups, then tags. Within a layer, lower Priority comes first, then the name.

  1. Open Policies and click New policy.

  2. Fill in:

    Field Notes
    Name Letters, digits, ., _, -; for example ssh-from-admin.
    Placement Top: before the host’s rules or Bottom: after the host’s rules.
    Priority (lower first) 0 to 10000.
    Description
    Enabled Disabled policies are not deployed.
    Applies to All hosts, or host groups and/or Host tags (comma separated) such as prod, web.
  3. Add rules:

    Field Values
    Direction Inbound, Outbound, Forwarded
    Action accept, drop, reject
    Protocol tcp, udp, icmp, icmpv6 or any
    Source, Destination address, CIDR or alias
    Source port, Destination port ports or port aliases
    In interface, Out interface enabled by direction (outbound rules see outgoing traffic only, and so on)
    State connection state
    Lifetime permanent or temporary
  4. Click Create policy.

Policy rules are written into each backend’s base chains, by direction:

Backend Inbound Outbound Forwarded
iptables, managed-chain mode INPUT OUTPUT FORWARD
iptables, full mode INPUT of the filter table (and filter (IPv6) when IPv6 is managed) OUTPUT FORWARD
nftables input output forward
ufw IN OUT ROUTED
firewalld default zone skipped skipped
  • On full-mode iptables hosts a rule that can only match one IP version (literal addresses, icmp or icmpv6) is only copied into that family’s table.
  • On full-mode nftables hosts rules go to the filter base chain of the matching hook in inet firehawk, else the first inet table, else ip/ip6. A host without a matching base chain skips them.
  • ufw and firewalld cannot match connection state: policy rules with a state are skipped there.

Skipped rules appear as warnings in the host’s deploy preview and in its inherited policies.

The host’s Desired tab shows Inherited policies: the number of rules before and after the host’s rules, any warnings, and the policies in Before this host’s rules (top), After this host’s rules (bottom) and Excluded on this host.

A host can opt out of a single policy: click Exclude on this host and enter a reason, which is recorded in the audit log. The policy’s rules leave this host on its next deploy. Include again reverses it. Exclusions need the policies.manage permission.

The policy list shows how many hosts each policy applies to and which have changes (to deploy). To deploy them:

  • click Roll out on the policy card to start a rollout of its hosts; or
  • deploy the hosts one by one or per group.

Deleting a policy removes its rules from its hosts on their next deploy.

Policy rules carry the comment policy:<name> … on the host. When FireHawk reads rules from a host (Load from host, takeover, templates from live rules) it skips rules whose comment starts with policy:. Never use that prefix in a host rule’s comment.