From 76c5bd80e594523552fb5993bf1911a144690759 Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Tue, 1 May 2007 22:41:41 +0000 Subject: [PATCH 1/6] - Updated to SVN version git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@573 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 104ae403..795849fd 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.9" +version = "0.7.9-SVN" From 1e767cd8e3a1d5ad606d1043ba2cdd6a97965f6b Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Tue, 1 May 2007 22:42:10 +0000 Subject: [PATCH 2/6] - Fixed RedHat init script. Thanks to Jonathan Underwood git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@574 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- CHANGELOG | 6 +++++- README | 2 +- files/redhat-initd | 11 +++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index c273e929..f3a6f7f0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,9 +4,13 @@ |_| \__,_|_|_/___|_.__/\__,_|_||_| ============================================================= -Fail2Ban (version 0.7.9) 2007/04/19 +Fail2Ban (version 0.8.0) 2007/05/?? ============================================================= +ver. 0.8.0 (2007/05/??) - stable +---------- +- Fixed RedHat init script. Thanks to Jonathan Underwood + ver. 0.7.9 (2007/04/19) - release candidate ---------- - Close opened handlers. Thanks to Yaroslav Halchenko diff --git a/README b/README index 22262f4b..8eacfebe 100644 --- a/README +++ b/README @@ -74,7 +74,7 @@ Jonathan Kamens, Stephen Gildea, Markus Hoffmann, Mark Edgington, Patrick Börjesson, kojiro, zugeschmiert, Tyler, Nick Munger, Christoph Haas, Justin Shore, Joël Bertrand, René Berber, mEDI, Axel Thimm, Eric Gerbier, Christian Rauch, -Michael C. Haller +Michael C. Haller, Jonathan Underwood License: -------- diff --git a/files/redhat-initd b/files/redhat-initd index 12867615..205294cf 100755 --- a/files/redhat-initd +++ b/files/redhat-initd @@ -20,14 +20,14 @@ FAIL2BAN="/usr/bin/fail2ban-client" RETVAL=0 getpid() { - #pid=`ps -ef | grep fail2ban-|grep -v grep|grep -v bash|awk '{print $2}'` - pid=`ps -ef | grep fail2ban-|grep -v grep|awk '{print $2}'` + pid=`ps -ef | grep fail2ban-|grep -v grep|awk '{print $2}'` } start() { echo -n $"Starting fail2ban: " getpid if [ -z "$pid" ]; then + rm -rf /tmp/fail2ban.sock # in case of unclean shutdown $FAIL2BAN start > /dev/null RETVAL=$? fi @@ -47,7 +47,6 @@ stop() { RETVAL=$? if [ -n "$pid" ]; then $FAIL2BAN stop > /dev/null - fi sleep 1 getpid if [ -z "$pid" ]; then @@ -56,6 +55,9 @@ stop() { else echo_failure fi + else + echo_failure + fi echo return $RETVAL } @@ -72,13 +74,14 @@ case "$1" in getpid if [ -n "$pid" ]; then echo "Fail2ban (pid $pid) is running..." + $FAIL2BAN status else RETVAL=1 echo "Fail2ban is stopped" fi ;; restart) - stop + stop start ;; *) From a4c9798b186270144b51bb3080eee2c791e318b2 Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Thu, 3 May 2007 20:03:13 +0000 Subject: [PATCH 3/6] - Added Solaris 10 files. Thanks to Hanno 'Rince' Wagner git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@575 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- CHANGELOG | 1 + README | 2 +- files/solaris-fail2ban.xml | 74 ++++++++++++++++++++++++++++++++++++++ files/solaris-svc-fail2ban | 47 ++++++++++++++++++++++++ 4 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 files/solaris-fail2ban.xml create mode 100644 files/solaris-svc-fail2ban diff --git a/CHANGELOG b/CHANGELOG index f3a6f7f0..0ba11dcb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -10,6 +10,7 @@ Fail2Ban (version 0.8.0) 2007/05/?? ver. 0.8.0 (2007/05/??) - stable ---------- - Fixed RedHat init script. Thanks to Jonathan Underwood +- Added Solaris 10 files. Thanks to Hanno 'Rince' Wagner ver. 0.7.9 (2007/04/19) - release candidate ---------- diff --git a/README b/README index 8eacfebe..dea0b5ee 100644 --- a/README +++ b/README @@ -74,7 +74,7 @@ Jonathan Kamens, Stephen Gildea, Markus Hoffmann, Mark Edgington, Patrick Börjesson, kojiro, zugeschmiert, Tyler, Nick Munger, Christoph Haas, Justin Shore, Joël Bertrand, René Berber, mEDI, Axel Thimm, Eric Gerbier, Christian Rauch, -Michael C. Haller, Jonathan Underwood +Michael C. Haller, Jonathan Underwood, Hanno 'Rince' Wagner License: -------- diff --git a/files/solaris-fail2ban.xml b/files/solaris-fail2ban.xml new file mode 100644 index 00000000..c6ff0159 --- /dev/null +++ b/files/solaris-fail2ban.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/files/solaris-svc-fail2ban b/files/solaris-svc-fail2ban new file mode 100644 index 00000000..9f75f9f6 --- /dev/null +++ b/files/solaris-svc-fail2ban @@ -0,0 +1,47 @@ +#!/usr/bin/bash -e +# +# fail2ban This init.d script is used to start fail2ban. +# (C) by Hanno Wagner , License is GPL + +#set -x + +. /lib/svc/share/smf_include.sh + +set -e + + +F2B_CONF="/etc/fail2ban/fail2ban.conf" +if [ -n "$2" ] && [ -f "$F2B_CONF" ]; then + F2B_CONF="$2" +fi + +ENV="/usr/bin/env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin:/opt/sfw/bin:/usr/sfw/bin" + +case $1 in + start) + [ -f /etc/fail2ban.conf ] || touch /etc/fail2ban.conf + echo "Starting fail2ban-server with $F2B_CONF" + eval $ENV /usr/local/bin/fail2ban-client start & + ;; + stop) + echo "Stopping fail2ban-server with $F2B_CONF" + eval $ENV /usr/local/bin/fail2ban-client stop & + ;; + reload | refresh ) + echo "Reloading fail2ban-server with $F2B_CONF" + eval $ENV /usr/local/bin/fail2ban-client reload & + ;; + restart | force-reload) + echo "Forcing reload of fail2ban-server with $F2B_CONF" + eval $ENV /usr/local/bin/fail2ban-client stop & + sleep 2 + eval $ENV /usr/local/bin/fail2ban-client start & + ;; + status) + /usr/local/bin/fail2ban-client status & + ;; + *) + echo "Usage: /lib/svc/method/svc-fail2ban start|stop|status|refresh|restart|reload|force-reload" >&2 + exit 2 + ;; +esac From c045a20152862e49bff2d8e0d980ee5db199f38b Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Thu, 3 May 2007 20:04:44 +0000 Subject: [PATCH 4/6] - Added Solaris 10 files git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@576 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- MANIFEST | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MANIFEST b/MANIFEST index 83d7ae6a..60f13e54 100644 --- a/MANIFEST +++ b/MANIFEST @@ -96,6 +96,8 @@ man/generate-man files/gentoo-initd files/gentoo-confd files/redhat-initd +files/solaris-fail2ban.xml +files/solaris-svc-fail2ban files/cacti/fail2ban_stats.sh files/cacti/cacti_host_template_fail2ban.xml files/cacti/README From b4586138db5105195ca74b1290893f89633f3c01 Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Thu, 3 May 2007 20:26:56 +0000 Subject: [PATCH 5/6] - Added common/ source directory git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@577 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- doc/Doxyfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Doxyfile b/doc/Doxyfile index 1c571f36..53d3bcd0 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -459,7 +459,7 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = ../server ../client ../testcases ../ +INPUT = ../common ../server ../client ../testcases ../ # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp From 128515ddf1f2e937549e9f68df56f76b4cfeae2d Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Thu, 3 May 2007 20:30:28 +0000 Subject: [PATCH 6/6] - 0.8 is finally here :) git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@578 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- CHANGELOG | 4 ++-- README | 11 +++++------ common/version.py | 2 +- man/fail2ban-client.1 | 4 ++-- man/fail2ban-regex.1 | 4 ++-- man/fail2ban-server.1 | 4 ++-- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 0ba11dcb..94a7b411 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,10 +4,10 @@ |_| \__,_|_|_/___|_.__/\__,_|_||_| ============================================================= -Fail2Ban (version 0.8.0) 2007/05/?? +Fail2Ban (version 0.8.0) 2007/05/03 ============================================================= -ver. 0.8.0 (2007/05/??) - stable +ver. 0.8.0 (2007/05/03) - stable ---------- - Fixed RedHat init script. Thanks to Jonathan Underwood - Added Solaris 10 files. Thanks to Hanno 'Rince' Wagner diff --git a/README b/README index dea0b5ee..7a4aa86f 100644 --- a/README +++ b/README @@ -4,7 +4,7 @@ |_| \__,_|_|_/___|_.__/\__,_|_||_| ============================================================= -Fail2Ban (version 0.7.9) 2007/04/19 +Fail2Ban (version 0.8.0) 2007/05/03 ============================================================= Fail2Ban scans log files like /var/log/pwdfail and bans IP @@ -28,16 +28,15 @@ Optional: To install, just do: -> tar xvfj fail2ban-0.7.9.tar.bz2 -> cd fail2ban-0.7.9 +> tar xvfj fail2ban-0.8.0.tar.bz2 +> cd fail2ban-0.8.0 > python setup.py install This will install Fail2Ban into /usr/share/fail2ban. The executable scripts are placed into /usr/bin. -Gentoo: ebuilds are available on the website. -Debian: Fail2Ban is in Debian unstable. -RedHat: packages are available on the website. +It is possible that Fail2ban is already packaged for your +distribution. In this case, you should use it. Fail2Ban should be correctly installed now. Just type: diff --git a/common/version.py b/common/version.py index 795849fd..929c2225 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.9-SVN" +version = "0.8.0" diff --git a/man/fail2ban-client.1 b/man/fail2ban-client.1 index 2c4f7205..3dd4111b 100644 --- a/man/fail2ban-client.1 +++ b/man/fail2ban-client.1 @@ -1,11 +1,11 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. -.TH FAIL2BAN-CLIENT "1" "April 2007" "fail2ban-client v0.7.9" "User Commands" +.TH FAIL2BAN-CLIENT "1" "May 2007" "fail2ban-client v0.8.0" "User Commands" .SH NAME fail2ban-client \- configure and control the server .SH DESCRIPTION [?1034hUsage: ../fail2ban\-client [OPTIONS] .PP -Fail2Ban v0.7.9 reads log file that contains password failure report +Fail2Ban v0.8.0 reads log file that contains password failure report and bans the corresponding IP addresses using firewall rules. .SH OPTIONS .TP diff --git a/man/fail2ban-regex.1 b/man/fail2ban-regex.1 index 1d772cbb..a7fae822 100644 --- a/man/fail2ban-regex.1 +++ b/man/fail2ban-regex.1 @@ -1,12 +1,12 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. -.TH FAIL2BAN-REGEX "1" "April 2007" "fail2ban-regex v0.7.9" "User Commands" +.TH FAIL2BAN-REGEX "1" "May 2007" "fail2ban-regex v0.8.0" "User Commands" .SH NAME fail2ban-regex \- test Fail2ban "failregex" option .SH SYNOPSIS .B fail2ban-regex [\fIOPTIONS\fR] \fI \fR .SH DESCRIPTION -Fail2Ban v0.7.9 reads log file that contains password failure report +Fail2Ban v0.8.0 reads log file that contains password failure report and bans the corresponding IP addresses using firewall rules. .PP This tools can test regular expressions for "fail2ban". diff --git a/man/fail2ban-server.1 b/man/fail2ban-server.1 index 46efd735..d8ed93cd 100644 --- a/man/fail2ban-server.1 +++ b/man/fail2ban-server.1 @@ -1,12 +1,12 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. -.TH FAIL2BAN-SERVER "1" "April 2007" "fail2ban-server v0.7.9" "User Commands" +.TH FAIL2BAN-SERVER "1" "May 2007" "fail2ban-server v0.8.0" "User Commands" .SH NAME fail2ban-server \- start the server .SH SYNOPSIS .B fail2ban-server [\fIOPTIONS\fR] .SH DESCRIPTION -Fail2Ban v0.7.9 reads log file that contains password failure report +Fail2Ban v0.8.0 reads log file that contains password failure report and bans the corresponding IP addresses using firewall rules. .PP Only use this command for debugging purpose. Start the server with