Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 May 2020 13:31:05 +0100
From:      "Norman Gray" <>
To:        RW via freebsd-questions <>
Subject:   blacklistd: spurious whitelisting of IPs
Message-ID:  <>

Next in thread | Raw E-Mail | Index | Archive | Help


My blacklistctl dump -a output currently looks a bit like this

         address/ma:port	id	nfail	last access
130.209.XX.XX/32:22		0/-1	1970/01/01 01:00:00
   194.XX.XX.XX/32:22		3/-1	2020/05/14 00:35:05
   [ IP addresses partially redacted ]
   [ various reasonable-looking lines...]

Both those IP ranges are 'friendly', and the first is the local /16.  
The odd thing is the -1 as the nfail limit, meaning 'do not block' or 
'whitelisted', which I can't explain.

My blacklistd.conf looks like:

ssh		stream	*	*		*	4	24h
ftp		stream	*	*		*	3	24h
smtp		stream	*	*		*	3	24h
submission	stream	*	*		*	3	24h
*		*	*	*		*	3	60
130.209.XX.XX:ssh *	*	*		*	*	*
194.XX.XX.XX:ssh *	*	*		*	*	*
130.209.XX.XX:ssh *	*	*		*	*	*

The [local] stanza is almost the default; the [remote] explicitly 
whitelists three machines.

But the whitelisted machines _do not_ match the nfail=-1 machines in the 
blacklistctl output.  They're in the same and, but are not the same IP address.  Looking further back, I 
can see a similar pattern, with these netblocks, but no others, 
apparently whitelisted.  What's going on?

It's as if the local lines were being parsed as and, but there's nothing in the by-hand parser of the .conf 
file that suggests that's what's happening (see 
lines 224 and 586, last changed March 2018).

The machine this is running on is hosting a couple of jails (one of 
which is the bastion host that this is really protecting, and the 
blacklistd is listening on sockets in both the host and the bastion 
jail), it has four IP addresses (two of which are in a private IP 
range), and it has a non-trivial, but not particularly complicated pf 
firewall configuration.  This is the blacklistd in FreeBSD 
12.0-RELEASE-p8 (I can't find a version option on blacklistd nor any 
version strings in the blacklistd binary).

I'm perplexed.

Best wishes,


Norman Gray  :
Research IT Coordinator
SUPA School of Physics and Astronomy, University of Glasgow, UK
Charity number SC004401

Want to link to this message? Use this URL: <>