mirror of https://github.com/fail2ban/fail2ban
commit
f5572c8ade
|
@ -32,6 +32,9 @@ findtime = 600
|
||||||
# "maxretry" is the number of failures before a host get banned.
|
# "maxretry" is the number of failures before a host get banned.
|
||||||
maxretry = 3
|
maxretry = 3
|
||||||
|
|
||||||
|
# "maxlines" is number of log lines to buffer for multi-line regex searches
|
||||||
|
maxlines = 1
|
||||||
|
|
||||||
# "backend" specifies the backend used to get files modification.
|
# "backend" specifies the backend used to get files modification.
|
||||||
# Available options are "pyinotify", "gamin", "polling" and "auto".
|
# Available options are "pyinotify", "gamin", "polling" and "auto".
|
||||||
# This option can be overridden in each jail as well.
|
# This option can be overridden in each jail as well.
|
||||||
|
|
|
@ -218,8 +218,10 @@ class Filter(JailThread):
|
||||||
# @param value the line buffer size
|
# @param value the line buffer size
|
||||||
|
|
||||||
def setMaxLines(self, value):
|
def setMaxLines(self, value):
|
||||||
self.__lineBufferSize = max(1, value)
|
if int(value) <= 0:
|
||||||
logSys.info("Set maxLines = %i" % self.__lineBufferSize)
|
raise ValueError("maxlines must be integer greater than zero")
|
||||||
|
self.__lineBufferSize = int(value)
|
||||||
|
logSys.info("Set maxlines = %i" % self.__lineBufferSize)
|
||||||
|
|
||||||
##
|
##
|
||||||
# Get the maximum line buffer size.
|
# Get the maximum line buffer size.
|
||||||
|
|
|
@ -271,6 +271,12 @@ class Transmitter(TransmitterBase):
|
||||||
self.setGetTest("maxretry", "-2", -2, jail=self.jailName)
|
self.setGetTest("maxretry", "-2", -2, jail=self.jailName)
|
||||||
self.setGetTestNOK("maxretry", "Duck", jail=self.jailName)
|
self.setGetTestNOK("maxretry", "Duck", jail=self.jailName)
|
||||||
|
|
||||||
|
def testJailMaxLines(self):
|
||||||
|
self.setGetTest("maxlines", "5", 5, jail=self.jailName)
|
||||||
|
self.setGetTest("maxlines", "2", 2, jail=self.jailName)
|
||||||
|
self.setGetTestNOK("maxlines", "-2", jail=self.jailName)
|
||||||
|
self.setGetTestNOK("maxlines", "Duck", jail=self.jailName)
|
||||||
|
|
||||||
def testJailLogPath(self):
|
def testJailLogPath(self):
|
||||||
self.jailAddDelTest(
|
self.jailAddDelTest(
|
||||||
"logpath",
|
"logpath",
|
||||||
|
|
Loading…
Reference in New Issue