![]() |
fail2ban does not modify iptables entries
Hello,
I realize that this problem may not be ISPConfig-specific, but I'd like to eliminate that possibility, if nothing else. I'm using ISPConfig 3.0.4. I've installed fail2ban 0.8.4, with minimal configuration changes, on Ubuntu 10.04-2 LTS. I installed fail2ban from the Ubuntu repository using apt-get. My goal is to cover Apache authentication first, and then extend the fail2ban configuration to other services, such as ftp, dovecot, etc. The default fail2ban configuration seems to be adequate, and the only change I made was to create the file /etc/fail2ban/jail.local and insert the following: Code:
[apache]Code:
# fail2ban-regex /var/log/ispconfig/httpd/example.com/error.log /etc/fail2ban/filter.d/apache-auth.confCode:
Running testsNothing significant is written to the fail2ban logs when I intentionally fail Apache authentication a dozen or so times. When I start the service, the following output is written to fail2ban's log: Code:
2011-11-23 13:49:35,406 fail2ban.server : INFO Changed logging target to /var/log/fail2ban.log for Fail2ban v0.8.4Thanks for any insights! |
Filter is working
Try to add port= http,https in your jail.local in the apache section. Cheers |
Thank you for the reply, pititis.
I tried adding that line in jail.local, and restarting fail2ban, but I am still unable to trigger a ban by failing Apache authentication. And, technically speaking, the suggested line should already have been active due to its presence in jail.conf. As I understand it, all configuration directives from jail.conf apply until they are overridden (optionally) in jail.local. From the documentation: Code:
# Optionally you may override any other parameter (e.g. banaction,Code:
[apache]Code:
[apache]Any other thoughts? Thanks again! |
I realized that fail2ban stopped working for SSH, too, at some point during this process.
I thought that perhaps I'd butchered a configuration value somewhere while attempting to implement banning for Apache authentication. But after comparing all files in /etc/fail2ban with those on a similarly-configured server on which SSH banning works as intended, I ruled-out that possibility: all files were identical. So, I elected to remove fail2ban (with apt-get remove fail2ban) and reinstall it (with apt-get install fail2ban)... Apache banning now functions (at least somewhat... more on that in a moment). In jogging my memory, it occurred to me that, at some point, I modified a core fail2ban python file to solve a race-condition that appears to be Debian-specific. I was receiving these types of messages in the log when I first attempted to implement banning for services other than SSH: Code:
2011-11-23 10:48:56,713 fail2ban.actions.action: ERROR iptables -N fail2ban-postfixQuote:
Code:
def execActionStart(self):Code:
2011-12-01 14:20:16,994 fail2ban.server : INFO Changed logging target to /var/log/fail2ban.log for Fail2ban v0.8.4At this point, it's worth mentioning that I believe that the following bug describes this very issue: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=554162 So, I'll wait until fail2ban_0.8.5-2_all.deb is the latest stable release and see if the issue is resolved. And I'll report back at that time. |
Well, I just couldn't wait, so I installed the latest .deb package. The problem appears to be resolved. :D
|
| All times are GMT +2. The time now is 19:10. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.