From: <abe...@us...> - 2013-07-19 18:31:23
|
Revision: 6140 http://sourceforge.net/p/astlinux/code/6140 Author: abelbeck Date: 2013-07-19 18:31:20 +0000 (Fri, 19 Jul 2013) Log Message: ----------- AIF - adaptive ban plugin, don't ban IPv4 127.0.0.1, the IPv6 ::1 was previously ignored Modified Paths: -------------- branches/1.0/package/arnofw/adaptive-ban/95adaptive-ban.plugin.sh branches/1.0/package/arnofw/adaptive-ban/adaptive-ban-helper.sh Modified: branches/1.0/package/arnofw/adaptive-ban/95adaptive-ban.plugin.sh =================================================================== --- branches/1.0/package/arnofw/adaptive-ban/95adaptive-ban.plugin.sh 2013-07-19 17:24:28 UTC (rev 6139) +++ branches/1.0/package/arnofw/adaptive-ban/95adaptive-ban.plugin.sh 2013-07-19 18:31:20 UTC (rev 6140) @@ -2,10 +2,10 @@ # -= Arno's iptables firewall - Adaptive Ban plugin =- # PLUGIN_NAME="Adaptive Ban plugin" -PLUGIN_VERSION="1.05" +PLUGIN_VERSION="1.06" PLUGIN_CONF_FILE="adaptive-ban.conf" # -# Last changed : May 18, 2013 +# Last changed : July 19, 2013 # Requirements : AIF 2.0.0+ # Comments : Parse a log file for failed access with offending IP addresses # Ban the IP address after multiple failed attempts Modified: branches/1.0/package/arnofw/adaptive-ban/adaptive-ban-helper.sh =================================================================== --- branches/1.0/package/arnofw/adaptive-ban/adaptive-ban-helper.sh 2013-07-19 17:24:28 UTC (rev 6139) +++ branches/1.0/package/arnofw/adaptive-ban/adaptive-ban-helper.sh 2013-07-19 18:31:20 UTC (rev 6140) @@ -225,10 +225,12 @@ get_numeric_ip_version "$host" case $? in 4) - if ! ip4tables -n -L ADAPTIVE_BAN_CHAIN | grep -q " ${host//./\.}[/ ]"; then - ip4tables -A ADAPTIVE_BAN_CHAIN -s $host -j ADAPTIVE_BAN_DROP_CHAIN - if [ $? -eq 0 ]; then - log_msg "Banned IPv4 Host: $host Filter Type: $type" + if [ "$host" != "127.0.0.1" ]; then + if ! ip4tables -n -L ADAPTIVE_BAN_CHAIN | grep -q " ${host//./\.}[/ ]"; then + ip4tables -A ADAPTIVE_BAN_CHAIN -s $host -j ADAPTIVE_BAN_DROP_CHAIN + if [ $? -eq 0 ]; then + log_msg "Banned IPv4 Host: $host Filter Type: $type" + fi fi fi ;; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |