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
2b877946
Commit
2b877946
authored
Dec 18, 2016
by
Peter Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added files for v0.9.3
parents
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
0 deletions
+55
-0
README.md
README.md
+5
-0
failregex.patch
failregex.patch
+12
-0
filter.patch
filter.patch
+38
-0
No files found.
README.md
0 → 100755
View file @
2b877946
# Fail2Ban IPv6 Patch
**Fail2Ban v0.9.3, 0.9.4, 0.9.5**
Mehr Informationen unter https://crycode.de/fail2ban-mit-ipv6/.
failregex.patch
0 → 100755
View file @
2b877946
#
Fail2Ban IPv6 Patch for Fail2Ban v0.9.3, v0.9.4, v0.9.5
--- failregex.py.orig
+++ failregex.py
@@ -44,7 +44,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\-.^_]*\w)")
+ regex = regex.replace("<HOST>", "(?:::f{4,6}:)?(?P<host>[\w\-.^_:]*\w)")
# Replace "<SKIPLINES>" with regular expression for multiple lines.
regexSplit = regex.split("<SKIPLINES>")
regex = regexSplit[0]
filter.patch
0 → 100755
View file @
2b877946
#
Fail2Ban IPv6 Patch for Fail2Ban v0.9.3, v0.9.4, v0.9.5
--- filter.py.orig
+++ filter.py
@@ -849,6 +849,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):
@@ -883,19 +884,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
@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
@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