Page 1 of 1

Suggestion: Run a custom script after ban and unban

Posted: 13 Feb 2013, 09:35
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

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

Posted: 13 Feb 2013, 10:02
by ForumAdmin
We will add this for the next release for temporary IP unblocks.

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

Posted: 24 Mar 2013, 10:12
by johnang
Can you share a script you've wrote based on BLOCK_REPORT and CloudFlare API? Many thanks in advance.

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

Posted: 04 Apr 2016, 12:20
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/