|
|
|
@ -1,10 +1,23 @@
|
|
|
|
|
#
|
|
|
|
|
# Author: Mike Rushton
|
|
|
|
|
#
|
|
|
|
|
# Referenced from from http://www.normyee.net/blog/2012/02/02/adding-cloudflare-support-to-fail2ban by NORM YEE
|
|
|
|
|
# IMPORTANT
|
|
|
|
|
#
|
|
|
|
|
# To get your Cloudflare API key: https://www.cloudflare.com/my-account
|
|
|
|
|
# Please set jail.local's permission to 640 because it contains your CF API key.
|
|
|
|
|
#
|
|
|
|
|
# This action depends on curl.
|
|
|
|
|
# Referenced 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/a/account/my-account
|
|
|
|
|
#
|
|
|
|
|
# This action needs to be set up in jail.local
|
|
|
|
|
#
|
|
|
|
|
# action = %(action_cf_mwl)s
|
|
|
|
|
# # Your CF account e-mail
|
|
|
|
|
# cfemail =
|
|
|
|
|
# # Your CF API Key
|
|
|
|
|
# cfapikey =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Definition]
|
|
|
|
|
|
|
|
|
@ -34,7 +47,8 @@ actioncheck =
|
|
|
|
|
# <time> unix timestamp of the ban time
|
|
|
|
|
# Values: CMD
|
|
|
|
|
#
|
|
|
|
|
actionban = curl https://www.cloudflare.com/api_json.html -d 'a=ban' -d 'tkn=<cftoken>' -d 'email=<cfuser>' -d 'key=<ip>'
|
|
|
|
|
actionban = curl -s -o /dev/null https://www.cloudflare.com/api_json.html -d 'a=ban' -d 'tkn=<cftoken>' -d 'email=<cfuser>' -d 'key=<ip>'
|
|
|
|
|
|
|
|
|
|
# Option: actionunban
|
|
|
|
|
# Notes.: command executed when unbanning an IP. Take care that the
|
|
|
|
|
# command is executed with Fail2Ban user rights.
|
|
|
|
@ -43,13 +57,6 @@ actionban = curl https://www.cloudflare.com/api_json.html -d 'a=ban' -d 'tkn=<cf
|
|
|
|
|
# <time> unix timestamp of the ban time
|
|
|
|
|
# Values: CMD
|
|
|
|
|
#
|
|
|
|
|
actionunban = curl https://www.cloudflare.com/api_json.html -d 'a=nul' -d 'tkn=<cftoken>' -d 'email=<cfuser>' -d 'key=<ip>'
|
|
|
|
|
|
|
|
|
|
actionunban = curl -s -o /dev/null https://www.cloudflare.com/api_json.html -d 'a=nul' -d 'tkn=<cftoken>' -d 'email=<cfuser>' -d 'key=<ip>'
|
|
|
|
|
|
|
|
|
|
[Init]
|
|
|
|
|
|
|
|
|
|
# Default Cloudflare API token
|
|
|
|
|
cftoken =
|
|
|
|
|
|
|
|
|
|
# Default Cloudflare username
|
|
|
|
|
cfuser =
|
|
|
|
|