Fail2Ban Action Configuration for CloudFlare REST API V4
Note: This will only work if you have full access to your web server's
- Copy action.d/cloudflare-restv4.conf to your
- Get your CloudFlare Global API Key at: https://dash.cloudflare.com/profile
- Modify your
/etc/fail2ban/jail.localas shown in the sample jail.local file provided in this repository. Set
cfapikeyto your cloudflare account email and Global API Key respectively.
- Restart Fail2Ban with:
service fail2ban restart
- Please consider using mod_cloudflare on Apache2 servers to make sure you are using the correct IP address as the client IP address.
More info: https://www.kazimer.com/fail2ban-action-for-cloudflare-rest-api-v4/