Fail2Ban recipe for Ninjafirewall
-
I googled for this and only found mentions that such as thing was possible, but no solution. So I threw this together and it seems to be working, but maybe someone who is more of an expect on Fail2Ban could make it more efficient. This is for Ubuntu 12.04 LTS, directory structure may need to be adjusted for other distributions.
Procedure:
Turn on brute force login protection on the NinjaFirewall | Log-in Protection settings page. Checkmark the Write incident to the server AUTH log. option. Save your settings.Next, ssh into your web server (assuming you have Fail2Ban already installed and working) and create a new recipe file with
sudo vi /etc/fail2ban/filter.d/wordpress-ninjafw.conf
Insert the following text…[INCLUDES] before = common.conf [Definition] _daemon = wordpress-ninjafw failregex = ^.* ninjafirewall\[.*\]: Possible brute-force attack from <HOST> on ignoreregex =
Next, turn on the filter by editing or creating a jail.local file with…
vi /etc/fail2ban/jail.local
and insert the following text…[wordpress-ninjafw] enabled = true filter = wordpress-ninjafw logpath = /var/log/auth.log port = http,https
Finally, restart fail2ban with…
sudo service fail2ban restart
- The topic ‘Fail2Ban recipe for Ninjafirewall’ is closed to new replies.