Wordpress - Fail2Ban - PHP

  1. Go to Networking ⇾ Fail2Ban Intrusion Detector: Log Filters page;
  2. Click Add a new log filter button;
  3. Fill the following fields:
    3.1. Filter name: wordpress;
    3.2. Regular expressions to match:
    <HOST>.*POST.*(wp-login\.php|xmlrpc\.php|account\/signin).* 200
    
    3.3. Click Create button;
  4. Go to Networking ⇾ Fail2Ban Intrusion Detector: Filter Action Jails page;
  5. Click Add a new jail button;
  6. Fill the following fields:
    6.1. Jail name : wordpress-domain-com;
    6.2. Filter to search log for: wordpress;
    6.3. Currently enabled? set to Yes;
    6.4. Log file paths:
    /var/log/virtualmin/domain.com_access_log
    
    6.5. Click Create button;
  7. Enjoy, and please let’s close this thread already!

Note: A backend may need to be manually defined as described in this comment.

2 Likes