Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
cryCode
Fail2Ban IPv6 Patch
Commits
bdab65a4
Commit
bdab65a4
authored
Dec 18, 2016
by
Peter Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added files for v0.8.6
parents
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
0 deletions
+57
-0
README.md
README.md
+5
-0
failregex.patch
failregex.patch
+12
-0
filter.patch
filter.patch
+40
-0
No files found.
README.md
0 → 100755
View file @
bdab65a4
# Fail2Ban IPv6 Patch
**Fail2Ban v0.8.6**
Mehr Informationen unter https://crycode.de/fail2ban-mit-ipv6/.
failregex.patch
0 → 100755
View file @
bdab65a4
#
Fail2Ban IPv6 Patch for Fail2Ban v0.8.6
--- failregex.py.orig
+++ failregex.py
@@ -47,7 +47,7 @@
self._matchCache = None
# Perform shortcuts expansions.
# Replace "<HOST>" with default regular expression for host.
- regex = regex.replace("<HOST>", "(?:::f{4,6}:)?(?P<host>[\w\-.^_]+)")
+ regex = regex.replace("<HOST>", "(?:::f{4,6}:)?(?P<host>[\w\-.^_:]+)")
if regex.lstrip() == '':
raise RegexException("Cannot add empty regex")
try:
filter.patch
0 → 100755
View file @
bdab65a4
#
Fail2Ban IPv6 Patch for Fail2Ban v0.8.6
--- filter.py.orig
+++ filter.py
@@ -525,6 +525,7 @@
class DNSUtils:
IP_CRE = re.compile("^(?:\d{1,3}\.){3}\d{1,3}$")
+ IP_CRE6 = re.compile("^(?:[0-9:A-Fa-f]{3,})$")
#@staticmethod
def dnsToIp(dns):
@@ -548,19 +549,21 @@
if match:
return match
else:
- return None
+ match = DNSUtils.IP_CRE6.match(text)
+ if match:
+ """ Right Here, we faced to a ipv6
+ """
+ return match
+ else:
+ return None
searchIP = staticmethod(searchIP)
#@staticmethod
def isValidIP(string):
""" Return true if str is a valid IP
+ We Consider that logfiles didn't make errors ;)
"""
- s = string.split('/', 1)
- try:
- socket.inet_aton(s[0])
- return True
- except socket.error:
- return False
+ return True
isValidIP = staticmethod(isValidIP)
#@staticmethod
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment