Version Description
Minor cosmetic updates.
Download this release
Release Info
Developer | invisnet |
Plugin | WP fail2ban |
Version | 1.1 |
Comparing to | |
See all releases |
Code changes from version 1.0 to 1.1
- readme.txt +9 -6
- wordpress.conf +2 -1
- wp-fail2ban.php +41 -25
readme.txt
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
=== WP fail2ban ===
|
2 |
Contributors: invisnet
|
3 |
Author URI: https://charles.lecklider.org/
|
4 |
-
Plugin URI: https://charles.lecklider.org/wordpress/fail2ban/
|
5 |
Tags: fail2ban, security, syslog, login
|
6 |
Requires at least: 3.4.0
|
7 |
Tested up to: 3.4.2
|
8 |
-
Stable tag: 1.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -31,10 +31,9 @@ Requires PHP 5.3 or later.
|
|
31 |
1. Copy `wordpress.conf` to your `fail2ban/filters.d` directory
|
32 |
1. Edit `jail.local` to include something like:
|
33 |
|
34 |
-
`[wordpress]`
|
35 |
-
`enabled = true`
|
36 |
-
`filter = wordpress`
|
37 |
-
`action = pf`
|
38 |
`logpath = /var/log/auth.log`
|
39 |
|
40 |
1. Reload or restart `fail2ban`
|
@@ -43,5 +42,9 @@ There are no options to configure.
|
|
43 |
|
44 |
== Changelog ==
|
45 |
|
|
|
|
|
|
|
46 |
= 1.0 =
|
47 |
Initial release.
|
|
1 |
=== WP fail2ban ===
|
2 |
Contributors: invisnet
|
3 |
Author URI: https://charles.lecklider.org/
|
4 |
+
Plugin URI: https://charles.lecklider.org/wordpress/wp-fail2ban/
|
5 |
Tags: fail2ban, security, syslog, login
|
6 |
Requires at least: 3.4.0
|
7 |
Tested up to: 3.4.2
|
8 |
+
Stable tag: 1.1
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
31 |
1. Copy `wordpress.conf` to your `fail2ban/filters.d` directory
|
32 |
1. Edit `jail.local` to include something like:
|
33 |
|
34 |
+
`[wordpress]`
|
35 |
+
`enabled = true`
|
36 |
+
`filter = wordpress`
|
|
|
37 |
`logpath = /var/log/auth.log`
|
38 |
|
39 |
1. Reload or restart `fail2ban`
|
42 |
|
43 |
== Changelog ==
|
44 |
|
45 |
+
= 1.1 =
|
46 |
+
Minor cosmetic updates.
|
47 |
+
|
48 |
= 1.0 =
|
49 |
Initial release.
|
50 |
+
|
wordpress.conf
CHANGED
@@ -27,4 +27,5 @@ failregex = ^%(__prefix_line)sAuthentication failure for .* from <HOST>$
|
|
27 |
# Notes.: regex to ignore. If this regex matches, the line is ignored.
|
28 |
# Values: TEXT
|
29 |
#
|
30 |
-
ignoreregex =
|
|
27 |
# Notes.: regex to ignore. If this regex matches, the line is ignored.
|
28 |
# Values: TEXT
|
29 |
#
|
30 |
+
ignoreregex =
|
31 |
+
|
wp-fail2ban.php
CHANGED
@@ -1,25 +1,41 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Plugin Name: WP fail2ban
|
4 |
-
Plugin URI: https://charles.lecklider.org/wordpress/wp-fail2ban/
|
5 |
-
Description: Write all login attempts to syslog for integration with fail2ban.
|
6 |
-
Version: 1.0
|
7 |
-
Author: Charles Lecklider
|
8 |
-
Author URI: https://charles.lecklider.org/
|
9 |
-
License: GPL2
|
10 |
-
*/
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: WP fail2ban
|
4 |
+
Plugin URI: https://charles.lecklider.org/wordpress/wp-fail2ban/
|
5 |
+
Description: Write all login attempts to syslog for integration with fail2ban.
|
6 |
+
Version: 1.0
|
7 |
+
Author: Charles Lecklider
|
8 |
+
Author URI: https://charles.lecklider.org/
|
9 |
+
License: GPL2
|
10 |
+
*/
|
11 |
+
|
12 |
+
/* Copyright 2012 Charles Lecklider (email : wordpress@charles.lecklider.org)
|
13 |
+
|
14 |
+
This program is free software; you can redistribute it and/or modify
|
15 |
+
it under the terms of the GNU General Public License, version 2, as
|
16 |
+
published by the Free Software Foundation.
|
17 |
+
|
18 |
+
This program is distributed in the hope that it will be useful,
|
19 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
20 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
21 |
+
GNU General Public License for more details.
|
22 |
+
|
23 |
+
You should have received a copy of the GNU General Public License
|
24 |
+
along with this program; if not, write to the Free Software
|
25 |
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
26 |
+
*/
|
27 |
+
|
28 |
+
|
29 |
+
add_action( 'wp_login',
|
30 |
+
function($user_login, $user)
|
31 |
+
{
|
32 |
+
openlog('wordpress('.$_SERVER['HTTP_HOST'].')',LOG_NDELAY|LOG_PID,LOG_AUTH);
|
33 |
+
syslog(LOG_INFO,"Accepted password for $user_login from {$_SERVER['REMOTE_ADDR']}");
|
34 |
+
});
|
35 |
+
add_action( 'wp_login_failed',
|
36 |
+
function($username)
|
37 |
+
{
|
38 |
+
openlog('wordpress('.$_SERVER['HTTP_HOST'].')',LOG_NDELAY|LOG_PID,LOG_AUTH);
|
39 |
+
syslog(LOG_NOTICE,"Authentication failure for $username from {$_SERVER['REMOTE_ADDR']}");
|
40 |
+
});
|
41 |
+
|