How to waste energy… t.co/aTNq0WmTt…
So, @TrueOS_Project works this time better on my laptop. But resume from suspend is still broken. Oo
The latest episode of @replyall is awesome. Highly recommended t.co/YhjnysQji…
Es gibt ein Stipendium für Studis mit schlechten Noten, damit sie weniger arbeiten müssen und mehr studieren können t.co/KXSHl8jFN…
Blacklistd and pf on FreeBSD
In FreeBSD 11.0 there was a new daemon delivered in base that helps to blacklist IPs on unsuccessful logins called blacklistd. Its advantage over fail2ban: it works with IPv6 and it is part of base. Its disadvantage is that as far as I understand it applications have to be linked against blacklistd, so that they can work with it.
With the recently released FreeBSD 11.1 sshd got linked against blacklistd. Therefore there is a new option in sshd_config: UseBlacklist. Per default it is set to no. Uncomment it, set it to yes and then reload sshd.
The config is in /etc/blacklistd.conf. Usually you define blocking rules in the [local]-section and whitelisting in [remote]. The sample file and the man page are good enough to explain that part.
In addition you need to start the blacklistd-service and enable it in rc.conf or even better in a file in /etc/rc.conf.d.
In /etc/pf.conf you need to add the following line:
anchor "blacklistd/*" in on $ext_if
Then you need to reload pf with the new rule:
pfctl -f /etc/pf.conf
Now blocking should already work. To get the blocked IPs use the following command
blacklistctl -b
If there are IPv6-adresses blocked, you need to add -w, so it is then
blacklistctl -bw
If you want to unblock an IP you can look into the tables with pfctl. To see for example the table for sshd, the command is:
pfctl -a blacklistd/22 -t port22 -T show
Now let’s say you want to unblock the IP 23.23.23.23, then you could issue a:
pfctl -a blacklistd/22 -t port22 -T delete 23.23.23.23
This will remove the IP from the table and it is now unblocked. blacklistctl will still show the IP as blocked though. But if the IP tries again to log in and fails often enough, it will get blocked again.
I blogged: blacklistd and pf on FreeBSD t.co/dMN4FEGOi…
The author deleted his forum post meanwhile…
Yes, I did it. I can now unblock IPs that got blocked via blacklistd and pf in #FreeBSD 11.1 t.co/56Lb2tCNM…
And how I hate it when I did my research and people are telling me “read the documentation”
Wow, I got the longest answer ever in a forum that seems to be just wrong. Because the person didn’t use the stuff by himself.