Active response

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.

Free 14-Day Trial
**No credit card required.

From log line to firewall drop

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.

How it works

  1. Logs arrive

    Your servers send their logs to Trunc, through our agent or over syslog.

  2. Trunc detects the attack

    Brute force, web scanning (a run of 404s or 403s) or a burst of server errors (500s) from one address, at thresholds you set.

  3. The address goes on your list

    Within about 10 seconds it's on your account's blocklist on the log server. One list covers all of your servers.

  4. trunc-ar drops it

    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.

What gets blocked

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.

Active response triggers and their default thresholds
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)

What each detection looks for

Safe by default

Never blocked

  • Google and Bing crawlers
  • Cloudflare, Fastly and NOC.org edge servers
  • private, reserved and CGNAT ranges
  • your logged-in SSH sessions and the IP you installed from
  • the server's own addresses, its gateway and DNS resolvers
  • the Trunc servers it talks to
  • anything in /etc/trunc-ar/allow.conf

Crawlers 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 it goes wrong

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

Emergency unblock

Turn it on

1. In the dashboard

Open Settings > Security responses, turn on Active response and check the thresholds and the Response timeout.

2. On each Linux server

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.

Full setup guide

Limits

  • Linux with systemd only.
  • IPv4 at the firewall. IPv6 addresses on the list are skipped, so a server with public IPv6 is still reachable that way.
  • Behind a CDN, your server sees the CDN's addresses for web traffic, so a firewall block does nothing there. It still covers SSH and anything else that doesn't go through the CDN. For web traffic, log the real IP and block in the web server.
  • The list URL has no login. It's long and random, but anyone who has it can read it. Keep it out of public repos.
  • No dry-run. A listed address is dropped on the next check.
  • One list for the account. An address blocked for attacking one server is blocked on all of them. One public IP can be a whole office behind NAT, so put office and VPN ranges in allow.conf.

Common questions

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.

Setup guide Security Insights Behavior rules Pricing

Simple, Affordable, Log Management and Analysis.

14 days free trial. No credit card required.