开发者 |
invisnet
freemius |
---|---|
更新时间 | 2024年11月28日 02:19 |
PHP版本: | 7.4 及以上 |
WordPress版本: | 6.7 |
版权: | GPLv3 or later |
版权网址: | 版权信息 |
fail2ban
:
Oct 17 20:59:54 foobar wordpress(www.example.com)[1234]: Authentication failure for admin from 192.168.0.1
Oct 17 21:00:00 foobar wordpress(www.example.com)[2345]: Accepted password for admin from 192.168.0.1
WPf2b comes with three fail2ban
filters: wordpress-hard.conf
, wordpress-soft.conf
, and wordpress-extra.conf
. These are designed to allow a split between immediate banning (hard) and the traditional more graceful approach (soft), with extra rules for custom configurations.
Features
fail2ban
configuration is sane and that the filters are up to date; out-of-date filters are the primary cause of WPf2b not working as well as it can.
When did you last run the Site Health tool?mu-plugins
Support
WPf2b can easily be configured as a "must-use plugin" - see Configuration.wp‑config.php
to suit your needs - see Configuration.$wp_scripts
is uninitialised. [Premium only]WP_FAIL2BAN_SYSLOG_TAG_HOST
to simplify fail2ban
configuration with journald
.exec
is disabled (h/t @ahardy42).open_basedir
(h/t Jaroslav Huba).fail2ban
is running.wordpress-soft.conf
.wordpress-soft.conf
.WP_FAIL2BAN_LOG_COMMENTS_EXTRA
and WP_FAIL2BAN_COMMENT_EXTRA_LOG
; use WP_FAIL2BAN_LOG_COMMENT_ATTEMPTS
and WP_FAIL2BAN_COMMENT_ATTEMPT_LOG
instead.mu-plugins
activation.WP_FAIL2BAN_USE_AUTHPRIV
- a single place to switch to LOG_AUTHPRIV
for systems without LOG_AUTH
.WP_FAIL2BAN_FREE_ONLY
.WP_FAIL2BAN_PLUGIN_LOG_OTHER
and WP_FAIL2BAN_PLUGIN_OTHER_LOG
.syslog
constants in Windows (h/t @dmarkowicz).WP_FAIL2BAN_PROXIES
(h/t @stevegrunwell).WP_FAIL2BAN_PROXIES
(h/t @stevegrunwell).wp‑config.php
(h/t @iCounsellor).wp‑load.php
is loaded via a script run from the CLI in a directory with a functions.php
file.syslog
messages.oembed
(h/t @wordpressfab).WP_FAIL2BAN_BLOCK_USER_ENUMERATION
if calling REST API or XML‑RPC from admin area.define()
s to be ignored.WP_FAIL2BAN_COMMENT_EXTRA_LOG
.hard
filters (due to limitations in older versions of WordPress), now logged as known user and matched by soft
.soft
, not hard
, filters.mu‑plugins
. See Is WPf2b Already Installed?.WP_FAIL2BAN_COMMENT_EXTRA_LOG
.WP_FAIL2BAN_PINGBACK_ERROR_LOG
(future functionality).WP_FAIL2BAN_LOG_SPAM
to use LOG_NOTICE
.WP_FAIL2BAN_SPAM_LOG
to LOG_AUTH
.WP_FAIL2BAN_LOG_COMMENTS_EXTRA
events to use LOG_NOTICE
by default.mu-plugins
.WP_FAIL2BAN_LOG_COMMENTS_EXTRA
.WP_FAIL2BAN_REMOTE_ADDR
summary.WP_FAIL2BAN_PASSWORD_REQUEST_LOG
.WP_FAIL2BAN_SPAM_LOG
.WP_FAIL2BAN_LOG_COMMENTS_EXTRA
- enable logging for attempted comments on posts which are:WP_FAIL2BAN_PROXIES
which is quite hard to test properly.wordpress-soft.conf
.WP_FAIL2BAN_XMLRPC_LOG
.WP_FAIL2BAN_REMOTE_ADDR
.WP_FAIL2BAN_PROXIES
now supports an array of IPs with PHP 7.wordpress-hard.conf
.WP_FAIL2BAN_BLOCK_USER_ENUMERATION
.WP_FAIL2BAN_OPENLOG_OPTIONS
.WP_FAIL2BAN_LOG_COMMENTS
and WP_FAIL2BAN_COMMENT_LOG
.WP_FAIL2BAN_LOG_PASSWORD_REQUEST
.WP_FAIL2BAN_LOG_SPAM
.WP_FAIL2BAN_TRUNCATE_HOST
.WP_FAIL2BAN_BLOCKED_USERS
now supports an array of users with PHP 7.wordpress-hard.conf
.wordpress-hard.conf
.WP_FAIL2BAN_SYSLOG_SHORT_TAG
.WP_FAIL2BAN_HTTP_HOST
.WP_FAIL2BAN_BLOCKED_USERS
.WP_FAIL2BAN_PROXIES
code (thanks to KyleCartmell).WP_FAIL2BAN_BLOCKED_USERS
.WP_FAIL2BAN_AUTH_LOG
.WP_FAIL2BAN_LOG_PINGBACKS
.WP_FAIL2BAN_PINGBACK_LOG
.WP_FAIL2BAN_BLOCK_USER_ENUMERATION
.WP_FAIL2BAN_PROXIES
.WP_FAIL2BAN_PROXIES
code.WP_FAIL2BAN_PROXIES
.WP_FAIL2BAN_BLOCKED_USERS
.