From 818dd59d652f38fe1edd499f23f49c812a99389e Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 8 Aug 2014 11:57:30 -0400 Subject: [PATCH 1/2] ENH: symbiosis-blacklist-allports action --- ChangeLog | 8 +-- .../symbiosis-blacklist-allports.conf | 52 +++++++++++++++++++ 2 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 config/action.d/symbiosis-blacklist-allports.conf diff --git a/ChangeLog b/ChangeLog index afd151ae..9e47e987 100644 --- a/ChangeLog +++ b/ChangeLog @@ -46,9 +46,11 @@ ver. 0.9.1 (2014/xx/xx) - better, faster, stronger * filters.d/sieve.conf - fixed typo in _daemon. Thanks Jisoo Park - New features: - - Added - - monit filter. Thanks Jason H Martin - - directadmin filter. Thanks niorg + - New filters: + - monit Thanks Jason H Martin + - directadmin Thanks niorg + - New actions: + - symbiosis-blacklist-allports for Bytemark symbiosis firewall - fail2ban-client can fetch the running server version - Added Cloudflare API action diff --git a/config/action.d/symbiosis-blacklist-allports.conf b/config/action.d/symbiosis-blacklist-allports.conf new file mode 100644 index 00000000..c3ce44b0 --- /dev/null +++ b/config/action.d/symbiosis-blacklist-allports.conf @@ -0,0 +1,52 @@ +# Fail2Ban configuration file for Bytemark Symbiosis firewall +# +# Author: Yaroslav Halchenko +# + + +[Definition] + +# Option: actionstart +# Notes.: command executed once at the start of Fail2Ban. +# Values: CMD +# +actionstart = + +# Option: actionstop +# Notes.: command executed once at the end of Fail2Ban +# Values: CMD +# +actionstop = + +# Option: actioncheck +# Notes.: command executed once before each actionban command +# Values: CMD +# +actioncheck = iptables -n -L + +# Option: actionban +# Notes.: command executed when banning an IP. +# Values: CMD +# +actionban = echo 'all' >| /etc/symbiosis/firewall/blacklist.d/.auto + iptables -I 1 -s -j + +# Option: actionunban +# Notes.: command executed when unbanning an IP. +# Values: CMD +# +actionunban = rm -f /etc/symbiosis/firewall/blacklist.d/.auto + iptables -D -s -j + +[Init] + +# Option: chain +# Notes specifies the iptables chain to which the fail2ban rules should be +# added to. blacklist is a chain initiated by symbiosis firewall. +# Values: STRING Default: blacklist +chain = blacklist + +# Option: blocktype +# Note: This is to match default symbiosis firewall type for blacklisted IPs +# Values: STRING +blocktype = DROP From 93243e7d578a382f41af9a6b418571b15d5a3a2b Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 12 Aug 2014 11:57:07 -0400 Subject: [PATCH 2/2] ENH: Ignore errors while unbaning in symbiosis firewall Fail2Ban at times "interfers" with the firewall reflashing thus leading to the sporadic errors. IMHO should be safe to ignore --- config/action.d/symbiosis-blacklist-allports.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/action.d/symbiosis-blacklist-allports.conf b/config/action.d/symbiosis-blacklist-allports.conf index c3ce44b0..c4979302 100644 --- a/config/action.d/symbiosis-blacklist-allports.conf +++ b/config/action.d/symbiosis-blacklist-allports.conf @@ -36,7 +36,7 @@ actionban = echo 'all' >| /etc/symbiosis/firewall/blacklist.d/.auto # Values: CMD # actionunban = rm -f /etc/symbiosis/firewall/blacklist.d/.auto - iptables -D -s -j + iptables -D -s -j || : [Init]