Created
April 29, 2022 19:31
-
-
Save ngugijames/d90118bddcb2137a009c702eb434359a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Filter: | |
cd /etc/fail2ban/filter.d | |
[Definition] | |
#failregex = <HOST> - - \[(\d{2})/\w{3}/\d{4}:\1:\1:\1 -\d{4}\] "POST /admin/ HTTP/1.1" | |
#failregex = ^<HOST> - .* "POST /admin/ HTTP/1.1" 499 | |
#failregex = ^<HOST> - .* "(GET|POST|HEAD).*HTTP.*" 404 .*$ | |
#failregex = ^<HOST> - .* "(GET|POST|HEAD) /admin/ HTTP.*" .*$ | |
#failregex = ^<HOST> - .* "POST /admin/ HTTP/1.1" .* | |
failregex = ^<HOST> - .* "POST /admin/ HTTP/1.1" .* | |
ignoreregex = | |
#Jail | |
vim /etc/fail2ban/jail.local | |
[opencart-admin] | |
enabled = true | |
filter = opencart-admin | |
logpath = /var/log/nginx/kiukabrands.com.access.log | |
/var/log/nginx/kiukabrands.com.access.log | |
port = http,https | |
maxretry = 1 | |
findtime = 30d | |
bantime = 600 | |
bantime.rndtime = 100 | |
bantime.increment = true | |
bantime.factor = 24 | |
bantime.maxtime = 6w | |
#restart fail2ban | |
sudo fail2ban-client restart | |
sudo fail2ban-client status opencart-admin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment