From 1.7.4 the firewall puts some problems right by itself and tells you only when it cannot. There are four checks. All are on by default, and you find them under Monitoring › System status, panel Self-healing: what each one did, and its settings.
Each check compares with what worked before. Something that was already broken is never a reason to act or to alert.
1. A change that breaks a service is undone by itself
When you commit with Safety rollback ticked (on the commit page), the firewall checks, just before it applies your change:
- DNS through the firewall's own resolver (IPv4 and IPv6),
- the internet on each internet port (IPv4 and IPv6),
- the VPN tunnels that are up (IPsec, OpenVPN connections, WireGuard sites with a keepalive),
- the route monitors that are up.
After the change it checks the same again every 10 seconds. If something that worked before still fails after 60 seconds, the firewall undoes the change at once, the same way it does when you don't press Keep these settings in time. You don't wait for the 5 minutes, and you don't lose the console.
You then see:
- in the commit history, the reason, for example rolled back: a service stopped working after the commit: DNS through the firewall's resolver (IPv4) (i/o timeout); after the rollback each of them works again;
- an alert Commit 42 by admin was rolled back: a service stopped working;
- an entry in the audit log (action config.rollback.service-loss).
After undoing the change the firewall checks the service once more. If it still fails, the reason says so: the cause is then probably outside the firewall (the provider, the other end of the tunnel).
What never undoes a change:
- a service that already failed before you committed;
- a service that works even once during the 60 seconds (a link that comes and goes);
- a route monitor or tunnel your change removed;
- a failover pair handing over during those 60 seconds.
A commit without Safety rollback is never undone this way: you said the change is final. Pressing Keep these settings ends the checks.
2. More checks after an update
An update already goes back by itself when the new version cannot apply its configuration, load its rules or reach the internet. From 1.7.4 it also goes back when DNS stops answering, a VPN tunnel that was up stays down, intrusion prevention does not run, or an add-in that worked has failed. See Updating Korthveil, section How an update works.
3. Add-ins restarted by their health
An add-in that reports a problem or stops answering for 5 minutes is restarted once, and checked. You get the alert only if it does not come back. See Restart an add-in.
4. The engine watchdog
The daily malware protection self-test checks that the protections are loaded. The engine watchdog checks that they work: every 4 hours, each one that is on gets a harmless test through the engine itself.
| Engine | The test |
|---|---|
| Intrusion prevention | Suricata checks a harmless test rule against the running settings, and, when traffic went through it since the last test, its packet counter moved too |
| DNS filter (filtering on) | The firewall asks its own DNS service for a reserved test name (korthveil-selftest.dns-filter.example.net). Only the blocklist zone, loaded and in use, answers it with the test addresses 192.0.2.53 and 2001:db8::53 |
| Web filter | The web filter's engine must block a reserved test name (korthveil-selftest.web-filter.example.net) |
| TLS inspection | The inspection proxy signs a certificate for a reserved test name with its CA, and a test connection inside the firewall accepts it |
Nothing leaves the firewall, and no device sees these tests. The names are under example.net, a domain reserved for examples, and the addresses lead nowhere.
A test that fails is tried again 10 minutes later. Two failures in a row raise the alert DNS filter failed its self-test twice (for example), with what failed. It clears by itself when a test passes again. The DNS filter in monitor mode answers every name, so it is not tested then.
Settings
Under Monitoring › System status, panel Self-healing:
| Setting | Default | Range |
|---|---|---|
| Roll back on service loss | On | |
| Time to fail | 60 seconds | 30 to 600 |
| Restart add-ins by their health | On | |
| After | 5 minutes | 1 to 60 |
| Engine watchdog | On | |
| Every | 4 hours | 1 to 24 |
Press Save to pending changes, then commit, like any setting. A commit that turns Roll back on service loss off is itself not watched.
The alerts can be turned off one by one under Monitoring › Alerts › Checks: Commits that failed or rolled back, Add-ins degraded or failed and Security engine watchdog.
For automation
GET /api/v1/selfheal returns the settings in effect, the commits watched and rolled back, the add-ins being looked after and the watchdog's results. GET /api/v1/selfheal/services returns what the firewall serves now. See the API reference.