From 18778d91749e7d9d6396706291f90a62b1f66c9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20=C5=A0um=C5=A1al?= Date: Tue, 3 Feb 2015 04:25:47 +0100 Subject: [PATCH] Created botsearch-common.conf File contains variables used in -botsearch filters --- config/filter.d/botsearch-common.conf | 19 +++++++++++++++++++ config/filter.d/nginx-botsearch.conf | 19 +++++-------------- 2 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 config/filter.d/botsearch-common.conf diff --git a/config/filter.d/botsearch-common.conf b/config/filter.d/botsearch-common.conf new file mode 100644 index 00000000..65f9da2f --- /dev/null +++ b/config/filter.d/botsearch-common.conf @@ -0,0 +1,19 @@ +# Generic configuration file for -botsearch filters + +[Init] + +# Block is the actual non-found directories to block +block = \/?(|||cgi-bin|mysqladmin)[^,]* + +# These are just convient definitions that assist the blocking of stuff that +# isn't installed +webmail = roundcube|(ext)?mail|horde|(v-?)?webmail + +phpmyadmin = (typo3/|xampp/|admin/|)(pma|(php)?[Mm]y[Aa]dmin) + +wordpress = wp-(login|signup)\.php + +# DEV Notes: +# Taken from apache-botsearch filter +# +# Author: Frantisek Sumsal \ No newline at end of file diff --git a/config/filter.d/nginx-botsearch.conf b/config/filter.d/nginx-botsearch.conf index 6d696de6..567f2f56 100644 --- a/config/filter.d/nginx-botsearch.conf +++ b/config/filter.d/nginx-botsearch.conf @@ -1,6 +1,11 @@ # Fail2Ban filter to match web requests for selected URLs that don't exist # +[INCLUDES] + +# Load regexes for filtering +before = botsearch-common.conf + [Definition] failregex = ^ \- \S+ \[\] \"(GET|POST) \/ \S+\" 404 .+$ @@ -9,20 +14,6 @@ failregex = ^ \- \S+ \[\] \"(GET|POST) \/ \S+\" 404 .+$ ignoreregex = -[Init] - -# Block is the actual non-found directories to block -block = \/?(|||cgi-bin|mysqladmin)[^,]* - -# These are just convient definitions that assist the blocking of stuff that -# isn't installed -webmail = roundcube|(ext)?mail|horde|(v-?)?webmail - -phpmyadmin = (typo3/|xampp/|admin/|)(pma|(php)?[Mm]y[Aa]dmin) - -wordpress = wp-(login|signup)\.php - - # DEV Notes: # Based on apache-botsearch filter #