CSF (ConfigServer Firewall) is a free firewall that can be installed which relies on iptables and its modules. It has an interface that is built on WHM as a plugin which makes it easier for everyday users to add firewall rules to your server to lock it down from potential attackers. It also has much more configurable options than the built in firewall that comes with WHM/cPanel.
Installation
- Login to your server via SSH
- Download the installer:
$ wget http://www.configserver.com/free/csf.tgz - Extract the .tgz file:
$ tar -zxvf csf.tgz
Run the installer:
$ sh csf/install.sh
Adding Rules
- Login to WHM
- Access the CSF Interface: WHM >> Plugins >> ConfigServer Security&Firewall
- Once in the interface you want to edit the firewall config using the built in editor and make any required changes (Make sure to change testing from 1 to 0 to enable the firewall).
After making the required edits, select "Change" at the bottom of the screen. You will then restart the firewall in order for the changes to take place.
Congrats, CSF is installed and configured!