Skip to content

Instantly share code, notes, and snippets.

@vncloudsco
Last active November 8, 2019 10:16
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save vncloudsco/5c51d1871051729f0accc65a2de16477 to your computer and use it in GitHub Desktop.
#!/bin/bash
ip=$(printf "%q" $1)
no=$(printf "%q" $6)
curl -X POST "https://api.cloudflare.com/client/v4/user/firewall/access_rules/rules" -H "X-Auth-Email: YOU@YOUREMAIL.COM" -H "X-Auth-Key: YOURCLOUDFLAREAUTHCODE" -H "Content-Type: application/json" --data '{"mode":"block","configuration":{"target":"ip","value":"'$ip'"},"notes":"fromcsflfd"}'
# Block Reporting. lfd can run an external script when it performs and IP
# address block following for example a login failure. The following setting
# is to the full path of the external script which must be executable. See
# readme.txt for format details
#
# Leave this setting blank to disable
BLOCK_REPORT = "/my-script-path/block_report.sh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment