-
Notifications
You must be signed in to change notification settings - Fork 15
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 old versions can't get ban status by IP #22
Comments
It was implemented in fail2ban in this commit here: |
@WKnak : can it be that you missed Can you confirm that 0.11.1 behaves different to 0.11.2 (which is the version of EPEL7)
|
fail2ban-client -V fail2ban-client set sasl banip 1.2.3.5 fail2ban-client get sasl banned 1.2.3.5 test for a not banned IP: |
So it behaves different from 0.11.1 to 0.11.2 ... well it is already implemented, though, so in theory it is also compatible with older Fail2Ban versions now. I don't have a good environment to test, or to develop. The most important question in this implementatino is that it is now raising an exception. If you think there are better ways to refactor, please let me know or send your commits too! Thanks in advance! |
Some early versions of fail2ban cannot get the ban status directly from querying the IP. Example using fail2ban 0.11.1:
But it is possible to get a list of all banned IP addresses in the jail using a different command, the last comma (,) is the separator character:
FIX: It is not ideal to change the current implementation to always request the list instead of querying single IP, since it seems not efficient. But maybe instead create a constant for old behavior/compatibility with older fail2ban versions. Of course, upgrading to a new version of fail2ban will be better.
The text was updated successfully, but these errors were encountered: