Fail2banlogging正确的IP在光油,但仍然没有locking

我试图configurationfail2ban禁止不良的WordPresslogin尝试,但我没有太大的成功。

我正在使用WP fail2ban 3.0.0 ,正确地logging/var/log/secure上的错误login尝试,据我所知(如果有人感兴趣,我提供下面我的插件configuration):

 Apr 19 18:21:42 droplet wordpress(website.com)[17157]: Authentication failure for admin from my.ip.add.ress 

filter似乎也被正确configuration。 事实上,如果我运行fail2ban-client status wordpress我可以看到我的IP被禁止:

 Status for the jail: wordpress |- Filter | |- Currently failed: 2 | |- Total failed: 15 | `- File list: /var/log/secure `- Actions |- Currently banned: 1 |- Total banned: 1 `- Banned IP list: my.ip.add.ress 

另外fail2ban-regex /var/log/secure /etc/fail2ban/filter.d/wordpress.conffind了Failregex: 102 total

不过,我完全有能力浏览网站并访问login页面。

当然,还有一些东西可能在光油方面不见了? 我真的不知道,有什么想法?

我正在运行CentOS 7.2.1511Apache/2.4.6Varnish 4.0.3


如果有人感兴趣,这里是我如何configurationWP fail2ban使其与Varnish工作:

  1. 启用插件
  2. 将文件wordpress.conf (包含在插件文件夹中)复制到/etc/fail2ban/filters.d/
  3. /etc/fail2ban/jail.local添加到/etc/fail2ban/jail.local

     [wordpress] enabled = true port = http,https filter = wordpress logpath = /var/log/secure 
  4. wp-config.php添加了以下几行:

     define('WP_FAIL2BAN_PROXIES','my.ser.ver.ip'); define('WP_FAIL2BAN_AUTH_LOG',LOG_AUTHPRIV); 
  5. sub vcl_recv块的/etc/varnish/default.vcl中添加了以下几行:

     if (req.restarts == 0) { if (req.http.X-Forwarded-For) { set req.http.X-Forwarded-For = req.http.X-Forwarded-For + ", " + client.ip; } else { set req.http.X-Forwarded-For = client.ip; } } 
  6. sub vcl_pipe块的/etc/varnish/default.vcl中添加了以下几行:

     set bereq.http.connection = "close"; return (pipe); 

好的,find答案。 我只是不得不在相关的jail.local块添加禁止行动。 所以现在看起来像这样:

 [wordpress] enabled = true port = http,https filter = wordpress logpath = /var/log/secure action = iptables-allports