From 9548edaff0d68d0331b9dc855778e2b5289bb83a Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Sat, 6 Aug 2005 18:43:11 +0000 Subject: [PATCH 01/17] - Do not exit on exception. Continue and wait for an unhandled exception git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@176 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- logreader/logreader.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/logreader/logreader.py b/logreader/logreader.py index 0dea9d70..b1acf74a 100644 --- a/logreader/logreader.py +++ b/logreader/logreader.py @@ -89,7 +89,7 @@ class LogReader: fileHandler = open(self.logPath) except OSError: logSys.error("Unable to open "+self.logPath) - sys.exit(-1) + return fileHandler def isModified(self): @@ -99,7 +99,6 @@ class LogReader: self.logStats = os.stat(self.logPath) except OSError: logSys.error("Unable to get stat on "+self.logPath) - sys.exit(-1) if self.lastModTime == self.logStats.st_mtime: return False From d2f3d1c263a6bc8f07229a5870fac3f5a51de1e6 Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Sat, 6 Aug 2005 18:44:06 +0000 Subject: [PATCH 02/17] - Fixed a bug with "-k" git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@177 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- fail2ban.py | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/fail2ban.py b/fail2ban.py index 7e5bb516..c7702790 100755 --- a/fail2ban.py +++ b/fail2ban.py @@ -137,14 +137,7 @@ def getCmdLineOptions(optList): if opt[0] == "-p": conf["pidlock"] = opt[1] if opt[0] == "-k": - pid = checkForPID(conf["pidlock"]) - if pid: - killPID(int(pid)) - logSys.warn("Killed Fail2Ban with PID "+pid) - sys.exit(0) - else: - logSys.error("No running Fail2Ban found") - sys.exit(-1) + conf["kill"] = True def main(): """ Fail2Ban main function @@ -196,6 +189,23 @@ def main(): # Gets command line options getCmdLineOptions(optList) + + # PID lock + pidLock.setPath(conf["pidlock"]) + + # Now we can kill properly a running instance if needed + try: + conf["kill"] + pid = pidLock.exists() + if pid: + killPID(int(pid)) + logSys.warn("Killed Fail2Ban with PID "+pid) + sys.exit(0) + else: + logSys.error("No running Fail2Ban found") + sys.exit(-1) + except KeyError: + pass # Start Fail2Ban in daemon mode if conf["background"]: @@ -244,9 +254,6 @@ def main(): hdlr.setFormatter(formatter) logSys.addHandler(hdlr) - # PID lock - pidLock.setPath(conf["pidlock"]) - # Ignores IP list ignoreIPList = conf["ignoreip"].split(' ') From b3a90d749224e46a43afcb5166a39d4abbdec60c Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Sun, 7 Aug 2005 13:06:56 +0000 Subject: [PATCH 03/17] - Changed mask to 16 - Removed "-i eth0". Match all interfaces git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@178 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- config/fail2ban.conf.default | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/config/fail2ban.conf.default b/config/fail2ban.conf.default index 45f063a7..5ec5330c 100644 --- a/config/fail2ban.conf.default +++ b/config/fail2ban.conf.default @@ -45,9 +45,9 @@ bantime = 600 # Notes.: space separated list of IP's to be ignored by fail2ban. # You can use CIDR mask in order to specify a range. # Example: ignoreip = 192.168.0.1/24 123.45.235.65 -# Values: IP Default: 192.168.0.0/24 +# Values: IP Default: 192.168.0.0/16 # -ignoreip = 192.168.0.0/24 +ignoreip = 192.168.0.0/16 # Option: cmdstart # Notes.: command executed once at the start of Fail2Ban @@ -145,14 +145,14 @@ logfile = /var/log/httpd/access_log # Values: CMD Default: # fwstart = iptables -N fail2ban-http - iptables -I INPUT -i eth0 -p tcp --dport http -j fail2ban-http + iptables -I INPUT -p tcp --dport http -j fail2ban-http iptables -A fail2ban-http -j RETURN # Option: fwend # Notes.: command executed once at the end of Fail2Ban # Values: CMD Default: # -fwend = iptables -D INPUT -i eth0 -p tcp --dport http -j fail2ban-http +fwend = iptables -D INPUT -p tcp --dport http -j fail2ban-http iptables -D fail2ban-http -j RETURN iptables -X fail2ban-http @@ -164,9 +164,9 @@ fwend = iptables -D INPUT -i eth0 -p tcp --dport http -j fail2ban-http # unix timestamp of the last failure # unix timestamp of the ban time # Values: CMD -# Default: iptables -I INPUT 1 -i eth0 -s -j DROP +# Default: iptables -I INPUT 1 -s -j DROP # -fwban = iptables -I fail2ban-http 1 -i eth0 -s -j DROP +fwban = iptables -I fail2ban-http 1 -s -j DROP # Option: fwunban # Notes.: command executed when unbanning an IP. Take care that the @@ -175,9 +175,9 @@ fwban = iptables -I fail2ban-http 1 -i eth0 -s -j DROP # unix timestamp of the ban time # unix timestamp of the unban time # Values: CMD -# Default: iptables -D INPUT -i eth0 -s -j DROP +# Default: iptables -D INPUT -s -j DROP # -fwunban = iptables -D fail2ban-http -i eth0 -s -j DROP +fwunban = iptables -D fail2ban-http -s -j DROP # Option: timeregex # Notes.: regex to match timestamp in Apache logfile. @@ -217,14 +217,14 @@ logfile = /var/log/secure # Values: CMD Default: # fwstart = iptables -N fail2ban-ssh - iptables -I INPUT -i eth0 -p tcp --dport ssh -j fail2ban-ssh + iptables -I INPUT -p tcp --dport ssh -j fail2ban-ssh iptables -A fail2ban-ssh -j RETURN # Option: fwend # Notes.: command executed once at the end of Fail2Ban # Values: CMD Default: # -fwend = iptables -D INPUT -i eth0 -p tcp --dport ssh -j fail2ban-ssh +fwend = iptables -D INPUT -p tcp --dport ssh -j fail2ban-ssh iptables -D fail2ban-ssh -j RETURN iptables -X fail2ban-ssh @@ -236,9 +236,9 @@ fwend = iptables -D INPUT -i eth0 -p tcp --dport ssh -j fail2ban-ssh # unix timestamp of the last failure # unix timestamp of the ban time # Values: CMD -# Default: iptables -I INPUT 1 -i eth0 -s -j DROP +# Default: iptables -I INPUT 1 -s -j DROP # -fwban = iptables -I fail2ban-ssh 1 -i eth0 -s -j DROP +fwban = iptables -I fail2ban-ssh 1 -s -j DROP # Option: fwunbanrule # Notes.: command executed when unbanning an IP. Take care that the @@ -247,9 +247,9 @@ fwban = iptables -I fail2ban-ssh 1 -i eth0 -s -j DROP # unix timestamp of the ban time # unix timestamp of the unban time # Values: CMD -# Default: iptables -D INPUT -i eth0 -s -j DROP +# Default: iptables -D INPUT -s -j DROP # -fwunban = iptables -D fail2ban-ssh -i eth0 -s -j DROP +fwunban = iptables -D fail2ban-ssh -s -j DROP # Option: timeregex # Notes.: regex to match timestamp in SSH logfile. From dd27cafee31ac1f502a9b40c7bce438a808df8a3 Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Sun, 7 Aug 2005 13:08:18 +0000 Subject: [PATCH 04/17] - Added better handling of exception git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@179 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- utils/pidlock.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/utils/pidlock.py b/utils/pidlock.py index 6eeb0dde..c5a4176a 100644 --- a/utils/pidlock.py +++ b/utils/pidlock.py @@ -51,17 +51,25 @@ class PIDLock: def create(self): """ Create PID lock. """ - fileHandler = open(self.path, mode='w') - pid = os.getpid() - fileHandler.write(`pid` + '\n') - fileHandler.close() - logSys.debug("Created PID lock (" + `pid` + ") in " + self.path) + try: + fileHandler = open(self.path, mode='w') + pid = os.getpid() + fileHandler.write(`pid` + '\n') + fileHandler.close() + logSys.debug("Created PID lock (" + `pid` + ") in " + self.path) + return True + except: + logSys.error("Unable to create PID lock " + self.path) + return False def remove(self): """ Remove PID lock. """ - os.remove(self.path) - logSys.debug("Removed PID lock " + self.path) + try: + os.remove(self.path) + logSys.debug("Removed PID lock " + self.path) + except OSError: + logSys.error("Unable to remove PID lock " + self.path) def exists(self): """ Returns the current PID if Fail2Ban is running or False From 38f2c24be1661a8115228e5853440e5d1b7bb022 Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Sun, 7 Aug 2005 13:10:00 +0000 Subject: [PATCH 05/17] - Updated git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@180 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- CHANGELOG | 10 +++++++++- README | 9 +++++---- version.py | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7c477030..8a0f6433 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,9 +4,17 @@ |_| \__,_|_|_/___|_.__/\__,_|_||_| ============================================================= -Fail2Ban (version 0.5.2) 2005/08/06 +Fail2Ban (version 0.?.?) 2005/08/?? ============================================================= +ver. 0.?.? (2005/08/??) - ??? +---------- +- Fixed exception handling in PIDLock +- Removed warning when using "-V" or "-h" with no config + file. Thanks to Yaroslav Halchenko +- Removed "-i eth0" from config file. Thanks to Yaroslav + Halchenko + ver. 0.5.2 (2005/08/06) - beta ---------- - Better PID lock file handling. Should close #1239562 diff --git a/README b/README index 4997742a..908b21bb 100644 --- a/README +++ b/README @@ -4,7 +4,7 @@ |_| \__,_|_|_/___|_.__/\__,_|_||_| ============================================================= -Fail2Ban (version 0.5.2) 2005/08/06 +Fail2Ban (version 0.?.?) 2005/08/?? ============================================================= Fail2Ban scans log files like /var/log/pwdfail and bans IP @@ -58,8 +58,8 @@ Require: python-2.3 (http://www.python.org) To install, just do: -> tar xvfj fail2ban-0.5.2.tar.bz2 -> cd fail2ban-0.5.2 +> tar xvfj fail2ban-0.?.?.tar.bz2 +> cd fail2ban-0.?.? > python setup.py install This will install Fail2Ban into /usr/lib/fail2ban. The fail2ban @@ -121,7 +121,8 @@ Thanks: ------- Kévin Drapel, Marvin Rouge, Sireyessire, Robert Edeker, -Tom Pike, Iain Lea, Andrey G. Grozin, Yaroslav Halchenko +Tom Pike, Iain Lea, Andrey G. Grozin, Yaroslav Halchenko, +Jonathan Kamens License: -------- diff --git a/version.py b/version.py index b589afaa..b3cc35fd 100644 --- a/version.py +++ b/version.py @@ -24,4 +24,4 @@ __date__ = "$Date$" __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" -version = "0.5.2" +version = "0.5.2-CVS" From ed46bcdaf2be703b983e8193892ad9846aef80ab Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Sun, 7 Aug 2005 13:10:39 +0000 Subject: [PATCH 06/17] - Removed "It needs log4py" from description git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@181 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a2d4b4bc..a4f096f3 100755 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ Fail2Ban scans log files like /var/log/pwdfail or /var/log/apache/error_log and bans IP that makes too many password failures. It updates firewall rules to reject the IP address or executes user defined -commands. It needs log4py.''' +commands.''' setup( name = "fail2ban", From 8a1241533f04b473cf70ee38fe94bca127f17a0b Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Sun, 7 Aug 2005 13:12:15 +0000 Subject: [PATCH 07/17] - Removed warning when using "-V" or "-h" with no config file. Thanks to Yaroslav Halchenko git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@182 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- fail2ban.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/fail2ban.py b/fail2ban.py index c7702790..131914a5 100755 --- a/fail2ban.py +++ b/fail2ban.py @@ -114,10 +114,6 @@ def getCmdLineOptions(optList): """ Gets the command line options """ for opt in optList: - if opt[0] in ["-h", "--help"]: - dispUsage() - if opt[0] in ["-V", "--version"]: - dispVersion() if opt[0] == "-v": conf["verbose"] = conf["verbose"] + 1 if opt[0] == "-b": @@ -166,6 +162,10 @@ def main(): for opt in optList: if opt[0] == "-c": conf["conffile"] = opt[1] + if opt[0] in ["-h", "--help"]: + dispUsage() + if opt[0] in ["-V", "--version"]: + dispVersion() # Reads the config file and create a LogReader instance for # each log file to check. @@ -276,7 +276,10 @@ def main(): logSys.error("Fail2Ban already running with PID "+pid) sys.exit(-1) else: - pidLock.create() + ret = pidLock.create() + if not ret: + # Unable to create PID lock. Exit + sys.exit(-1) logSys.debug("ConfFile is " + conf["conffile"]) logSys.debug("BanTime is " + `conf["bantime"]`) From daf35a353579395982d62bb5278632adc2aeb8d5 Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Wed, 17 Aug 2005 19:26:14 +0000 Subject: [PATCH 08/17] - Added a warning message if IP address is not valid in ignoreip git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@183 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- fail2ban.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fail2ban.py b/fail2ban.py index 131914a5..bb9655df 100755 --- a/fail2ban.py +++ b/fail2ban.py @@ -349,6 +349,8 @@ def main(): if isValidIP(ip): for element in logFwList: element[1].addIgnoreIP(ip) + else: + logSys.warn(ip + " is not a valid IP address") logSys.info("Fail2Ban v" + version + " is running") # Execute global start command From c5c90b182a310d5240657bc53319d31f6729d339 Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Wed, 17 Aug 2005 19:26:49 +0000 Subject: [PATCH 09/17] - Fixed bug #1262345 git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@184 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- utils/dns.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/dns.py b/utils/dns.py index 0dc060a9..8d099753 100644 --- a/utils/dns.py +++ b/utils/dns.py @@ -58,8 +58,9 @@ def searchIP(text): def isValidIP(str): """ Return true if str is a valid IP """ + s = str.split('/', 1) try: - socket.inet_aton(str) + socket.inet_aton(s[0]) return True except socket.error: return False From 631f2ac352703db3c157b0abb56a45955b921bd5 Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Wed, 17 Aug 2005 19:34:00 +0000 Subject: [PATCH 10/17] - Updated git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@185 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 8a0f6433..cc58d0b5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,7 @@ Fail2Ban (version 0.?.?) 2005/08/?? ver. 0.?.? (2005/08/??) - ??? ---------- +- Fixed bug #1262345 - Fixed exception handling in PIDLock - Removed warning when using "-V" or "-h" with no config file. Thanks to Yaroslav Halchenko From cdc7b4b048965367a7827b71b8632c867a305b0c Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Mon, 5 Sep 2005 21:05:00 +0000 Subject: [PATCH 11/17] - Renamed "maxretry" to "maxfailures" and changed default value to 5. Thanks to Stephen Gildea git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@186 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- config/fail2ban.conf.default | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/fail2ban.conf.default b/config/fail2ban.conf.default index 5ec5330c..13b4539f 100644 --- a/config/fail2ban.conf.default +++ b/config/fail2ban.conf.default @@ -29,11 +29,11 @@ logtargets = /var/log/fail2ban.log # pidlock = /var/run/fail2ban.pid -# Option: maxretry -# Notes.: number of retrys before IP gets banned. -# Values: NUM Default: 3 +# Option: maxfailures +# Notes.: number of failures before IP gets banned. +# Values: NUM Default: 5 # -maxretry = 3 +maxfailures = 5 # Option: bantime # Notes.: number of seconds an IP will be banned. From 54f4a7d2409dde5054ce692300022569db817ccf Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Mon, 5 Sep 2005 21:06:15 +0000 Subject: [PATCH 12/17] - Hopefully fixed bug #1256075 git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@187 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- logreader/logreader.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/logreader/logreader.py b/logreader/logreader.py index b1acf74a..37fe23a9 100644 --- a/logreader/logreader.py +++ b/logreader/logreader.py @@ -134,11 +134,13 @@ class LogReader: logSys.debug(self.logPath) logFile = self.openLogFile() self.setFilePos(logFile) - lastLine = '' + lastLine = None for line in logFile: + if not self.hasTime(line): + # There is no valid time in this line + continue lastLine = line - failList = self.findFailure(line) - for element in failList: + for element in self.findFailure(line): ip = element[0] unixTime = element[1] if unixTime < time.time()-self.findTime: @@ -152,7 +154,8 @@ class LogReader: else: ipList[ip] = (1, unixTime) self.lastPos = logFile.tell() - self.lastDate = self.getTime(lastLine) + if lastLine: + self.lastDate = self.getTime(lastLine) logFile.close() return ipList @@ -175,6 +178,15 @@ class LogReader: failList.append([ip, date]) return failList + def hasTime(self, line): + """ Return true if the line contains a date + """ + timeMatch = re.search(self.timeregex, line) + if timeMatch: + return True + else: + return False + def getTime(self, line): """ Gets the time of a log message. """ From c573432e742519c270cb3c8f9078e5956b5d6bbf Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Mon, 5 Sep 2005 21:12:08 +0000 Subject: [PATCH 13/17] - Fixed a bug when overriding "maxfailures" or "bantime". Thanks to Yaroslav Halchenko git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@188 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- fail2ban.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/fail2ban.py b/fail2ban.py index bb9655df..debd2b6b 100755 --- a/fail2ban.py +++ b/fail2ban.py @@ -129,7 +129,7 @@ def getCmdLineOptions(optList): if opt[0] == "-i": conf["ignoreip"] = opt[1] if opt[0] == "-r": - conf["maxretry"] = int(opt[1]) + conf["maxfailures"] = int(opt[1]) if opt[0] == "-p": conf["pidlock"] = opt[1] if opt[0] == "-k": @@ -177,7 +177,7 @@ def main(): ["str", "logtargets", "/var/log/fail2ban.log"], ["bool", "debug", False], ["str", "pidlock", "/var/run/fail2ban.pid"], - ["int", "maxretry", 3], + ["int", "maxfailures", 5], ["int", "bantime", 600], ["str", "ignoreip", ""], ["int", "polltime", 1], @@ -257,12 +257,6 @@ def main(): # Ignores IP list ignoreIPList = conf["ignoreip"].split(' ') - # maxretry option - maxRetry = conf["maxretry"] - - # bantime option - banTime = conf["bantime"] - # Checks for root user. This is necessary because log files # are owned by root and firewall needs root access. if not checkForRoot(): @@ -283,7 +277,7 @@ def main(): logSys.debug("ConfFile is " + conf["conffile"]) logSys.debug("BanTime is " + `conf["bantime"]`) - logSys.debug("retryAllowed is " + `conf["maxretry"]`) + logSys.debug("MaxFailure is " + `conf["maxfailures"]`) # Options optionValues = (["bool", "enabled", False], @@ -308,7 +302,7 @@ def main(): # Options optionValues = (["bool", "enabled", False], ["str", "logfile", "/dev/null"], - ["int", "maxretry", None], + ["int", "maxfailures", None], ["int", "bantime", None], ["str", "timeregex", ""], ["str", "timepattern", ""], @@ -322,17 +316,21 @@ def main(): for t in confReader.getSections(): l = confReader.getLogOptions(t, optionValues) if l["enabled"]: - # Override maxretry option - if not l["maxretry"] == None: - maxRetry = l["maxretry"] + # Override maxfailures option + if not l["maxfailures"] == None: + maxFailures = l["maxfailures"] + else: + maxFailures = conf["maxfailures"] # Override bantime option if not l["bantime"] == None: banTime = l["bantime"] + else: + banTime = conf["bantime"] # Creates a logreader object lObj = LogReader(l["logfile"], l["timeregex"], l["timepattern"], - l["failregex"], maxRetry, banTime) + l["failregex"], maxFailures, banTime) # Creates a firewall object fObj = Firewall(l["fwban"], l["fwunban"], banTime) # Links them into a list. I'm not really happy From c1a86f9e187376bf8966920f405fc7dcc1cadbbc Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Mon, 5 Sep 2005 21:12:32 +0000 Subject: [PATCH 14/17] - Updated git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@189 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- CHANGELOG | 7 +++++++ README | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index cc58d0b5..cd159b7b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,13 @@ Fail2Ban (version 0.?.?) 2005/08/?? ver. 0.?.? (2005/08/??) - ??? ---------- +- Fixed a bug when overriding "maxfailures" or "bantime". + Thanks to Yaroslav Halchenko +- Added more debug output if an error occurs when sending + mail. Thanks to Stephen Gildea +- Renamed "maxretry" to "maxfailures" and changed default + value to 5. Thanks to Stephen Gildea +- Hopefully fixed bug #1256075 - Fixed bug #1262345 - Fixed exception handling in PIDLock - Removed warning when using "-V" or "-h" with no config diff --git a/README b/README index 908b21bb..4355f743 100644 --- a/README +++ b/README @@ -122,7 +122,7 @@ Thanks: Kévin Drapel, Marvin Rouge, Sireyessire, Robert Edeker, Tom Pike, Iain Lea, Andrey G. Grozin, Yaroslav Halchenko, -Jonathan Kamens +Jonathan Kamens, Stephen Gildea License: -------- From 830ac2001e48b5cca5835d6a4b05c62914949a6f Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Thu, 8 Sep 2005 18:05:59 +0000 Subject: [PATCH 15/17] - Added more debug output if an error occurs when sending mail. Thanks to Stephen Gildea git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@190 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- utils/mail.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/mail.py b/utils/mail.py index 5781d89e..239d4e8e 100644 --- a/utils/mail.py +++ b/utils/mail.py @@ -64,8 +64,8 @@ class Mail: server.sendmail(self.fromAddr, self.toAddr, mail) logSys.debug("Email sent to " + `self.toAddr`) server.quit() - except Exception: + except Exception, e: logSys.error("Unable to send mail to " + self.host + ":" + `self.port` + " from " + self.fromAddr + " to " + - `self.toAddr`) + `self.toAddr` + ": " + `e` + ": " + `e.args`) \ No newline at end of file From d0c70e1535fcb3c43e5fec00fec01cf129b8bf9d Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Thu, 8 Sep 2005 18:20:51 +0000 Subject: [PATCH 16/17] - Updated for 0.5.3 git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@191 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- CHANGELOG | 4 ++-- README | 11 ++++++----- version.py | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index cd159b7b..de0736a0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,10 +4,10 @@ |_| \__,_|_|_/___|_.__/\__,_|_||_| ============================================================= -Fail2Ban (version 0.?.?) 2005/08/?? +Fail2Ban (version 0.5.3) 2005/09/08 ============================================================= -ver. 0.?.? (2005/08/??) - ??? +ver. 0.5.3 (2005/09/08) - beta ---------- - Fixed a bug when overriding "maxfailures" or "bantime". Thanks to Yaroslav Halchenko diff --git a/README b/README index 4355f743..ba03b945 100644 --- a/README +++ b/README @@ -4,7 +4,7 @@ |_| \__,_|_|_/___|_.__/\__,_|_||_| ============================================================= -Fail2Ban (version 0.?.?) 2005/08/?? +Fail2Ban (version 0.5.3) 2005/09/08 ============================================================= Fail2Ban scans log files like /var/log/pwdfail and bans IP @@ -58,15 +58,16 @@ Require: python-2.3 (http://www.python.org) To install, just do: -> tar xvfj fail2ban-0.?.?.tar.bz2 -> cd fail2ban-0.?.? +> tar xvfj fail2ban-0.5.3.tar.bz2 +> cd fail2ban-0.5.3 > python setup.py install This will install Fail2Ban into /usr/lib/fail2ban. The fail2ban executable is placed into /usr/bin. -Gentoo: an ebuild is available on the website. -Debian: a package is available on the website. +Gentoo: ebuilds are available on the website. +Debian: Fail2Ban is in Debian unstable. +RedHat: packages are available on the website. Fail2Ban should now be correctly installed. Just type: diff --git a/version.py b/version.py index b3cc35fd..bb7a2699 100644 --- a/version.py +++ b/version.py @@ -24,4 +24,4 @@ __date__ = "$Date$" __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" -version = "0.5.2-CVS" +version = "0.5.3" From 10c0307ad51999f51bc546eddccba0c95d0023c2 Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Thu, 8 Sep 2005 18:21:04 +0000 Subject: [PATCH 17/17] - Updated git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@193 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- TODO | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TODO b/TODO index 5b383282..bfdb1a90 100644 --- a/TODO +++ b/TODO @@ -10,3 +10,5 @@ ToDo See Feature Request Tracking System at SourceForge.net - improve installation process (better prefix support) +- install Fail2ban into /usr/share +- better configuration files