sandywp / plugins / wp-fail2ban-redux
WP Fail2Ban Redux
Records various WordPress events to your server's system log for integration with Fail2Ban.
Ready in seconds.
v0.9.2 7,000+ installs WP 5.8+ PHP 7.4+

About this plugin
WP Fail2Ban Redux records various WordPress events to your server’s system log for integration with Fail2Ban.
This plugin is (mostly) a drop-in replacement for WP fail2ban by Charles Lecklider.
While WP fail2ban is a great plugin, there are a number of improvements that could be made. In order to facilitate these improvements, a major refactoring of the codebase was necessary.
The core functionality between WP Fail2Ban Redux and WP fail2ban remains the same. WP Fail2Ban Redux is considered to be mostly a drop-in replacement, because all constants have been replaced with filters, and will, possibly, require some upgrade work. Don’t work it’s as simple as implementing the constants.
The following events are recorded by default:
- Failed XML-RPC authentication attempts.
- Successful authentication attempts.
- Failed authentication attempts — differentiated by a user’s existence.
- Pingback errors.
The following events can be enabled via filter:
- Pingback requests.
- Blocked user enumeration attempts.
- Authentication attempts for blocked usernames.
- Spammed comments.
Extra documentation is available on the WP Fail2Ban Redux GitHub Wiki.
Questions
- How do I upgrade from WP fail2ban?
If you haven’t set any of the WP fail2ban constants, you don’t need to do anything. If you have set some of the constants, view the upgrade instructions.
- Will the `wordpress-hard.conf` and `wordpress-soft.conf` filters still work?
Yes! All of the improvements made in WP Fail2Ban Redux were done in a way that would allow existing functionality to work without changes to your filters. However, the demo filters included with the plugin do contain some recommended changes. There are also new features not found in WP fail2ban that will require changes to your filters to be effective. These changes are linked, by filter, below:
wordpress-hard.conf
wordpress-soft.confBe ye forewarned: Future changes to WP fail2ban may break backwards compatibility with WP Fail2Ban Redux filters. No attempts will be made to fix this. So, even though it’s not required, it is probably a good idea to update the filters anyway.
- Can I use this as a must-use plugin in the `mu-plugins` folder?
As of version 0.5.0, yes! Download the plugin, and unzip. Inside the plugin folder will be another folder named
wp-fail2ban-reduxandwp-fail2ban-redux.php. Upload this folder and file to themu-pluginsdirectory of your site.- How do you I use this plugin if my site is behind a proxy, like Cloudflare?
You need to add some code to your
wp-config.phpfile. See the below links for guidance.- https://core.trac.wordpress.org/ticket/9235#comment:39
- https://stackoverflow.com/questions/14985518/cloudflare-and-logging-visitor-ip-addresses-via-in-php/14985633#14985633
- https://support.cloudflare.com/hc/en-us/articles/200170916#12345680
sandywp / also on the shelf
Try another plugin
WP fail2ban – Advanced Security
4.2 · 60K+ installs
WP fail2ban uses fail2ban to protect your WordPress site.
4.9 · 50K+ installs
Helps secure your site against hacking attacks through detecting User Enumeration
5.0 · 3K+ installs
WP fail2ban Blocklist is a collaborative preemptive blocklist for WordPress.
Spin up a real WordPress site in seconds.
Test plugins, build a demo, hand a client a link — then squash it and start again. No local setup, no Docker.