mirror of https://github.com/fail2ban/fail2ban
Merge pull request #373 from kwirk/selinux-epoch
ENH: Allow SE Linux epoch date detectionpull/369/merge
commit
c8e8478502
|
@ -78,8 +78,7 @@ class DateEpoch(DateTemplate):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
DateTemplate.__init__(self)
|
DateTemplate.__init__(self)
|
||||||
# We already know the format for TAI64N
|
self.setRegex("(?:^|(?P<selinux>(?<=audit\()))\d{10}(?:\.\d{3,6})?(?(selinux)(?=:\d+\)))")
|
||||||
self.setRegex("^\d{10}(\.\d{6})?")
|
|
||||||
|
|
||||||
def getDate(self, line):
|
def getDate(self, line):
|
||||||
date = None
|
date = None
|
||||||
|
|
|
@ -83,6 +83,7 @@ class DateDetectorTest(unittest.TestCase):
|
||||||
"<01/23/05@21:59:59>",
|
"<01/23/05@21:59:59>",
|
||||||
"050123 21:59:59", # MySQL
|
"050123 21:59:59", # MySQL
|
||||||
"Jan-23-05 21:59:59", # ASSP like
|
"Jan-23-05 21:59:59", # ASSP like
|
||||||
|
"audit(1106513999.123:987)", # SELinux
|
||||||
):
|
):
|
||||||
log = sdate + "[sshd] error: PAM: Authentication failure"
|
log = sdate + "[sshd] error: PAM: Authentication failure"
|
||||||
# exclude
|
# exclude
|
||||||
|
|
Loading…
Reference in New Issue