Hey
Ah okay so yeah as others have pointed out, it’s a whole different game at that point.
Viktor’s last link will work really well if you only have one CF account, however if this is for a multi-user site, the solution will not work. The key in what he has though, is making WP failed logins and xmlrpc attacks log to the system log, so fail2ban can pick them up.
What we have with Fail2Ban + Apache + CF is a mod_security rule that blocks the visitors IP, and there is a fail2ban action that triggers the rule. You cannot use iptables as that’s layer 3 and only see’s the CF IP.
Being nginx, I don’t think you can use mod_security, but there’s probably a way to configure an X-Forwarded-For IP blacklist that nginx uses and fail2ban just to append to that list.
Another option would be that you modify wp-fail2ban to also log the users email and API key, and then setup a fail2ban action that reads that token from the log and uses it in action_ban and action_unban. Sort of like the f2b-tarpit-CF-apache-WP-LLA-itsec-LSEC link above.
We’ve been working on a WordPress plugin that does login/xmlrpc syslogging, user-agent and username blocking, along with CF integration, however it’s not quite complete yet. When it is I’ll share the source code here or put it in the WordPress directory. Hopefully we could all start working it and build something really powerful.
Cheers