29. Firewall
This guide describes Lawliet 1.5.13.s (the current release). Screens, commands and procedures may change in later versions; the usage guide is updated with each release. Check the version your server runs under Settings > Platform or with ./lawliet version, and see the Releases page for what changed.
The Firewall area reads firewall rule sets - from a live connection or an imported configuration file - analyses them (shadowed, redundant, unused and risky rules, compliance mapping), proposes fixes, proves which fixes do not change any traffic decision, and can push an approved plan back to the device with an automatic rollback if the device does not come back as expected.
Permissions:
| Task | Permission | Four-eyes |
|---|---|---|
| See devices, rules, findings, plans, versions, monitoring | View firewall | - |
| Connect a device, import a file, make a plan, set a baseline, start monitoring, count hits from logs | Manage firewall | no |
| Apply a plan to a live firewall | Push firewall policy | yes - critical action "Push a firewall policy" |
29.1 Supported firewalls#
| Vendor | Live connection | Import a file |
|---|---|---|
| Cisco ASA | yes | yes |
| Cisco Firepower Threat Defense | yes, through its FMC (fields Access policy, FTD devices to deploy to, FMC domain) | yes |
| Cisco FTD (managed by FMC) | - (connect it as Cisco Firepower Threat Defense) | yes, an FMC export |
| Fortinet FortiGate | yes | yes |
| Palo Alto Networks PAN-OS | yes | yes |
| Check Point (R80+ Management API) | yes | yes |
| Juniper SRX (Junos) | yes | yes |
| SonicWall (SonicOS 7) | yes | yes |
| Sophos Firewall (SFOS) | yes | yes |
| pfSense / OPNsense | yes | yes |
| MikroTik RouterOS | yes | yes |
| Linux iptables, Linux nftables | yes, through the Lawliet agent on the host | yes |
| Huawei USG / HiSecEngine | - | yes |
| UserGate NGFW | - | yes |
| Simulated appliance (no hardware) | yes, for evaluation without a device | - |
An imported firewall is analysed and optimised in the same way; the change is delivered as a downloadable script or full configuration that you load on the device yourself.
29.2 The devices list#
Path: Firewall. The page title is Firewalls.
The Devices table: Name, Vendor, Connection, Status (offline file, unreachable, reachable, not read yet), Last read, Version, Drift ("matches baseline" or "drifted from baseline"), Rules, Risk. Click a row to open the device.
Below it: Connect a firewall and Import a configuration.
Procedure: connect a live firewall#
Permission: Manage firewall. Four-eyes: no (reading changes nothing).
Use a dedicated read-and-write account on the firewall for Lawliet, not a personal one.
- Open Firewall and go to Connect a firewall.
- Choose the Vendor. For a Linux host choose Linux host (iptables / nftables through the Lawliet agent).
- Fill Name, Host, Port (the default is shown), Username and Password (or API key for API-based vendors). For a Linux host give the Agent id and the Backend (iptables, nftables or auto) instead.
- Fill the vendor-specific fields when shown:
| Vendor | Extra fields |
|---|---|
| Cisco ASA | Enable password (blank: the login password), Context (multiple-context mode), Save unsaved running-config before applying |
| Cisco Firepower Threat Defense | Access policy, FTD devices to deploy to (comma separated), FMC domain (blank: the default domain) |
| FortiGate | VDOM |
| PAN-OS | vsys |
| Check Point | Access layer, Policy package, Install targets (comma separated) |
| MikroTik | Scheme (https or http) |
| Linux host | Agent id, Backend (iptables, nftables or auto) |
- Press Connect, test and read.
What you see: "Saving the connection...", "Testing the connection...", "Reading the policy...", then the device opens on its Policy tab.
"SSH devices record their host key on first use; compare it with the device console before applying." Do that check before the first apply.
If it fails: the error names the step. Typical causes: wrong port or credentials, the firewall does not allow management access from the Lawliet server's address, or an untrusted certificate. A failed connection is removed again.
Procedure: import a configuration file#
- Go to Import a configuration.
- Choose the Export file (at most 20 MB).
- Leave Vendor on Detect from the file, or choose it.
- Give a Name and press Import.
What you see: the device opens on its Policy tab, Status "offline file".
Procedure: test the connection and read the policy again#
Permission: Manage firewall. Four-eyes: no. Risk: none; both only read from the device.
- Open Firewall and click the device. The header shows the connection, its state (reachable, unreachable, not read yet), the current version and the baseline.
- Press Test connection. The line under the header says "Reachable" (with the host key for SSH devices) or "Not reachable: <reason>".
- Press Read now (it shows Working...). The line says one of: "Read: a new version was saved.", "Read: no change since the last version." or "Read: the policy differs from the approved baseline."
Read now is also on each live device's row in the devices list. An imported file has no connection, so neither button is shown; import the new export instead (29.2).
If it fails: "Not reachable: ..." names the cause (address, port, credentials, certificate, or management access not allowed from the Lawliet server).
Removing a device#
The console has no button to remove a firewall in this release. To stop Lawliet using a live device, do this instead:
- Open the device, tab Monitor, and press Stop monitoring, so no scheduled read runs.
- On the firewall itself, disable or delete the account you created for Lawliet. Lawliet can then no longer read or change the device.
- The device stays in the list as a record, with its versions and plans.
29.3 The device tabs#
| Tab | What it is for |
|---|---|
| Policy | The rules as read: Rule, Action, Zones, Source, Destination, Service, Hits. Filter rules and a section selector |
| Findings | What is wrong with the rule set (29.4) |
| Optimise | Choose fixes and make a plan (29.5) |
| Export | Download the current configuration, or plans as a change script, full configuration or model JSON (29.7) |
| Apply | Send a plan to the live firewall, four-eyes (29.6) |
| Versions | Every version read or planned; compare two; set a baseline (29.7) |
| Monitor | Scheduled reads, busiest rules, events, and hit counts from logs (29.8) |
29.4 Findings#
The header line says "N findings over R rules in S section(s)" and where the hit counts came from. Without hit counts, no rule is called unused.
| Finding | Meaning |
|---|---|
| Shadowed | An earlier rule matches all of this rule's traffic and decides differently, so this rule never applies |
| Redundant | An earlier rule already matches all of this rule's traffic with the same decision |
| Duplicate | Identical match and decision to an earlier rule |
| Repeats the default | The rule does what the section would do anyway |
| Exception to a later rule | A later, broader rule decides the opposite way |
| Overlapping, opposite decisions | Two rules partly overlap and decide differently; their order matters |
| Unused | No hits for long enough that the counters can be trusted |
| Disabled | Configured but switched off |
| Any to any allowed | An allow rule with no real restriction |
| Admin service open to any | A management service reachable from anywhere |
| Clear-text service | An unencrypted protocol allowed |
| Unused object, Duplicate object, Mergeable, Unresolved names | Object hygiene |
Lines not understood lists configuration lines the parser did not understand. They are kept and written back on export, but rules among them are not checked.
Compliance mapping maps the findings to PCI-DSS v4.0, NIST SP 800-53, CIS Controls v8 or ISO/IEC 27001 (choose in Framework).
29.5 Procedure: make an optimisation plan#
Permission: Manage firewall. Four-eyes: no (a plan is a new version in Lawliet, not a change on the device).
Open the device and the Optimise tab. The badge shows "N fixes, M safe".
Tick Disable rules instead of deleting them if you prefer disabling (easier to undo by hand).
Either press Plan all M safe fixes, or tick fixes and press Plan the N chosen fixes. Choose the safe ones ticks the safe set; Clear unticks all.
"Safe" fixes are proven not to change any traffic decision before the plan is saved. A fix marked as changing behaviour ("Applying this fix changes what the firewall lets through") is never in the safe set; choose it only after checking with the rule owner.
Wait for "Planning and proving...". The plan view shows the Change script, the Full configuration and the diff (Changed, Objects).
Next: apply it (29.6), or download it from Export and load it yourself.
29.6 Procedure: apply a plan to the firewall (four-eyes)#
Permission: Push firewall policy. Four-eyes: yes.
Risk: this changes what the firewall lets through. A wrong change can cut traffic, including management access.
Rollback: built in. Each apply runs these steps, shown live in Steps:
- Backup - read the running policy (and the vendor's own backup where it has one).
- Arm rollback - set up a restore that does not depend on Lawliet's connection surviving (a scheduled restore on the device,
commit confirmed, or an agent-side timer). - Change - push the plan.
- Verify - reconnect, read the policy back, and check it now means what was approved.
- Confirm - disarm the rollback.
If Lawliet cannot reconnect and confirm within the Rollback window, the armed rollback fires on the device by itself.
Procedure:
Open the device and the Apply tab. Choose the Plan.
Read "Target: <name> (<address>) through <SSH / API / the Lawliet agent>." and the plan.
Choose the Rollback window: 2, 3, 5 or 10 min. Use a longer window for slow devices.
Press Request apply. Type the reason and Send for approval.
What you see: "Four-eyes request #N: pending", "Waiting for a second person to approve."
The approver opens the same tab (or Approvals), reads the plan, optionally writes a Comment, and presses Approve or Reject.
The requester presses Run the approved apply.
What you see: "Approved apply started." The steps appear one by one; the status ends applied, failed or rolled back.
If it fails:
| What you see | Cause | Fix |
|---|---|---|
| "This firewall is import-only, so there is nothing to apply to." | Imported file or vendor without a live connection | Download the change script or full configuration from Export and load it on the device |
| "This plan is <status>." | The plan was already applied or is being applied | Make a new plan |
| A failed step and status rolled back | Verify did not match, or the connection was lost; the device restored itself | Read the step detail, fix the cause, apply again |
| "Choose the connected firewall to apply this plan to, or download the script." | The plan has no connection | Connect the device first |
29.7 Versions, baseline and export#
Versions lists every version (Version, Source, Summary, Rules, When). Versions are never deleted: every read, import and plan stays.
Procedure: compare two versions#
Permission: View firewall.
- Open the device, tab Versions. "Tick two versions to compare them."
- Tick the two versions (Compare v<N> on each row).
- Read the diff "Diff v<A> to v<B>": Removed, Added, Moved, Changed, Objects - or "The two versions are the same."
Procedure: set the baseline#
Permission: Manage firewall. Four-eyes: no. Risk: none on the device; it changes what Lawliet calls drift.
- Open the device, tab Versions.
- On the version that is the approved state, press Set as baseline. The row is marked baseline.
- What you see: from now on the devices list and the device header show "drifted from baseline" when a later read differs from it. To move the baseline, press Set as baseline on another version.
Procedure: export a configuration or a plan#
Permission: View firewall. Nothing is changed on the device.
- Open the device, tab Export.
- To save the current policy in the vendor's own syntax, press Download <vendor> configuration under Current version v<N>. Lines the parser did not understand are written back as they were.
- To save a plan, find it in the table (Plan, Status, Changes, Created) and press one of: script (only the change commands), full config (the whole optimised configuration) or model JSON (the policy model).
- The file downloads to your computer. Load a script or full configuration on the device by your own change procedure (this is the route for import-only firewalls).
"No plans yet: make one on the Optimise tab." means no plan exists; see 29.5.
29.8 Monitoring and hit counts#
Procedure: start or stop live monitoring#
Permission: Manage firewall. Four-eyes: no. Risk: each scheduled read logs in to the device and reads its policy; choose an interval the device's management plane can carry.
- Open the connected device, tab Monitor.
- Choose the interval (1, 5, 15, 60 or 240 min) and press Start monitoring. The tab then says "Read every N min" and shows Busiest rules and Events, refreshing by itself.
- To end it, press Stop monitoring. The tab says "Scheduled reads are off".
Procedure: count hits from logs#
For firewalls whose counters cannot be read. Each firewall log line collected in Logs names the rule that decided it. Permission: Manage firewall. Four-eyes: no. Nothing is changed on the device.
- Collect the firewall's logs first (a syslog source, chapter 30).
- Open the device, tab Monitor, section for hit counts from logs.
- Choose the Log sources, the Host the firewall logs as, and Days.
- Press Count from logs (it shows Counting...).
- What you see: the Hits column on the Policy tab and the Findings are worked out from the counts. Only rules that log can be counted; the rest stay unknown and are never called unused. When the device has its own counters, those win.
To stop using a device altogether, see "Removing a device" in 29.2.

