From 2d8c278d744186253a9ecc53ac3b41814cdac291 Mon Sep 17 00:00:00 2001 From: Robert Vojcik Date: Thu, 13 Nov 2025 14:35:14 +0100 Subject: [PATCH 1/2] Implement cloudflare IP list as action --- config/action.d/cloudflare-list.conf | 84 ++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 config/action.d/cloudflare-list.conf diff --git a/config/action.d/cloudflare-list.conf b/config/action.d/cloudflare-list.conf new file mode 100644 index 00000000..e143c720 --- /dev/null +++ b/config/action.d/cloudflare-list.conf @@ -0,0 +1,84 @@ +# +# Author: Robert Vojcik +# Based on: cloudflare.conf by Mike Rushton +# +# This action using global cloudflare IP Lists. +# Add and remove IP addresses to IP lists instead of editing Access Rules. +# You could define rules according your needs and use IP List in it. +# This action only manage content of the IP list +# +# IMPORTANT +# +# Please set jail.local's permission to 640 because it contains your CF API token. +# +# This action depends on curl. +# +# To get your Cloudflare API token: https://developers.cloudflare.com/api/tokens/create/ + +[Definition] + +# Option: actionstart +# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false). +# Values: CMD +# +actionstart = + +# Option: actionstop +# Notes.: command executed at the stop of jail (or 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 address +# number of failures +#