Automatic blocking
Ban for a while the sources whose packets to the appliance are rejected too often.
Automatic blocking bans for a while any source whose packets to the appliance are rejected too often: a port scan, a brute-force attempt on a closed service, a misconfigured client hammering a port.
Counting is done by the kernel itself, so a scan is detected even when it sends thousands of packets per second.
How it works
- Only rejections of traffic addressed to the appliance itself are counted — not traffic crossing the appliance when it acts as a gateway.
- Sources in the trusted networks and the addresses of the appliance are never counted, so they are never banned.
- A source rejected more than N times within the window is added to the ban list. All its packets to the appliance are then dropped, right after the trusted networks and before any other rule, until the ban duration is over.
- Every ban is logged once (prefix
ARTICA:BAN:) and appears in the firewall events as Banned automatically. - The ban list is saved every 5 minutes and restored after a reboot.
- IPv4 and IPv6 sources are banned in the same way when IPv6 filtering is enabled.
Rejections are those of your Drop rules, of the connection limits and of the Finally deny all policies.
Enable it
Automatic blocking is disabled by default. Go to Your Firewall › Parameters, section Automatic blocking, and click it:
| Field | Default | Range | Meaning |
|---|---|---|---|
| Automatic blocking | off | Enables the feature. | |
| Rejections | 20 | 3 – 1000 | Number of rejected packets that triggers the ban. |
| Within (seconds) | 300 | 60 – 3600 | The window in which they are counted. |
| Ban duration (seconds) | 3600 | 60 – 604800 | How long the source stays banned (up to 7 days). |
The change is applied immediately and recorded in the configuration history, with the usual confirmation.
Before enabling it, check that the networks you administer the appliance from are declared as trusted networks: a few mistyped connections to a closed port must not ban your own workstation.
See and lift the bans
Go to Your Firewall › Events, tab Banned. Each line shows the address, its country and host name when they are known, and the remaining ban time.
Click Unban to remove an address from the list immediately.
The packet tester reports a banned source as banned automatically.
REST API
| Method and path | Purpose |
|---|---|
GET /firewall/config/autoban |
The settings: {"enabled": 1, "hits": 20, "window": 300, "time": 3600}. |
PUT /firewall/config/autoban |
Change them (same fields). |
GET /firewall/autoban |
The banned addresses, with the remaining time, country and host name. |
DELETE /firewall/autoban/{ip} |
Unban an address (no error if it was not banned). |
From the command line
ipset list artica_autoban # banned IPv4 addresses and their remaining time
ipset list artica_autoban6 # banned IPv6 addresses
grep 'ARTICA:BAN:' /var/log/firewall.log