This page explains what happens between the moment you save a rule and the moment the kernel filters packets with it.
It answers the usual questions: when is my rule active? why is it not applied? in which order are rules evaluated? what happens to rules added by other software?
When you create, modify, enable, disable, move or delete a rule, a NAT entry, a masquerade rule, a service or an interface setting, the console sends the change to the Artica service, which stores it and schedules a rebuild of the firewall.
The badge at the bottom of the rules table tells you the outcome:
| Badge | Meaning |
|---|---|
| Applied hh:mm:ss (blue) | The last rebuild was accepted by the kernel at that time. |
| Changes waiting to be applied (orange) | A change was saved; the rebuild starts within a few seconds. |
| Applying the firewall rules | A rebuild is running. |
| N rules refused by the firewall (red) | The kernel refused some rules during the last rebuild: they are not active. Click the badge to list them with the exact error returned by iptables, then fix or disable each rule. |
Artica does not empty the firewall and then add rules one by one.
It builds the complete rule set in memory, has it validated by the kernel, and applies it with one transaction per table (filter, nat, mangle):
This is why the firewall never leaves the appliance unprotected during a rebuild, even on a slow appliance with thousands of rules.
A rebuild only replaces what Artica owns:
in_<interface>, out_<interface>, in_ALL, NAT and masquerade chains…);INPUT, OUTPUT, FORWARD, PREROUTING, POSTROUTING), which carry the comment ARTICA.BUILD.Everything else survives a rebuild: rules and chains added by Docker, Fail2ban, a VPN, a script of yours, and the chains maintained by Artica protection modules (CrowdSec, DecisionIP, trusted networks, SSH black list, GlusterFS, network namespaces, Reverse-Proxy firewall). Each of those modules keeps its own chain and repairs it by itself.
Protection modules are reached from the beginning of the INPUT chain. Artica keeps them in a fixed order, whatever the order in which the modules started:
| Position | Rule | Purpose |
|---|---|---|
| 1 | Loopback and Artica service access (LOOPBACK.ALLOW, ARTICAREST.ALLOW) |
The appliance always reaches its own services. |
| 2 | Proxy anti-flood (ANTIFLOOD.SQUID) |
Addresses flooding the proxy are dropped first. |
| 3 | Trusted networks (in_trusted) |
Trusted networks are accepted before any black list. |
| 4 | CrowdSec (in_crowdsec) |
Addresses banned by CrowdSec. |
| 5 | SSH black list (art_sshblock) |
Addresses banned after SSH authentication failures. |
| 6 | GlusterFS (in_glusterfs) |
Storage cluster peers. |
| 7 | DecisionIP (DECISIONIP) |
IP reputation lists. |
| 8 | Proxy schedule (SQUID_SCHEDULE) |
Time-of-day restrictions of the proxy. |
| 9 | Your interface rules (in_<interface>, in_ALL) |
The rules of the rules table. |
Two consequences worth knowing:
The order is checked after each rebuild, each time a module installs its chain, and every 3 minutes. When it is already correct, nothing is touched; when it is not, the misplaced rules are moved in one transaction and keep their packet counters.
Before building, Artica checks each rule. A rule that cannot be built is shown with an orange label in the rules table instead of being silently ignored. Typical reasons:
Every 3 minutes, Artica compares the enabled rules with the rules present in the kernel:
iptables -F), the firewall is rebuilt;ARTICA:REJECT:, at most 1 line per second (bursts of 5), so that a port scan cannot fill the disk.ARTICA:LOG:<rule id>: and lets them continue to the next rules.See Firewall events to read them.
These commands are read-only:
# The transaction the next rebuild would apply, without applying it
articarest -firewall-build-plan
# Rules owned by the Artica rebuild
iptables-save | grep -c ARTICA.BUILD
# Order of the protection rules
iptables -S INPUT | head -15
# Duplicated rules (should print nothing)
iptables-save | sort | uniq -d | grep '^-A'
The Stop button of the parameters page removes all the rules: the appliance is no longer filtered until you click Restart or Apply Firewall rules.
To remove the firewall completely, use uninstall on the same page.