Block IP for ever! [SOLVED]
Block IP for ever!
If you are try to break in, I don't want you ever!
Re: Block IP for ever! [SOLVED]
IPs may change and they could belong to a trusted user 1 month later, for example.
As an alternative, you may want to have a look into the keyhelp-recidive Fail2Ban Jail.
This jail is preconfigured by KeyHelp but currently not enabled by default.
Check out this file:
Code: Select all
/etc/fail2ban/jail.d/keyhelp.local
Please also note the warning text above!
After that, you need to restart fail2ban.
Code: Select all
service fail2ban restart
(Also in the mentioned file above, there are some other Jails you may want to try out by enabling them.)
Alexander Mahr
**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
- technotravel
- KeyHelp Translator
- Posts: 399
- Joined: Mon 19. Oct 2020, 11:11
Re: Block IP for ever!
In my file, there is only:Alexander wrote: ↑Mon 4. Jul 2022, 14:45Scroll down to [keyhelp-recidive]Code: Select all
/etc/fail2ban/jail.d/keyhelp.local
Code: Select all
[keyhelp-phpmyadmin]
enabled = true
port = http,https
filter = keyhelp-phpmyadmin
logpath = /var/log/auth.log
maxretry = 6

Is it possible, that my fail2ban is outdated, KH-wise? How could I bring it up to date?
And another question: I need to add a jail for asterisk, and have created a file for it in /etc/fail2ban/jail.d/ based on the instructions of Fail2ban, however the jail doesn't show up in the Panel (I had restarted fail2ban of course). Do I need to do anything else?
(Ich übersetze KeyHelp ins Französische)
Re: Block IP for ever!
My server has a Debian 11 system installed, but I guess it should also work on other systems.
Code: Select all
# Created by KeyHelp.
#
# DO NOT CHANGE ANYTHING IN THIS FILE,
# CHANGES WILL BE LOST ON NEXT UPDATE!
# Web server
[keyhelp-apache]
enabled = false
port = http,https
filter = apache-auth
logpath = /home/users/*/logs/*error.log
maxretry = 10
# Mail server
[keyhelp-postfix]
enabled = false
port = smtp,ssmtp,smtps,submission,submissions
filter = postfix
logpath = /var/log/mail.log
maxretry = 6
[keyhelp-dovecot]
enabled = false
port = pop3,pop3s,imap,imaps,submission,submissions,sieve
filter = dovecot
logpath = /var/log/mail.log
maxretry = 12
# FTP server
[keyhelp-proftpd]
enabled = false
port = ftp,ftp-data,ftps,ftps-data
filter = proftpd
logpath = /var/log/proftpd/proftpd.log
maxretry = 6
# Tools
[keyhelp-phpmyadmin]
enabled = true
port = http,https
filter = keyhelp-phpmyadmin
logpath = /var/log/auth.log
maxretry = 6
[keyhelp-roundcube]
enabled = false
port = http,https
filter = roundcube-auth
logpath = /home/keyhelp/www/roundcube/logs/errors.log
maxretry = 6
# Misc
# !!! WARNING !!!
# Make sure that your loglevel specified in fail2ban.conf/.local
# is not at DEBUG level -- which might then cause fail2ban to fall into
# an infinite loop constantly feeding itself with non-informative lines
[keyhelp-recidive]
enabled = false
filter = recidive
logpath = /var/log/fail2ban.log
action = iptables-allports[name=recidive]
maxretry = 5
bantime = 1w
findtime = 1d
root@mail01:~#
- technotravel
- KeyHelp Translator
- Posts: 399
- Joined: Mon 19. Oct 2020, 11:11
Re: Block IP for ever!
My server is also on Debian 11 (upgraded from 10 by KH-script). Strange also that this file "survived" the recent KH-update, since it is prone to be overwritten by updates ...
I'll try the settings from your file.
(Ich übersetze KeyHelp ins Französische)
Re: Block IP for ever!
- technotravel
- KeyHelp Translator
- Posts: 399
- Joined: Mon 19. Oct 2020, 11:11
Re: Block IP for ever!

Dann habe ich in /etc/fail2ban/jail.d/keyhelp.local noch eine Sektion für asterisk hinzugefügt, und auch das hat funktioniert

Dieses eine scriptkiddy, das irgendwie meinen geänderten SIP-port rausgefunden hat, wird nun auch von fail2ban geblockt. Nicht, dass ich da größere Sorgen gehabt hätte, aber ein request pro Sekunde müllte mir einfach das log zu, daher musste da etwas geschehen

Alles gut - Danke!

Edit: Oops - wrote in German, hope that's ok for this thread ...
(Ich übersetze KeyHelp ins Französische)