From 364e1ff397e9129db6a6ddaf8575de75cb12a0ab Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Sun, 11 Feb 2007 23:18:58 +0000 Subject: [PATCH 01/17] - Updated git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@545 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- common/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/version.py b/common/version.py index f563230f..22f09605 100644 --- a/common/version.py +++ b/common/version.py @@ -24,4 +24,4 @@ __date__ = "$Date$" __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" -version = "0.7.7" +version = "0.7.7-SVN" From 35a26237ebb667217109f22fb153652c4f414d7c Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Sun, 11 Feb 2007 23:19:32 +0000 Subject: [PATCH 02/17] - Fixed asctime pattern in datedetector.py git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@546 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- server/datedetector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/datedetector.py b/server/datedetector.py index 951aba6f..9e7fbb36 100644 --- a/server/datedetector.py +++ b/server/datedetector.py @@ -51,7 +51,7 @@ class DateDetector: # asctime template = DateStrptime() template.setName("Weekday Month Day Hour:Minute:Second Year") - template.setRegex("\S{3} \S{3} \d{2} \d{2}:\d{2}:\d{2} \d{4}") + template.setRegex("\S{3} \S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2} \d{4}") template.setPattern("%a %b %d %H:%M:%S %Y") self.__templates.append(template) # simple date From 3d5b32c19975d188f3d1bed7234ac68731d04c22 Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Sun, 11 Feb 2007 23:21:56 +0000 Subject: [PATCH 03/17] - Display the IP list correctly git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@547 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- client/beautifier.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/beautifier.py b/client/beautifier.py index b31cc266..132d1626 100644 --- a/client/beautifier.py +++ b/client/beautifier.py @@ -68,13 +68,18 @@ class Beautifier: msg = "Added jail " + response elif inC[0:1] == ['status']: if len(inC) > 1: + # Create IP list + ipList = "" + for ip in response[1][1][2][1]: + ipList += ip + " " + # Display information msg = "Status for the jail: " + inC[1] + "\n" msg = msg + "|- " + response[0][0] + "\n" msg = msg + "| |- " + response[0][1][0][0] + ":\t" + `response[0][1][0][1]` + "\n" msg = msg + "| `- " + response[0][1][1][0] + ":\t" + `response[0][1][1][1]` + "\n" msg = msg + "`- " + response[1][0] + "\n" msg = msg + " |- " + response[1][1][0][0] + ":\t" + `response[1][1][0][1]` + "\n" - msg = msg + " | `- " + response[1][1][2][0] + ":\t" + `response[1][1][2][1]` + "\n" + msg = msg + " | `- " + response[1][1][2][0] + ":\t" + ipList + "\n" msg = msg + " `- " + response[1][1][1][0] + ":\t" + `response[1][1][1][1]` else: msg = "Status\n" From eee07663198e1416298470acb76aa7174a115021 Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Sun, 11 Feb 2007 23:22:32 +0000 Subject: [PATCH 04/17] - Updated git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@548 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- CHANGELOG | 4 ++++ TODO | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 1de258b9..a113b396 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,10 @@ Fail2Ban (version 0.7.7) 2007/02/08 ============================================================= +ver. 0.?.? (2007/??/??) - ??? +---------- +- Fixed asctime pattern in datedetector.py + ver. 0.7.7 (2007/02/08) - release candidate ---------- - Added signal handling in fail2ban-client diff --git a/TODO b/TODO index aff717ac..87f64929 100644 --- a/TODO +++ b/TODO @@ -13,6 +13,12 @@ Legend: # partially done * done +- Discuss where Fail2ban should be installed (/usr/share, + /usr/lib/python/site-packages/, etc) + +- Cleanup fail2ban-client and fail2ban-server. Move code to + server/ and client/ + - Add timeout to external commands (signal alarm, watchdog thread, etc) @@ -22,7 +28,7 @@ Legend: (openssh, postfix, proftp) - Added tag for failregex. Add features using this - information + information. Maybe add more tags - Look at the memory consumption. Decrease memory usage From b4caed8c007961f869dca581f45c7f6151378739 Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Mon, 12 Feb 2007 21:50:50 +0000 Subject: [PATCH 05/17] - Added new filter for spam bots - Added new action for buffered mails git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@549 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- CHANGELOG | 1 + MANIFEST | 1 + config/action.d/mail-buffered.conf | 88 +++++++++++++++++++++++++++++ config/filter.d/apache-badbots.conf | 25 ++++++++ config/jail.conf | 13 +++++ 5 files changed, 128 insertions(+) create mode 100644 config/action.d/mail-buffered.conf create mode 100644 config/filter.d/apache-badbots.conf diff --git a/CHANGELOG b/CHANGELOG index a113b396..0590250f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -10,6 +10,7 @@ Fail2Ban (version 0.7.7) 2007/02/08 ver. 0.?.? (2007/??/??) - ??? ---------- - Fixed asctime pattern in datedetector.py +- Added new filters/actions. Thanks to Yaroslav Halchenko ver. 0.7.7 (2007/02/08) - release candidate ---------- diff --git a/MANIFEST b/MANIFEST index 28edae13..d49b19bc 100644 --- a/MANIFEST +++ b/MANIFEST @@ -78,6 +78,7 @@ config/action.d/ipfw.conf config/action.d/mail-whois.conf config/action.d/mail-whois-lines.conf config/action.d/mail.conf +config/action.d/mail-buffered.conf config/action.d/hostsdeny.conf config/action.d/shorewall.conf config/fail2ban.conf diff --git a/config/action.d/mail-buffered.conf b/config/action.d/mail-buffered.conf new file mode 100644 index 00000000..6be60a63 --- /dev/null +++ b/config/action.d/mail-buffered.conf @@ -0,0 +1,88 @@ +# Fail2Ban configuration file +# +# Author: Cyril Jaquier +# +# $Revision: 510 $ +# + +[Definition] + +# Option: actionstart +# Notes.: command executed once at the start of Fail2Ban. +# Values: CMD +# +actionstart = echo -en "Hi,\n + The jail has been started successfuly.\n + Output will be buffered until lines are available.\n + Regards,\n + Fail2Ban"|mail -s "[Fail2Ban] : started" + +# Option: actionend +# Notes.: command executed once at the end of Fail2Ban +# Values: CMD +# +actionstop = if [ -d ]; then + echo -en "Hi,\n + These hosts have been banned by Fail2Ban.\n + `cat ` + Regards,\n + Fail2Ban"|mail -s "[Fail2Ban] : Summary" + rm + fi + echo -en "Hi,\n + The jail has been stopped.\n + Regards,\n + Fail2Ban"|mail -s "[Fail2Ban] : stopped" + +# Option: actioncheck +# Notes.: command executed once before each actionban command +# Values: CMD +# +actioncheck = + +# Option: actionban +# Notes.: command executed when banning an IP. Take care that the +# command is executed with Fail2Ban user rights. +# Tags: IP address +# number of failures +#