Does it fail when you give it the full path to the .conf file?
fail2ban-regex /var/log/maillog /etc/fail2ban/filter.d/my_dovecot_secure.conf
Bill
On 10/6/2017 6:02 AM, Etienne MONIER wrote:
Hi everyone !
I've got a problem with fail2ban.
I've installed owncloud on a raspberry pi and I want it safe to bruteforcing. I then installed fail2ban with following
configurations :
//etc/fail2ban/filter.d/owncloud.conf/
[INCLUDES]
before = common.conf
[Definition]
_daemon = owncloud
failregex = {"reqId":".*","remoteAddr":".*","app":"core","message":"Login failed: '.*' \(Remote IP:
'<HOST>'\)","level":2,"time":".*","method":".*}
ignoreregex =
//etc/fail2ban/jail.d/owncloud.conf/
[owncloud]
enabled = true
filter = owncloud
port = http,https
logpath = /var/log/owncloud.log
maxretry = 5
To test if the filter is right (as fail2ban does not detect any login fail), I've tried fail2ban-regex /var/log/owncloud.log
filter.d/owncloud.conf. But it gives me
Running tests
=============
Use failregex filter file : owncloud, basedir:
Traceback (most recent call last):
File "/usr/local/bin/fail2ban-regex", line 34, in <module>
exec_command_line()
File
"/usr/local/lib/python2.7/dist-packages/fail2ban/client/fail2banregex.py", line
598, in exec_command_line
if not fail2banRegex.start(opts, args):
File
"/usr/local/lib/python2.7/dist-packages/fail2ban/client/fail2banregex.py", line
498, in start
if not self.readRegex(cmd_regex, 'fail'):
File
"/usr/local/lib/python2.7/dist-packages/fail2ban/client/fail2banregex.py", line
277, in readRegex
if not reader.read():
File
"/usr/local/lib/python2.7/dist-packages/fail2ban/client/configreader.py", line
274, in read
return ConfigReader.read(self, self._file)
File
"/usr/local/lib/python2.7/dist-packages/fail2ban/client/configreader.py", line
89, in read
ret = self._cfg.read(name)
File
"/usr/local/lib/python2.7/dist-packages/fail2ban/client/configreader.py", line
166, in read
% self._basedir)
ValueError: Base configuration directory does not exist
Help, please !
Etienne
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Fail2ban-users mailing list
Fail2ban-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fail2ban-users
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Fail2ban-users mailing list
Fail2ban-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fail2ban-users