Preview, deploy and rollback
A deploy turns a host’s desired rules (plus its inherited policies and NAT rules) into commands and runs them over SSH. Every deploy is previewed, snapshotted first, and reversible. All of this happens in the host’s Deploy tab.

Preview
Section titled “Preview”Click Preview deploy. The preview shows:
- Changes since the last deployed version (since last deployed version vN, or (first deploy recorded by FireHawk)): added, removed, modified and moved rules, chain policy changes and NAT changes. Inherited policy rules are labelled
[policy NAME]. - A warning when the host has drifted, listing the manual changes this deploy will undo (remove (added on host), restore (removed on host), policy changes). When the host is in sync: The host matches the last deploy, so these are exactly the changes it will get.
- A note when the last operation was not a successful deploy (a rollback or a failure), since the host may then differ from the last version.
- Warnings, such as Address family warnings on IPv6 hosts, policy rules a backend cannot take, temporary rules, or a deploy outside the host’s maintenance windows.
- Shell commands, collapsed: the exact commands by step (
infra,add,remove,persist) with a note per command.
The preview is read-only: it reads the host but changes nothing.
Deploy
Section titled “Deploy”- Check the preview.
- Keep Safe deploy (auto-rollback if access is lost) ticked and pick a window (60, 120 or 300 seconds).
- Click Apply to host and confirm.
FireHawk takes a snapshot of the current firewall, runs the commands and shows Last operation with its status and the full log. The entry is added to Deployment history and the audit log, and a successful deploy records a new version.
Deploying needs the deploy permission on the host. To deploy later, at a given time or in a maintenance window, use Schedule…: it creates a one-host rollout run by the workers.
Dry run
Section titled “Dry run”Command dryrun (no execute) builds the commands and records them in the history with the status dry_run, without taking a snapshot or running anything on the host.
Safe deploy
Section titled “Safe deploy”Safe deploy protects against rules that lock FireHawk out:
- Before applying, FireHawk leaves a restore script and a timer on the host (files in
/var/lib/firehawk/). - It applies the rules on its current connection.
- It opens a new SSH connection. The old one could survive thanks to rules accepting established connections, so only a new connection proves access still works.
- If that succeeds, it cancels the timer and only then saves the rules for boot.
If the new rules lock FireHawk out, the timer fires when the window ends and the host restores its previous rules by itself. If a command fails during the apply, the previous rules are restored immediately.
| Status | Meaning |
|---|---|
applied |
Access was re-verified on a new connection and the rules were persisted. |
auto_rolled_back |
The host restored itself, or a failed command was undone. The previous rules are active again: review the log and the desired rules before retrying. |
rollback_pending |
FireHawk lost access after applying. The host restores its previous rules when the window ends. |
failed |
The deploy failed (without safe deploy, or before anything was applied). |
rolled_back |
A rollback entry (see below). |
dry_run |
A dry run. |
For rollback_pending, a background job asks the host for the outcome after the window and keeps asking every minute until the host answers; it survives restarts of FireHawk. Check now in the deployment history asks right away.
Reboots during the window
Section titled “Reboots during the window”- iptables and nftables: the boot configuration is only written after the confirmation, so a reboot during the window also brings back the old rules.
- ufw and firewalld store rules permanently while applying, so a reboot inside the window keeps the new rules.
Rollback
Section titled “Rollback”Each applied or failed entry in Deployment history has Rollback. It restores the snapshot taken before that deploy:
- iptables: the ruleset and the ipsets as they were (FireHawk’s
fh_*sets that did not exist are removed); - nftables: the
inet firehawktable reloaded atomically from its saved text (in full mode, the whole snapshot re-rendered); - ufw and firewalld: the saved rules re-applied.
The rollback is recorded as a rolled_back entry and audited. Rollback needs the deploy permission.
Persistence after apply and rollback
Section titled “Persistence after apply and rollback”After every deploy and every rollback the live ruleset becomes the host’s boot configuration, through the distribution’s own tooling. If a package is missing, the deploy still succeeds but the summary says not persisted, and Last operation explains: Applied, but not saved for reboot. Use Install on the host header (see Boot persistence).
After a reboot, hosts come back with the last applied state.
Deploying many hosts
Section titled “Deploying many hosts”- Host groups: Deploy group previews, dry-runs or deploys the group host by host from the browser.
- Rollouts: server-side batches with a canary, failure limits and scheduling. Preferred for more than a few hosts.
