2013-10-30 13:02:59 +00:00
|
|
|
# Fail2Ban apache-auth filter
|
2006-07-17 19:26:14 +00:00
|
|
|
#
|
|
|
|
|
2013-06-11 18:56:25 +00:00
|
|
|
[INCLUDES]
|
|
|
|
|
|
|
|
# Read common prefixes. If any customizations available -- read them from
|
2013-10-30 13:02:59 +00:00
|
|
|
# apache-common.local
|
2013-06-11 18:56:25 +00:00
|
|
|
before = apache-common.conf
|
|
|
|
|
2006-07-16 21:35:08 +00:00
|
|
|
[Definition]
|
|
|
|
|
2019-10-18 09:18:34 +00:00
|
|
|
# Mode for filter: normal (default) and aggressive (allows DDoS & brute force detection of mod_evasive)
|
|
|
|
mode = normal
|
|
|
|
|
|
|
|
# ignore messages of mod_evasive module:
|
|
|
|
apache-pref-ign-normal = (?!evasive)
|
|
|
|
# allow "denied by server configuration" from all modules:
|
|
|
|
apache-pref-ign-aggressive =
|
|
|
|
# mode related ignore prefix for common _apache_error_client substitution:
|
|
|
|
apache-pref-ignore = <apache-pref-ign-<mode>>
|
|
|
|
|
2017-02-21 14:54:59 +00:00
|
|
|
prefregex = ^%(_apache_error_client)s (?:AH\d+: )?<F-CONTENT>.+</F-CONTENT>$
|
2013-10-30 13:02:59 +00:00
|
|
|
|
2017-02-21 14:54:59 +00:00
|
|
|
# auth_type = ((?:Digest|Basic): )?
|
|
|
|
auth_type = ([A-Z]\w+: )?
|
|
|
|
|
2017-04-24 13:32:44 +00:00
|
|
|
failregex = ^client (?:denied by server configuration|used wrong authentication scheme)\b
|
2018-03-20 08:09:42 +00:00
|
|
|
^user (?!`)<F-USER>(?:\S*|.*?)</F-USER> (?:auth(?:oriz|entic)ation failure|not found|denied by provider)\b
|
2017-04-21 08:32:29 +00:00
|
|
|
^Authorization of user <F-USER>(?:\S*|.*?)</F-USER> to access .*? failed\b
|
|
|
|
^%(auth_type)suser <F-USER>(?:\S*|.*?)</F-USER>: password mismatch\b
|
2018-03-20 08:09:42 +00:00
|
|
|
^%(auth_type)suser `<F-USER>(?:[^']*|.*?)</F-USER>' in realm `.+' (auth(?:oriz|entic)ation failure|not found|denied by provider)\b
|
2017-04-21 09:17:13 +00:00
|
|
|
^%(auth_type)sinvalid nonce .* received - length is not\b
|
|
|
|
^%(auth_type)srealm mismatch - got `(?:[^']*|.*?)' but expected\b
|
2017-04-21 08:32:29 +00:00
|
|
|
^%(auth_type)sunknown algorithm `(?:[^']*|.*?)' received\b
|
|
|
|
^invalid qop `(?:[^']*|.*?)' received\b
|
|
|
|
^%(auth_type)sinvalid nonce .*? received - user attempted time travel\b
|
2018-08-14 12:07:32 +00:00
|
|
|
^(?:No h|H)ostname \S+ provided via SNI(?:, but no hostname provided| and hostname \S+ provided| for a name based virtual host)\b
|
2013-10-30 13:02:59 +00:00
|
|
|
|
|
|
|
ignoreregex =
|
|
|
|
|
|
|
|
# DEV Notes:
|
|
|
|
#
|
2013-07-11 21:39:18 +00:00
|
|
|
# This filter matches the authorization failures of Apache. It takes the log messages
|
|
|
|
# from the modules in aaa that return HTTP_UNAUTHORIZED, HTTP_METHOD_NOT_ALLOWED or
|
|
|
|
# HTTP_FORBIDDEN and not AUTH_GENERAL_ERROR or HTTP_INTERNAL_SERVER_ERROR.
|
|
|
|
#
|
2013-07-28 22:59:25 +00:00
|
|
|
# An unauthorized response 401 is the first step for a browser to instigate authentication
|
|
|
|
# however apache doesn't log this as an error. Only subsequent errors are logged in the
|
|
|
|
# error log.
|
2013-07-11 21:39:18 +00:00
|
|
|
#
|
|
|
|
# Source:
|
|
|
|
#
|
|
|
|
# By searching the code in http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/aaa/*
|
|
|
|
# for ap_log_rerror(APLOG_MARK, APLOG_ERR and examining resulting return code should get
|
|
|
|
# all of these expressions. Lots of submodules like mod_authz_* return back to mod_authz_core
|
|
|
|
# to return the actual failure.
|
2013-07-17 14:36:17 +00:00
|
|
|
#
|
2016-12-23 21:57:24 +00:00
|
|
|
# Note that URI can contain spaces.
|
|
|
|
#
|
2013-07-17 14:36:17 +00:00
|
|
|
# See also: http://wiki.apache.org/httpd/ListOfErrors
|
2013-08-19 21:33:35 +00:00
|
|
|
# Expressions that don't have tests and aren't common.
|
|
|
|
# more be added with https://issues.apache.org/bugzilla/show_bug.cgi?id=55284
|
2017-04-21 08:32:29 +00:00
|
|
|
# ^user .*: nonce expired \([\d.]+ seconds old - max lifetime [\d.]+\) - sending new nonce\s*$
|
|
|
|
# ^user .*: one-time-nonce mismatch - sending new nonce\s*$
|
|
|
|
# ^realm mismatch - got `(?:[^']*|.*?)' but no realm specified\s*$
|
2013-07-17 14:36:17 +00:00
|
|
|
#
|
2017-04-21 08:32:29 +00:00
|
|
|
# Because url/referer are foreign input, short form of regex used if long enough to idetify failure.
|
2013-11-18 23:27:55 +00:00
|
|
|
#
|
2013-10-30 13:02:59 +00:00
|
|
|
# Author: Cyril Jaquier
|
2017-04-21 08:32:29 +00:00
|
|
|
# Major edits by Daniel Black and Ben Rubson.
|
|
|
|
# Rewritten for v.0.10 by Sergey Brester (sebres).
|