Skip to content

Instantly share code, notes, and snippets.

@trepmal
Created October 28, 2014 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trepmal/d2eb189dd788a2865023 to your computer and use it in GitHub Desktop.
Save trepmal/d2eb189dd788a2865023 to your computer and use it in GitHub Desktop.
Replace API_KEY and EMAIL (2 instances each) with appropriate values.
# Fail2Ban configuration file
#
# Author: Norman Yee
#
# $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 --data "a=ban&tkn=API_KEY&email=EMAIL&key=<ip>" https://www.cloudflare.com/api_json.html
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# Tags: &lt;ip&gt; IP address
# &lt;failures&gt; number of failures
# &lt;time&gt; unix timestamp of the ban time
# Values: CMD
#
actionunban = curl -s --data "a=nul&tkn=API_KEY&email=EMAIL&key=<ip>" https://www.cloudflare.com/api_json.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment