Skip to content

Instantly share code, notes, and snippets.

@hespresati
Created March 10, 2016 13:03
Show Gist options
  • Save hespresati/e5e6ad67f407d8c7f666 to your computer and use it in GitHub Desktop.
Save hespresati/e5e6ad67f407d8c7f666 to your computer and use it in GitHub Desktop.
Fail2Ban Tomcat7 configuration
# Fail2Ban local configuration file
[tomcat-manager]
enabled = true
port = 8080,8443
filter = tomcat-manager
logpath = /var/log/tomcat7/localhost_access_log.*.txt
maxretry = 3
# Fail2Ban filter to block access to Tomcat Manager
[INCLUDES]
before = common.conf
[Definition]
failregex = <HOST> -.*- .*/manager/j_security_check HTTP/1.* .* .*$
<HOST> - - \[.*\] "GET /manager/html(.*) HTTP/1.1" 401 \d+$
ignoreregex =
# Author: Hugo Espresati. Bassed on Miguel Almeida's regexs definitions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment