added findtime configuration parameter

debian-releases/etch
Yaroslav Halchenko 2005-08-19 08:40:09 +00:00
parent 1acb0f2648
commit 22e3fd1708
3 changed files with 23 additions and 15 deletions

View File

@ -24,12 +24,12 @@ debug = false
logtargets = /var/log/fail2ban.log logtargets = /var/log/fail2ban.log
# Option: syslog-target # Option: syslog-target
# Notes.: where to find syslog facility if logtarget SYSLOG # Notes.: where to find syslog facility if logtarget SYSLOG.
# Values: file(socket) hostname hostname:port Default: /dev/log # Values: file(socket) hostname hostname:port Default: /dev/log
syslog-target = /dev/log syslog-target = /dev/log
# Option: syslog-facility # Option: syslog-facility
# Notes.: which syslog facility to use if logtarget SYSLOG # Notes.: which syslog facility to use if logtarget SYSLOG.
# Values: NUM Default: 1 # Values: NUM Default: 1
syslog-facility = 1 syslog-facility = 1
@ -51,6 +51,12 @@ maxretry = 5
# #
bantime = 600 bantime = 600
# Option: findtime
# Notes.: lifetime in seconds of a "failed" log entry.
# Values: NUM Default: 600
#
findtime = 600
# Option: ignoreip # Option: ignoreip
# Notes.: space separated list of IP's to be ignored by fail2ban. # Notes.: space separated list of IP's to be ignored by fail2ban.
# You can use CIDR mask in order to specify a range. # You can use CIDR mask in order to specify a range.
@ -69,7 +75,7 @@ ignoreip = 192.168.0.0/16
cmdstart = cmdstart =
# Option: cmdend # Option: cmdend
# Notes.: command executed once at the end of Fail2Ban # Notes.: command executed once at the end of Fail2Ban.
# Values: CMD Default: # Values: CMD Default:
# #
cmdend = cmdend =

4
debian/changelog vendored
View File

@ -6,8 +6,10 @@ fail2ban (0.5.2-3) unstable; urgency=low
from syslog branch) (closes: #323543) from syslog branch) (closes: #323543)
* Included upstream README and TODO * Included upstream README and TODO
* Mentioned in README.Debian that apache section is disabled by default * Mentioned in README.Debian that apache section is disabled by default
* Adjusted man pages to cross-reference each other (closes: #323840) * Adjusted man pages to cross-reference each other
* Moved fail2ban man page under section 8 as in upstream * Moved fail2ban man page under section 8 as in upstream
* Introduced findtime configuration variable to control the lifetime
of caught "failed" log entries (closes: #323840)
-- Yaroslav Halchenko <debian@onerussian.com> Tue, 16 Aug 2005 11:23:28 -1000 -- Yaroslav Halchenko <debian@onerussian.com> Tue, 16 Aug 2005 11:23:28 -1000

View File

@ -15,6 +15,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Author: Cyril Jaquier # Author: Cyril Jaquier
# Modified by: Yaroslav Halchenko (SYSLOG, findtime)
# #
# $Revision: 1.20.2.13 $ # $Revision: 1.20.2.13 $
@ -181,6 +182,7 @@ def main():
["str", "pidlock", "/var/run/fail2ban.pid"], ["str", "pidlock", "/var/run/fail2ban.pid"],
["int", "maxretry", 3], ["int", "maxretry", 3],
["int", "bantime", 600], ["int", "bantime", 600],
["int", "findtime", 600],
["str", "ignoreip", ""], ["str", "ignoreip", ""],
["int", "polltime", 1], ["int", "polltime", 1],
["str", "cmdstart", ""], ["str", "cmdstart", ""],
@ -293,6 +295,9 @@ def main():
# bantime option # bantime option
banTime = conf["bantime"] banTime = conf["bantime"]
# findtime option
findTime = conf["findtime"]
# Checks for root user. This is necessary because log files # Checks for root user. This is necessary because log files
# are owned by root and firewall needs root access. # are owned by root and firewall needs root access.
if not checkForRoot(): if not checkForRoot():
@ -310,6 +315,7 @@ def main():
logSys.debug("ConfFile is " + conf["conffile"]) logSys.debug("ConfFile is " + conf["conffile"])
logSys.debug("BanTime is " + `conf["bantime"]`) logSys.debug("BanTime is " + `conf["bantime"]`)
logSys.debug("FindTime is " + `conf["findtime"]`)
logSys.debug("retryAllowed is " + `conf["maxretry"]`) logSys.debug("retryAllowed is " + `conf["maxretry"]`)
# Options # Options
@ -335,8 +341,9 @@ def main():
# Options # Options
optionValues = (["bool", "enabled", False], optionValues = (["bool", "enabled", False],
["str", "logfile", "/dev/null"], ["str", "logfile", "/dev/null"],
["int", "maxretry", None], ["int", "maxretry", maxretry],
["int", "bantime", None], ["int", "bantime", bantime],
["int", "findtime", findtime],
["str", "timeregex", ""], ["str", "timeregex", ""],
["str", "timepattern", ""], ["str", "timepattern", ""],
["str", "failregex", ""], ["str", "failregex", ""],
@ -349,19 +356,12 @@ def main():
for t in confReader.getSections(): for t in confReader.getSections():
l = confReader.getLogOptions(t, optionValues) l = confReader.getLogOptions(t, optionValues)
if l["enabled"]: if l["enabled"]:
# Override maxretry option
if not l["maxretry"] == None:
maxRetry = l["maxretry"]
# Override bantime option
if not l["bantime"] == None:
banTime = l["bantime"]
# Creates a logreader object # Creates a logreader object
lObj = LogReader(l["logfile"], l["timeregex"], l["timepattern"], lObj = LogReader(l["logfile"], l["timeregex"], l["timepattern"],
l["failregex"], maxRetry, banTime) l["failregex"], l["maxretry"], l["findtime"])
# Creates a firewall object # Creates a firewall object
fObj = Firewall(l["fwban"], l["fwunban"], banTime) fObj = Firewall(l["fwban"], l["fwunban"], l["bantime"])
# Links them into a list. I'm not really happy # Links them into a list. I'm not really happy
# with this :/ # with this :/
logFwList.append([t, lObj, fObj, dict(), l]) logFwList.append([t, lObj, fObj, dict(), l])