Trunc reads your logs and puts the addresses that attack you on a blocklist for your account. trunc-ar, our client for Linux, drops them at the firewall of every server you run it on, about 25 seconds after the attack is logged.
Five failed SSH logins in under a minute, then the block. The last line is trunc-ar on the same server, 23 seconds after the fifth failure:
Nov 14 03:12:41 webserver sshd[21877]: Failed password for root from 198.51.100.23 port 51144 ssh2
Nov 14 03:12:44 webserver sshd[21877]: Failed password for root from 198.51.100.23 port 51144 ssh2
Nov 14 03:12:49 webserver sshd[21880]: Failed password for admin from 198.51.100.23 port 51152 ssh2
Nov 14 03:12:53 webserver sshd[21880]: Failed password for admin from 198.51.100.23 port 51152 ssh2
Nov 14 03:12:58 webserver sshd[21884]: Failed password for deploy from 198.51.100.23 port 51160 ssh2
Nov 14 03:13:21 webserver trunc-ar[1187]: info: applied 1 IPv4 (+1 -0, ipv6 skipped 0, dup 0) backend=nft in 12 ms To see what it blocked and why:
$ sudo trunc-ar check 198.51.100.23
198.51.100.23: on the block list
kernel: in set block_a_1 Five failures from one address inside a minute is the default brute force threshold. The address went on your account's list, and every server running trunc-ar dropped it, including the ones it hadn't tried yet. Nobody had to be awake at 3am for that. The alert still tells you it happened.
Your servers send their logs to Trunc, through our agent or over syslog.
Brute force, web scanning (a run of 404s or 403s) or a burst of server errors (500s) from one address, at thresholds you set.
Within about 10 seconds it's on your account's blocklist on the log server. One list covers all of your servers.
trunc-ar checks the list every 15 seconds and drops listed IPv4 addresses in the raw prerouting hook, before ufw, firewalld and Docker see the packet. An unchanged list is a 304 and costs about a tenth of a second of CPU.
About 25 seconds from the attack to the block. An address stays blocked for the Response timeout you set, 30 minutes by default, then drops off the list and the next check unblocks it.
Any address that trips one of these, per minute, from one source address. You change the thresholds and the Response timeout under Settings > Security responses.
| Trigger | Default |
|---|---|
| Brute force (SSH, RDP, web logins) | 5 failed logins a minute |
| Web scanning | 8 responses of 404 or 403 a minute |
| Server errors | 8 responses of 500 a minute |
| Response timeout (how long an address stays blocked) | 30 minutes (10 minutes to 2 days) |
/etc/trunc-ar/allow.confCrawlers and CDNs are matched by the IP ranges Google, Bing and each CDN publish, refreshed daily. A request that only claims to be Googlebot in its User-Agent gets no pass, since anyone can type that header.
If trunc-ar can't get a fresh list for 24 hours, it releases all blocks by itself, so an old list can't keep blocking forever. Turning Active response off on the dashboard empties the list, and every server drops its blocks on the next check.
To remove every block on a server right away:
sudo systemctl stop trunc-ar
Open Settings > Security responses, turn on Active response and check the thresholds and the Response timeout.
curl -fsSL https://trunc.org/downloads/trunc-ar-install.sh | sudo sh -s -- '<your list URL>' The dashboard has this command with your list URL filled in, in the Block on your servers card. The installer adds the IP you're connected from to allow.conf. Blocking starts as soon as it finishes, with no dry-run, so start with one server.
Which plan includes it?
All of them, including the free trial. Pricing.
Do I need the Trunc agent?
No. Your logs can come in over syslog or through the agent, and trunc-ar installs on its own. A server that sends no logs still blocks the addresses your other servers caught, because the list covers the whole account.
What about Windows and macOS?
trunc-ar runs on Linux only. On other systems, fetch the list yourself and feed it to your firewall.
Can I use another firewall?
Yes. The list is plain text at a URL (Settings > Endpoints): a
# header line, then one address per line. Anything that can
fetch it and skip the header can block on it.
The list format.
14 days free trial. No credit card required.