Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e0e005
commit 9ad46bb
Showing
25 changed files
with
163 additions
and
720 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
Metadata-Version: 1.0 | |||
Name: fail2ban | |||
Version: 0.5.2 | |||
Summary: Ban IPs that make too many password failure | |||
Home-page: http://fail2ban.sourceforge.net | |||
Author: Cyril Jaquier | |||
Author-email: lostcontrol@users.sourceforge.net | |||
License: GPL | |||
Description: | |||
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. | |||
Platform: Posix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,78 +1,78 @@ | |||
#!/bin/bash | #!/bin/bash | ||
# | # | ||
# fail2ban | # fail2ban | ||
# | # | ||
# chkconfig: 345 91 9 | # chkconfig: 345 91 9 | ||
# description: if many unsuccessfull login attempts from some ip address \ | # description: if many unsuccessfull login attempts from some ip address \ | ||
# during a short period happen, this address is banned \ | # during a short period happen, this address is banned \ | ||
# by the firewall | # by the firewall | ||
# | # | ||
# Author: Andrey G. Grozin | # Author: Andrey G. Grozin | ||
# | # | ||
# $Revision$ | # $Revision: 1.1.2.2 $ | ||
|
|
||
# Source function library. | # Source function library. | ||
. /etc/init.d/functions | . /etc/init.d/functions | ||
|
|
||
# Get config. | # Get config. | ||
. /etc/sysconfig/network | . /etc/sysconfig/network | ||
|
|
||
# Check that networking is up. | # Check that networking is up. | ||
[ "${NETWORKING}" = "no" ] && exit 0 | [ "${NETWORKING}" = "no" ] && exit 0 | ||
[ -f /etc/fail2ban.conf ] || exit 0 | [ -f /etc/fail2ban.conf ] || exit 0 | ||
|
|
||
FAIL2BAN="/usr/bin/fail2ban" | FAIL2BAN="/usr/bin/fail2ban" | ||
PIDFILE="/var/run/fail2ban.pid" | PIDFILE="/var/run/fail2ban.pid" | ||
|
|
||
RETVAL=0 | RETVAL=0 | ||
|
|
||
start() { | start() { | ||
echo -n $"Starting fail2ban: " | echo -n $"Starting fail2ban: " | ||
"${FAIL2BAN}" -b > /dev/null | "${FAIL2BAN}" -b > /dev/null | ||
RETVAL=$? | RETVAL=$? | ||
echo | echo | ||
} | } | ||
|
|
||
stop() { | stop() { | ||
if [ -f "${PIDFILE}" ]; then | if [ -f "${PIDFILE}" ]; then | ||
echo -n $"Stopping fail2ban: " | echo -n $"Stopping fail2ban: " | ||
"${FAIL2BAN}" -k > /dev/null | "${FAIL2BAN}" -k > /dev/null | ||
echo | echo | ||
fi | fi | ||
} | } | ||
|
|
||
restart() { | restart() { | ||
stop | stop | ||
start | start | ||
} | } | ||
|
|
||
# See how we were called. | # See how we were called. | ||
case "$1" in | case "$1" in | ||
start) | start) | ||
start | start | ||
;; | ;; | ||
stop) | stop) | ||
stop | stop | ||
;; | ;; | ||
status) | status) | ||
status fail2ban | status fail2ban | ||
RETVAL=$? | RETVAL=$? | ||
;; | ;; | ||
reload) | reload) | ||
restart | restart | ||
;; | ;; | ||
restart) | restart) | ||
restart | restart | ||
;; | ;; | ||
condrestart) | condrestart) | ||
if [ -f "${PIDFILE}" ]; then | if [ -f "${PIDFILE}" ]; then | ||
restart | restart | ||
fi | fi | ||
;; | ;; | ||
*) | *) | ||
echo $"Usage: $0 {start|stop|status|restart|condrestart}" | echo $"Usage: $0 {start|stop|status|restart|condrestart}" | ||
exit 1 | exit 1 | ||
;; | ;; | ||
esac | esac | ||
|
|
||
exit $RETVAL | exit $RETVAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.