fail2ban/config/action.d/cloudflare.conf

56 lines
1.4 KiB
Plaintext
Raw Normal View History

2014-07-18 02:54:30 +00:00
#
# Author: Mike Rushton
#
2014-07-18 03:49:35 +00:00
# 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
2014-07-18 02:54:30 +00:00
#
[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.
2014-07-18 03:49:35 +00:00
# Tags: <ip> IP address
# <failures> number of failures
# <time> unix timestamp of the ban time
2014-07-18 02:54:30 +00:00
# Values: CMD
#
2014-07-28 15:10:50 +00:00
actionban = curl https://www.cloudflare.com/api_json.html -d 'a=ban' -d 'tkn=<cftoken>' -d 'email=<cfuser>' -d 'key=<ip>'
2014-07-18 02:54:30 +00:00
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
# command is executed with Fail2Ban user rights.
2014-07-18 03:49:35 +00:00
# Tags: <ip> IP address
# <failures> number of failures
# <time> unix timestamp of the ban time
2014-07-18 02:54:30 +00:00
# Values: CMD
#
2014-07-28 15:10:50 +00:00
actionunban = curl https://www.cloudflare.com/api_json.html -d 'a=nul' -d 'tkn=<cftoken>' -d 'email=<cfuser>' -d 'key=<ip>'
2014-07-18 02:54:30 +00:00
[Init]
# Default Cloudflare API token
cftoken =
# Default Cloudflare username
cfuser =