mirror of
https://github.com/fail2ban/fail2ban.git
synced 2026-03-11 08:55:31 +00:00
BF: anchoring regex for IP with "$" at the end + adjust regexp for <HOST> (closes: #514163)
manually done patching similar to the one in up/fix_searchIP_v2 branch
This commit is contained in:
parent
dd17522d05
commit
91bb2fc938
1 changed files with 2 additions and 2 deletions
|
|
@ -171,7 +171,7 @@ class Filter(JailThread):
|
|||
self.__failRegexObj = None
|
||||
else:
|
||||
# Replace "<HOST>" with default regular expression for host.
|
||||
regex = value.replace("<HOST>", "(?:::f{4,6}:)?(?P<host>\S+)")
|
||||
regex = value.replace("<HOST>", "(?:::f{4,6}:)?(?P<host>[\w\-.^_]+)")
|
||||
self.__failRegex = regex
|
||||
self.__failRegexObj = re.compile(regex)
|
||||
logSys.info("Set failregex = %s" % self.__failRegex)
|
||||
|
|
@ -469,7 +469,7 @@ import socket, struct
|
|||
class DNSUtils:
|
||||
|
||||
DNS_CRE = re.compile("(?:(?:\w|-)+\.){2,}\w+")
|
||||
IP_CRE = re.compile("(?:\d{1,3}\.){3}\d{1,3}")
|
||||
IP_CRE = re.compile("(?:\d{1,3}\.){3}\d{1,3}$")
|
||||
|
||||
@staticmethod
|
||||
def dnsToIp(dns):
|
||||
|
|
|
|||
Loading…
Reference in a new issue