Skip to content
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

Fail2ban wrongly setting logs level #742

Closed
Vagrantin opened this issue Dec 25, 2017 · 5 comments
Closed

Fail2ban wrongly setting logs level #742

Vagrantin opened this issue Dec 25, 2017 · 5 comments

Comments

@Vagrantin
Copy link

# Version

Webmin 1.870
Virtualmin 6.01
AuthenticTheme 19.06
Debian9

In the Fail2Ban module when you set the log level using the module "Global Configuration" the log level is set using number instead of the log level name.

Here is the value that should be used (from config files)

# Option: loglevel
# Notes.: Set the log level output.
#         CRITICAL
#         ERROR
#         WARNING
#         NOTICE
#         INFO
#         DEBUG
# Values: [ LEVEL ]  Default: ERROR
#
loglevel = DEBUG

Matth

@jcameron
Copy link
Collaborator

Are you sure about this? Some of the docs I've found say the loglevel is a number : https://linode.com/docs/security/using-fail2ban-for-security/

@jcameron
Copy link
Collaborator

Also, in my config file it says :

# Option:  loglevel
# Notes.:  Set the log level output.
#          1 = ERROR
#          2 = WARN
#          3 = INFO
#          4 = DEBUG
# Values:  NUM  Default:  3
#
loglevel = 4

@Vagrantin
Copy link
Author

[matth@wp ~]# fail2ban-client -V
Fail2Ban v0.9.6

Copyright (c) 2004-2008 Cyril Jaquier, 2008- Fail2Ban Contributors
Copyright of modifications held by their respective authors.
Licensed under the GNU General Public License v2 (GPL).

Written by Cyril Jaquier <cyril.jaquier@fail2ban.org>.
Many contributions by Yaroslav O. Halchenko <debian@onerussian.com>.

in my etc/fail2ban/fail2ban.conf

# Option: loglevel
# Notes.: Set the log level output.
#         CRITICAL
#         ERROR
#         WARNING
#         NOTICE
#         INFO
#         DEBUG
# Values: [ LEVEL ]  Default: ERROR
#
loglevel = INFO

if I set loglevel = 1 the reload fail2ban here is the error message I got

ERROR NOK: ('Invalid log level',) 

but using those value works properly

#         CRITICAL
#         ERROR
#         WARNING
#         NOTICE
#         INFO
#         DEBUG

So far I didn't found any clear information on Fail2ban github.
Give me some time to look at this on Fail2ban side and I'll get back here as soon has I have a clear root cause.

Thanks
Matth

@jcameron
Copy link
Collaborator

Interesting, it seems like they changed the meaning of the loglevel directive, presumably in version 0.9. I'll handle this in the next Webmin release.

@Vagrantin
Copy link
Author

@jcameron ,

This is how things seems to be handle by fail2Ban

< 0.8.x : set log level using numeric only [ 0...3]
0.9.x : set log level using string only
> 0.10 : Set log level with both numeric and string (python log level)

source
Python log level

hop that helps
Matth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants