Version Description
- Fix warning with array of blocked users (h/t @Znuff).
- Fix reports. [Premium only]
Download this release
Release Info
Developer | invisnet |
Plugin | WP fail2ban |
Version | 4.4.0.4 |
Comparing to | |
See all releases |
Code changes from version 4.4.0.3 to 4.4.0.4
- constants.php +1 -1
- filters.d/wordpress-extra.conf +1 -1
- filters.d/wordpress-hard.conf +1 -1
- filters.d/wordpress-soft.conf +1 -1
- lib/loader.php +53 -15
- readme.txt +11 -1
- wp-fail2ban.php +1 -1
constants.php
CHANGED
@@ -12,7 +12,7 @@ namespace org\lecklider\charles\wordpress\wp_fail2ban;
|
|
12 |
// @codeCoverageIgnoreStart
|
13 |
|
14 |
if (!defined('WP_FAIL2BAN_VER')) {
|
15 |
-
define('WP_FAIL2BAN_VER', '4.4.0.
|
16 |
}
|
17 |
if (!defined('WP_FAIL2BAN_VER_SHORT')) {
|
18 |
define('WP_FAIL2BAN_VER_SHORT', '4.4');
|
12 |
// @codeCoverageIgnoreStart
|
13 |
|
14 |
if (!defined('WP_FAIL2BAN_VER')) {
|
15 |
+
define('WP_FAIL2BAN_VER', '4.4.0.4');
|
16 |
}
|
17 |
if (!defined('WP_FAIL2BAN_VER_SHORT')) {
|
18 |
define('WP_FAIL2BAN_VER_SHORT', '4.4');
|
filters.d/wordpress-extra.conf
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
# Fail2Ban filter for extra failures
|
2 |
-
# Auto-generated: 2022-
|
3 |
#
|
4 |
|
5 |
[INCLUDES]
|
1 |
# Fail2Ban filter for extra failures
|
2 |
+
# Auto-generated: 2022-03-04T17:05:38+00:00
|
3 |
#
|
4 |
|
5 |
[INCLUDES]
|
filters.d/wordpress-hard.conf
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
# Fail2Ban filter for hard failures
|
2 |
-
# Auto-generated: 2022-
|
3 |
#
|
4 |
|
5 |
[INCLUDES]
|
1 |
# Fail2Ban filter for hard failures
|
2 |
+
# Auto-generated: 2022-03-04T17:05:38+00:00
|
3 |
#
|
4 |
|
5 |
[INCLUDES]
|
filters.d/wordpress-soft.conf
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
# Fail2Ban filter for soft failures
|
2 |
-
# Auto-generated: 2022-
|
3 |
#
|
4 |
|
5 |
[INCLUDES]
|
1 |
# Fail2Ban filter for soft failures
|
2 |
+
# Auto-generated: 2022-03-04T17:05:38+00:00
|
3 |
#
|
4 |
|
5 |
[INCLUDES]
|
lib/loader.php
CHANGED
@@ -28,7 +28,7 @@ class Config
|
|
28 |
* @since 4.3.2.1 Moved from inline array.
|
29 |
*/
|
30 |
const CONFIG = [
|
31 |
-
'WP_FAIL2BAN_AUTH_LOG' => [
|
32 |
'validate' => 'intval',
|
33 |
'unset' => true,
|
34 |
'default' => WPF2B_FACILITY_LOG_AUTH,
|
@@ -36,21 +36,21 @@ class Config
|
|
36 |
'logging',
|
37 |
'authentication',
|
38 |
'facility']],
|
39 |
-
'WP_FAIL2BAN_LOG_COMMENTS' => [
|
40 |
'validate' => 'boolval',
|
41 |
'unset' => true,
|
42 |
'field' => [
|
43 |
'logging',
|
44 |
'comments',
|
45 |
'enabled']],
|
46 |
-
'WP_FAIL2BAN_LOG_COMMENTS_EXTRA' => [
|
47 |
'validate' => 'intval',
|
48 |
'unset' => true,
|
49 |
'field' => [
|
50 |
'logging',
|
51 |
'comments',
|
52 |
'extra']],
|
53 |
-
'WP_FAIL2BAN_COMMENT_LOG' => [
|
54 |
'validate' => 'intval',
|
55 |
'unset' => false,
|
56 |
'default' => LOG_USER,
|
@@ -58,7 +58,7 @@ class Config
|
|
58 |
'logging',
|
59 |
'comments',
|
60 |
'facility']],
|
61 |
-
'WP_FAIL2BAN_COMMENT_EXTRA_LOG' => [
|
62 |
'validate' => 'intval',
|
63 |
'unset' => false,
|
64 |
'default' => WPF2B_FACILITY_LOG_AUTH,
|
@@ -66,14 +66,14 @@ class Config
|
|
66 |
'logging',
|
67 |
'comments-extra',
|
68 |
'facility']],
|
69 |
-
'WP_FAIL2BAN_LOG_PASSWORD_REQUEST' => [
|
70 |
'validate' => 'boolval',
|
71 |
'unset' => true,
|
72 |
'field' => [
|
73 |
'logging',
|
74 |
'password-request',
|
75 |
'enabled']],
|
76 |
-
'WP_FAIL2BAN_PASSWORD_REQUEST_LOG' => [
|
77 |
'validate' => 'intval',
|
78 |
'unset' => false,
|
79 |
'default' => LOG_USER,
|
@@ -81,14 +81,14 @@ class Config
|
|
81 |
'logging',
|
82 |
'password-request',
|
83 |
'facility']],
|
84 |
-
'WP_FAIL2BAN_LOG_PINGBACKS' => [
|
85 |
'validate' => 'boolval',
|
86 |
'unset' => true,
|
87 |
'field' => [
|
88 |
'logging',
|
89 |
'pingback',
|
90 |
'enabled']],
|
91 |
-
'WP_FAIL2BAN_PINGBACK_LOG' => [
|
92 |
'validate' => 'intval',
|
93 |
'unset' => false,
|
94 |
'default' => LOG_USER,
|
@@ -96,14 +96,14 @@ class Config
|
|
96 |
'logging',
|
97 |
'pingback',
|
98 |
'facility']],
|
99 |
-
'WP_FAIL2BAN_LOG_SPAM' => [
|
100 |
'validate' => 'boolval',
|
101 |
'unset' => true,
|
102 |
'field' => [
|
103 |
'logging',
|
104 |
'spam',
|
105 |
'enabled']],
|
106 |
-
'WP_FAIL2BAN_SPAM_LOG' => [
|
107 |
'validate' => 'intval',
|
108 |
'unset' => false,
|
109 |
'default' => WPF2B_FACILITY_LOG_AUTH,
|
@@ -136,7 +136,7 @@ class Config
|
|
136 |
'syslog',
|
137 |
'workaround',
|
138 |
'http_host']],
|
139 |
-
'WP_FAIL2BAN_TRUNCATE_HOST' => [
|
140 |
'validate' => 'intval',
|
141 |
'unset' => true,
|
142 |
'field' => [
|
@@ -154,7 +154,7 @@ class Config
|
|
154 |
'block',
|
155 |
'user_enumeration']],
|
156 |
'WP_FAIL2BAN_BLOCKED_USERS' => [
|
157 |
-
'validate' => '
|
158 |
'unset' => true,
|
159 |
'field' => [
|
160 |
'block',
|
@@ -296,7 +296,7 @@ class Config
|
|
296 |
'plugins',
|
297 |
'xmlrpc',
|
298 |
'facility']],
|
299 |
-
'WP_FAIL2BAN_PLUGIN_OTHER_LOG' => [
|
300 |
'validate' => 'intval',
|
301 |
'unset' => false,
|
302 |
'default' => LOG_USER,
|
@@ -441,6 +441,42 @@ class Config
|
|
441 |
return (false === $value) ? [] : $value;
|
442 |
}
|
443 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
444 |
/**
|
445 |
* Helper: filtered get_site_option('wp-fail2ban')
|
446 |
*
|
@@ -600,7 +636,9 @@ class Config
|
|
600 |
self::$cache[$define] = (isset($def['default']))
|
601 |
? $def['validate']($def['default'])
|
602 |
: call_user_func($def['validate'], false);
|
603 |
-
|
|
|
|
|
604 |
}
|
605 |
}
|
606 |
|
28 |
* @since 4.3.2.1 Moved from inline array.
|
29 |
*/
|
30 |
const CONFIG = [
|
31 |
+
'WP_FAIL2BAN_AUTH_LOG' => [ //
|
32 |
'validate' => 'intval',
|
33 |
'unset' => true,
|
34 |
'default' => WPF2B_FACILITY_LOG_AUTH,
|
36 |
'logging',
|
37 |
'authentication',
|
38 |
'facility']],
|
39 |
+
'WP_FAIL2BAN_LOG_COMMENTS' => [ //
|
40 |
'validate' => 'boolval',
|
41 |
'unset' => true,
|
42 |
'field' => [
|
43 |
'logging',
|
44 |
'comments',
|
45 |
'enabled']],
|
46 |
+
'WP_FAIL2BAN_LOG_COMMENTS_EXTRA' => [ //
|
47 |
'validate' => 'intval',
|
48 |
'unset' => true,
|
49 |
'field' => [
|
50 |
'logging',
|
51 |
'comments',
|
52 |
'extra']],
|
53 |
+
'WP_FAIL2BAN_COMMENT_LOG' => [ //
|
54 |
'validate' => 'intval',
|
55 |
'unset' => false,
|
56 |
'default' => LOG_USER,
|
58 |
'logging',
|
59 |
'comments',
|
60 |
'facility']],
|
61 |
+
'WP_FAIL2BAN_COMMENT_EXTRA_LOG' => [ //
|
62 |
'validate' => 'intval',
|
63 |
'unset' => false,
|
64 |
'default' => WPF2B_FACILITY_LOG_AUTH,
|
66 |
'logging',
|
67 |
'comments-extra',
|
68 |
'facility']],
|
69 |
+
'WP_FAIL2BAN_LOG_PASSWORD_REQUEST' => [ //
|
70 |
'validate' => 'boolval',
|
71 |
'unset' => true,
|
72 |
'field' => [
|
73 |
'logging',
|
74 |
'password-request',
|
75 |
'enabled']],
|
76 |
+
'WP_FAIL2BAN_PASSWORD_REQUEST_LOG' => [ //
|
77 |
'validate' => 'intval',
|
78 |
'unset' => false,
|
79 |
'default' => LOG_USER,
|
81 |
'logging',
|
82 |
'password-request',
|
83 |
'facility']],
|
84 |
+
'WP_FAIL2BAN_LOG_PINGBACKS' => [ //
|
85 |
'validate' => 'boolval',
|
86 |
'unset' => true,
|
87 |
'field' => [
|
88 |
'logging',
|
89 |
'pingback',
|
90 |
'enabled']],
|
91 |
+
'WP_FAIL2BAN_PINGBACK_LOG' => [ //
|
92 |
'validate' => 'intval',
|
93 |
'unset' => false,
|
94 |
'default' => LOG_USER,
|
96 |
'logging',
|
97 |
'pingback',
|
98 |
'facility']],
|
99 |
+
'WP_FAIL2BAN_LOG_SPAM' => [ //
|
100 |
'validate' => 'boolval',
|
101 |
'unset' => true,
|
102 |
'field' => [
|
103 |
'logging',
|
104 |
'spam',
|
105 |
'enabled']],
|
106 |
+
'WP_FAIL2BAN_SPAM_LOG' => [ //
|
107 |
'validate' => 'intval',
|
108 |
'unset' => false,
|
109 |
'default' => WPF2B_FACILITY_LOG_AUTH,
|
136 |
'syslog',
|
137 |
'workaround',
|
138 |
'http_host']],
|
139 |
+
'WP_FAIL2BAN_TRUNCATE_HOST' => [ //
|
140 |
'validate' => 'intval',
|
141 |
'unset' => true,
|
142 |
'field' => [
|
154 |
'block',
|
155 |
'user_enumeration']],
|
156 |
'WP_FAIL2BAN_BLOCKED_USERS' => [
|
157 |
+
'validate' => __CLASS__.'::str_array_val',
|
158 |
'unset' => true,
|
159 |
'field' => [
|
160 |
'block',
|
296 |
'plugins',
|
297 |
'xmlrpc',
|
298 |
'facility']],
|
299 |
+
'WP_FAIL2BAN_PLUGIN_OTHER_LOG' => [ //
|
300 |
'validate' => 'intval',
|
301 |
'unset' => false,
|
302 |
'default' => LOG_USER,
|
441 |
return (false === $value) ? [] : $value;
|
442 |
}
|
443 |
|
444 |
+
/**
|
445 |
+
* Validate string or array.
|
446 |
+
*
|
447 |
+
* @since 4.4.0.4
|
448 |
+
*
|
449 |
+
* @param array|string|false $value
|
450 |
+
*
|
451 |
+
* @return array|string
|
452 |
+
*/
|
453 |
+
public static function str_array_val($value)
|
454 |
+
{
|
455 |
+
return self::$instance->validateStringOrArray($value);
|
456 |
+
}
|
457 |
+
|
458 |
+
/**
|
459 |
+
* Validate string or array.
|
460 |
+
*
|
461 |
+
* @since 4.4.0.4
|
462 |
+
*
|
463 |
+
* @param array|string|false $value
|
464 |
+
*
|
465 |
+
* @return array|string
|
466 |
+
*/
|
467 |
+
public function validateStringOrArray($value)
|
468 |
+
{
|
469 |
+
if (false === $value) {
|
470 |
+
return [];
|
471 |
+
|
472 |
+
} elseif (is_array($value) || is_string($value)) {
|
473 |
+
return $value;
|
474 |
+
|
475 |
+
} else {
|
476 |
+
throw new \InvalidArgumentException();
|
477 |
+
}
|
478 |
+
}
|
479 |
+
|
480 |
/**
|
481 |
* Helper: filtered get_site_option('wp-fail2ban')
|
482 |
*
|
636 |
self::$cache[$define] = (isset($def['default']))
|
637 |
? $def['validate']($def['default'])
|
638 |
: call_user_func($def['validate'], false);
|
639 |
+
if (!defined('PHPUNIT_COMPOSER_INSTALL')) {
|
640 |
+
define($define, self::$cache[$define]); // @codeCoverageIgnore
|
641 |
+
}
|
642 |
}
|
643 |
}
|
644 |
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://wp-fail2ban.com/?utm_source=wordpress.org&utm_medium=readme&
|
|
5 |
Tags: fail2ban, login, security, syslog, brute force, protection, classicpress
|
6 |
Requires at least: 4.2
|
7 |
Tested up to: 5.9
|
8 |
-
Stable tag: 4.4.0.
|
9 |
Requires PHP: 7.4
|
10 |
License: GPLv3 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -83,6 +83,10 @@ Write a myriad of WordPress events to syslog for integration with fail2ban.
|
|
83 |
|
84 |
== Changelog ==
|
85 |
|
|
|
|
|
|
|
|
|
86 |
= 4.4.0.3 =
|
87 |
* Fix type error (h/t @brianshim).
|
88 |
|
@@ -317,6 +321,12 @@ Write a myriad of WordPress events to syslog for integration with fail2ban.
|
|
317 |
|
318 |
== Upgrade Notice ==
|
319 |
|
|
|
|
|
|
|
|
|
|
|
|
|
320 |
= 4.4.0.2 =
|
321 |
This is a feature release. To take advantage of the new features, including the Blocklist Add-on, you will need up update your `fail2ban` filters; existing filters will continue to work as before.
|
322 |
**Blocklist Add-on users**: Please disable the Blocklist plugin before upgrading *WP fail2ban*, then upgrade the Blocklist plugin and reactivate it.
|
5 |
Tags: fail2ban, login, security, syslog, brute force, protection, classicpress
|
6 |
Requires at least: 4.2
|
7 |
Tested up to: 5.9
|
8 |
+
Stable tag: 4.4.0.4
|
9 |
Requires PHP: 7.4
|
10 |
License: GPLv3 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
83 |
|
84 |
== Changelog ==
|
85 |
|
86 |
+
= 4.4.0.4 =
|
87 |
+
* Fix warning with array of blocked users (h/t @Znuff).
|
88 |
+
* Fix reports. [Premium only]
|
89 |
+
|
90 |
= 4.4.0.3 =
|
91 |
* Fix type error (h/t @brianshim).
|
92 |
|
321 |
|
322 |
== Upgrade Notice ==
|
323 |
|
324 |
+
= 4.4.0.4 =
|
325 |
+
This is a bugfix release. You do not need to update your filters from 4.4.0.
|
326 |
+
|
327 |
+
= 4.4.0.3 =
|
328 |
+
This is a bugfix release. You do not need to update your filters from 4.4.0.
|
329 |
+
|
330 |
= 4.4.0.2 =
|
331 |
This is a feature release. To take advantage of the new features, including the Blocklist Add-on, you will need up update your `fail2ban` filters; existing filters will continue to work as before.
|
332 |
**Blocklist Add-on users**: Please disable the Blocklist plugin before upgrading *WP fail2ban*, then upgrade the Blocklist plugin and reactivate it.
|
wp-fail2ban.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin URI: https://wp-fail2ban.com/
|
5 |
* Description: Write a myriad of WordPress events to syslog for integration with fail2ban.
|
6 |
* Text Domain: wp-fail2ban
|
7 |
-
* Version: 4.4.0.
|
8 |
* Author: Charles Lecklider
|
9 |
* Author URI: https://invis.net/
|
10 |
* License: GPLv3
|
4 |
* Plugin URI: https://wp-fail2ban.com/
|
5 |
* Description: Write a myriad of WordPress events to syslog for integration with fail2ban.
|
6 |
* Text Domain: wp-fail2ban
|
7 |
+
* Version: 4.4.0.4
|
8 |
* Author: Charles Lecklider
|
9 |
* Author URI: https://invis.net/
|
10 |
* License: GPLv3
|