From 5471e99ebe3065120ff148260bc55e202b7feeed Mon Sep 17 00:00:00 2001 From: leftyfb Date: Thu, 17 Jul 2014 22:54:30 -0400 Subject: [PATCH 1/5] Added cloudflare action --- config/action.d/cloudflare.conf | 53 +++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 config/action.d/cloudflare.conf diff --git a/config/action.d/cloudflare.conf b/config/action.d/cloudflare.conf new file mode 100644 index 000000000..ead0d23e8 --- /dev/null +++ b/config/action.d/cloudflare.conf @@ -0,0 +1,53 @@ +# +# Author: Mike Rushton +# +# $Revision$ +# + +[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 = + +# Option: actionban +# Notes.: command executed when banning an IP. Take care that the +# command is executed with Fail2Ban user rights. +# Tags: <ip> IP address +# <failures> number of failures +# <time> unix timestamp of the ban time +# Values: CMD +# +actionban = curl -s "https://www.cloudflare.com/api.html?a=ban&key=&u=&tkn=" +# Option: actionunban +# Notes.: command executed when unbanning an IP. Take care that the +# command is executed with Fail2Ban user rights. +# Tags: <ip> IP address +# <failures> number of failures +# <time> unix timestamp of the ban time +# Values: CMD +# +actionunban = curl -s "https://www.cloudflare.com/api.html?a=nul&key=&u=&tkn=" + + +[Init] + +# Default Cloudflare API token +cftoken = + +# Default Cloudflare username +cfuser = From cba570cabdb8cc04f18ab7c46a0044364590772a Mon Sep 17 00:00:00 2001 From: leftyfb Date: Thu, 17 Jul 2014 23:49:35 -0400 Subject: [PATCH 2/5] Updated comments --- config/action.d/cloudflare.conf | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/config/action.d/cloudflare.conf b/config/action.d/cloudflare.conf index ead0d23e8..790a00a98 100644 --- a/config/action.d/cloudflare.conf +++ b/config/action.d/cloudflare.conf @@ -1,7 +1,9 @@ # # Author: Mike Rushton # -# $Revision$ +# Referenced from from http://www.normyee.net/blog/2012/02/02/adding-cloudflare-support-to-fail2ban by NORM YEE +# +# To get your Cloudflare API key: https://www.cloudflare.com/my-account # [Definition] @@ -27,18 +29,18 @@ actioncheck = # Option: actionban # Notes.: command executed when banning an IP. Take care that the # command is executed with Fail2Ban user rights. -# Tags: <ip> IP address -# <failures> number of failures -# <time> unix timestamp of the ban time +# Tags: IP address +# number of failures +#