-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A couple issues #16
Comments
I had a very similar problem recently on debian (buster). Unfortunately, I could not find a solution. If a solution is found, I'll be very much interested. Maybe sharing your jail.local file could be interesting. |
I think the sort command in the action.d blacklist.conf file is not working correctly. It's not removing duplicate entries into the file ip.blacklist. The -u option should do both sort and remove, but it's only sorting and not removing. By the time the -u option gets done, sort is already adding the new IP entry into the ip.blacklist file with -o option. Which creates the dupe in the ip.blacklist file and consequently on iptables. sort -u /etc/fail2ban/ip.blacklist -o /etc/fail2ban/ip.blacklist EDIT: sort -u /etc/fail2ban/ip.blacklist No more dupes and everything is sorted correctly. |
Weird it should work in a one line, always has and does work this way on most distributions. |
@m411b this filter blacklists anything not just SSH. You happen to see a lot of SSH because that's the most common exploit. This filter does not pick and choose what to blacklist ... it blacklists anything that was blacklisted from any jail by Fail2ban. It works by only processing what is blacklisted in the fail2ban.log You can see the regex pattern used to scan through the fail2ban.log file
|
@mitchellkrogza Why no blacklist ban on 185.234.219.113? Maxretry is set to 2. For postfix-sasl I'm using the built in settings in jail.conf/local just like with SSH. But the blacklist filter ignores everything other than SSH. I've gone through the settings and filters multiple times and cannot figure out why? I love the blacklist filter and thank you very much for sharing it. It works great, just not for anything other than SSH on my system. At least that's the way it seems. 2019-12-19 09:19:37,210 fail2ban.filter [7456]: INFO [postfix-sasl] Found 185.234.219.113 - 2019-12-19 09:19:37 |
Post your jail settings all of them What is your logrotate set to for fail2ban.log ??? |
jail.local - [DEFAULT] ACTIONS destemail = xxx sendername = Fail2ban JAILS [pure-ftpd] [dovecot] [postfix] [postfix-auth] [postfix-sasl] [blacklist] [recidive] logrotate -
} |
By the way. Thanks so much for the help. |
I realized I had 3 postfix jails enabled. I've disabled postfix-auth and postfix. Postfix-sasl is the only postfix jail currently enabled. |
Revisiting the sort issue where sort - sorts, but does not remove dupes. I wanted to see if changing the sort command back to the original one line command with options -u and -o in the /action.d/blacklist.conf file would fix itself after squaring everything else away. It did not. I did some looking around and found out sort will not make changes to the original data file. The sort command in /action.d/blacklist.conf with the option -o has sort writing back to the original data file. I wonder if making sort write to a second ip.blacklist file and then using that file for the blacklist will clear this up? Changing the command back with options -u and -o separated into two lines fixed the issue again. Not sure exactly why. But I suspect it has something to do with sort writing back to the original data file. On to the issue where the blacklist jail does nothing for other jails. Blacklist did ban a few pure-ftpd attackers. But nothing else. Only sshd and pure-ftpd are being blacklisted. While still ignoring postfix-sasl and apache jails. No idea why. @mitchellkrogza - I did go read and pay very well attention to your fail2ban tutorial and went back through my jail.local file to set everything up correctly and in line with your tutorial. Basically to see if my jail.local file was out of wack. Still no change. For reference - Thanks so much |
I use |
I did actually try adding sudo to the sort command and there was no change. Thanks so much |
ip.blacklist has duplicated every IP the filter has put on it and when I remove the dupes, they come back after a reboot. Consequently, every IP has been duped on IPtables as well. Everything works as intended other than this.
Is there a way to get this to watch other filters than just SSH? Like say [Postfix-Auth] or any other custom filter? So far this filter seems to only care about SSH.
Ubuntu Server 18.04 - F2B 10
Thank so much
The text was updated successfully, but these errors were encountered: