blacklistd: what does it detect?
norman.gray at glasgow.ac.uk
Mon Apr 20 11:43:49 UTC 2020
I've enabled blacklistd on a 12.1 machine accessible to the open
internet, but it's not blocking as many failed ssh attempts as I expect.
Am I misunderstanding something?
My goal is to cut down noise in the 'daily security run' output (the
machine doesn't accept passwords for authentication, so I'm not
particularly worried about these as break-in attempts).
I'm seeing, in the logs, lots of attempts like
Apr 19 12:45:34 nxg2 sshd: Invalid user monitor from 126.96.36.199
Apr 19 12:45:34 nxg2 sshd: Connection closed by invalid user
monitor 188.8.131.52 port 35510 [preauth]
Apr 19 12:45:46 nxg2 sshd: Invalid user service from 184.108.40.206
Apr 19 12:45:47 nxg2 sshd: Connection closed by invalid user
service 220.127.116.11 port 50668 [preauth]
Apr 19 12:46:38 nxg2 sshd: Invalid user admin from 18.104.22.168
Apr 19 12:46:41 nxg2 sshd: Connection closed by invalid user
admin 22.214.171.124 port 40990 [preauth]
Apr 19 12:47:13 nxg2 sshd: Invalid user dvs from 126.96.36.199 port
Apr 19 12:47:13 nxg2 sshd: Connection closed by invalid user dvs
188.8.131.52 port 42484 [preauth]
This is less than 24 hours ago, at the time of writing. That IP address
appears 13 times in this time period; another address 184.108.40.206
appears 8 times, 220.127.116.11 appears 36 times; a few others smaller
I expect to see these addresses in both the blacklistctl dump -a output,
and in the list of addresses in the port22 table in the blacklistd/22 pf
anchor, but I'm not seeing either of these address in either location.
Comparing this log output with the blacklistctl output and the pf table,
and looking at the IP addresses with fewer attempts, I can see overlaps
-- addresses which appear in two or three of the locations, but it's
only partial. I'd have expected a fairly straightforward correlation
between (i) failed-login log entries, (ii) entries in blacklistctl dump
-a output, and (iii) entries in the pf table (modulo some complications
to do with entries expiring, or not having reached their ban
thresholds). However I see things in (i) but not (ii) or (iii), and
things in (iii) with nothing corresponding in the other two.
I'm fairly sure that blacklistd has been running continuously for at
least the last 24 hours (though blacklistd isn't itself particularly
chatty in the logs), so I don't _think_ there's a startup-cache issue.
Examining blacklistd.conf(5) and the handbook , there's not a lot to
configure here (which is a Good Thing, and an attractive contrast with
fail2ban), so there don't seem to be many opportunities for me to break
this. What am I missing? What is it that blacklistd is
Norman Gray : http://www.astro.gla.ac.uk/users/norman/it/
Research IT Coordinator
SUPA School of Physics and Astronomy, University of Glasgow, UK
Charity number SC004401
More information about the freebsd-questions