I am trying to set up fail2ban on my server and have it work with the WordPress fail2ban plugin, so that it bans people from logging into the WP site.
I have it set up and banning IPs, but it is banning the CloudFlare IP instead of the origin IP. I followed a tutorial for using the CloudFlare API, which was supposed to use the CloudFlare Firewall to ban the origin IP. But, this is not working. Instead of using the CloudFlare firewall, it is using the server iptable to ban the CloudFlare IP address.
My server is CentOS, Nginx.
Here is the tutorial I used - https://www.vcloudnine.de/using-wp-fail2ban-with-the-cloudflare-api-to-protect-your-website/
Here are my server logs, showing the CF IP being banned:
In jail.conf, I have:
enabled = true
filter = wordpress-hard
logpath = /var/log/messages
action = cloudflare
maxretry = 3
bantime = 604800
In my Cloudflare Action, I have my API key and email address entered at the end. Otherwise, it is the normal default CloudFlare action.
How can I get this to use the CF firewall to ban the origin IP address?