Thursday, August 21, 2025
Commenting runtime state changes
As I was banning Thinkbot, I saw the previous entries in the “badbots firewall rule set”. The first one was banning a particularly bad Gemini bot that would make an invalid empty request only to immediately follow up with a valid request, for every request it made! That was the first bot I actually banned, and it was very recent ban too—June 19th.
But it was the second entry on the list that puzzled me:
Chain badbot (1 references) pkts bytes target prot opt in out source destination 0 0 DROP tcp -- * * 77.25.18.172 0.0.0.0/0 tcp dpt:1965 138 8280 DROP all -- * * 185.177.72.0/24 0.0.0.0/0
(the count of 0 for the first rule—I had to reboot my server recently for reasons I'm still trying to resolve). I will have to go through the log archives to see why I banned the 185.177.72.0/24 network, and that reminded me of an idea I had years ago but never did anything about it.
Twenty-eight years ago (sigh) I wrote the greylist daemon (source code, and for the record, I'm still using it). It tracks a tuple of sending host, from address, to address and the default is to just greylist (that is, artifically delay) a tuple never seen before. But you can override the default behavior for the hosts, from address and to address. So for instance, I can reject hosts:
gld-mcp>iplist reject 206.214.64.0/19
But now, years later, why did I ban that network? I mean, I did set it at some point:
gld-mcp>show iplist 106 GREYLIST 0.0.0.0 0.0.0.0 0 ACCEPT 64.12.0.0 255.255.0.0 0 ACCEPT 64.233.160.0 255.255.224.0 0 ACCEPT 66.94.224.0 255.255.224.0 0 ACCEPT 66.102.0.0 255.255.240.0 0 ACCEPT 66.163.160.0 255.255.224.0 0 ACCEPT 66.218.64.0 255.255.224.0 0 ACCEPT 66.220.144.128 255.255.255.128 0 ACCEPT 66.249.80.0 255.255.240.0 0 ACCEPT 66.249.64.0 255.255.224.0 0 ACCEPT 66.252.224.0 255.255.252.0 0 ACCEPT 69.63.176.0 255.255.240.0 0 ACCEPT 69.147.64.0 255.255.192.0 0 ACCEPT 70.34.16.0 255.255.240.0 0 ACCEPT 72.14.192.0 255.255.192.0 0 ACCEPT 74.125.0.0 255.255.0.0 0 ACCEPT 127.0.0.1 255.255.255.255 0 ACCEPT 140.211.11.3 255.255.255.255 0 ACCEPT 149.174.0.0 255.255.0.0 0 REJECT 172.128.0.0 255.128.0.0 0 ACCEPT 192.168.0.0 255.255.0.0 0 ACCEPT 204.127.217.0 255.255.255.0 0 ACCEPT 204.127.0.0 255.255.0.0 0 ACCEPT 205.152.58.0 255.255.254.0 0 ACCEPT 205.188.156.0 255.255.254.0 0 ACCEPT 205.188.0.0 255.255.0.0 0 REJECT 206.214.64.0 255.255.224.0 0 ACCEPT 207.115.11.0 255.255.255.192 0 ACCEPT 207.115.0.0 255.255.192.0 0 ACCEPT 207.171.188.0 255.255.255.0 9 ACCEPT 209.85.128.0 255.255.128.0 0 ACCEPT 209.131.32.0 255.255.224.0 0 ACCEPT 216.39.48.0 255.255.240.0 0 ACCEPT 216.239.32.0 255.255.224.0
but there's no indication of when, or why. A fews years of use, and I wish I had added a way to comment such entries. For instance, I blocked 172.128.0.0/16 at some point, but since then, the block is now owned by Microsoft in the United Kingdom. I think I can remove that block now (maybe?).
And I think that iptables
(and related commands,
I think the preferred firewall interface for Linux is now nftables
?
Good lord, the churn in this industry is insane)
having a way to add comments might be nice,
like:
# iptables -A badbots --comment "Thinkbot daring me to ban it 2025-08-21" -s 43.131.0.0/18 -j DROP
I don't know, it's just a random idea I have.