Suggestion: Run a custom script after ban and unban

Post Reply
user4473
Junior Member
Posts: 7
Joined: 20 Aug 2012, 16:28

Suggestion: Run a custom script after ban and unban

Post by user4473 »

Hello,

I'm using CSF generic on Gentoo.

I have a feature suggestion: Run a script whenever an IP is banned or unbanned. It would run on any kind of ban/unban: auto or manual and perm or temp.

It would pass similar arguments as BLOCK_REPORT to the custom script.

Currently I am using BLOCK_REPORT to run a script that talks to the CloudFlare API when an IP is auto-banned, and using bash aliases to run the script when I need to manual ban.. But I dont have a way to automatically unban from CloudFlare when the tempban expires.

Thanks
ForumAdmin
Moderator
Posts: 1524
Joined: 01 Oct 2008, 09:24

Re: Suggestion: Run a custom script after ban and unban

Post by ForumAdmin »

We will add this for the next release for temporary IP unblocks.
johnang
Junior Member
Posts: 8
Joined: 08 Jan 2012, 13:20

Re: Suggestion: Run a custom script after ban and unban

Post by johnang »

Can you share a script you've wrote based on BLOCK_REPORT and CloudFlare API? Many thanks in advance.
HostBob
Junior Member
Posts: 53
Joined: 20 Feb 2013, 18:34

Re: Suggestion: Run a custom script after ban and unban

Post by HostBob »

There's a script to ban using BLOCK_REPORT detailed here:

http://www.aetherweb.co.uk/automaticall ... loudflare/

But ideally CSF could have a couple of config options for CloudFlare API and user account so it can do something like this automatically perhaps.

For unblocking there's an alternative to using CSF UNBLOCK_REPORT which I find preferable:
http://www.aetherweb.co.uk/automaticall ... ks-by-age/
Post Reply