ConfigServer Security & Firewall (CSF) is an advanced firewall solution for Linux servers. It integrates seamlessly with cPanel/WHM, providing a robust security layer against various threats. This guide will walk you through the installation and configuration process of CSF on your server.
systemctl stop firewalld systemctl disable firewalld rpm -e apf-9.7
ssh root@your_server_ip
cd /usr/src wget https://download.configserver.com/csf.tgz tar -xzf csf.tgz cd csf sh install.sh
csf -v
nano /etc/csf/csf.conf
Alternatively, you can use the WHM interface, which we will be using in this guide. Log in to WHM and, in the left menu, search for “ConfigServer Security and Firewall.
You will then see the main CSF interface. Scroll down until you find a button labeled ‘Firewall Configuration’ and click on it.
TCP_IN = "22,80,443" TCP_OUT = "22,80,443" UDP_IN = "53" UDP_OUT = "53"
csf -s csf -e
LF_CPANEL = "1"
csf -r
WHM » Plugins » ConfigServer Security & Firewall
cat /var/log/lfd.log
nano -w /etc/csf/csf.allow nano -w /etc/csf/csf.ignore or vi /etc/csf/csf.deny (In centos systems)
Add entries like:
# Home office 192.168.1.1 # Remote developer 203.0.113.1
You can specify as many IPs as needed, ensuring they are static IPs. For instance, you might use the static IP of your office or the IP of your remote web developer, as demonstrated in the example below.
WHM » Plugins » ConfigServer Security & Firewall » Firewall Allow IPs
csf -r
tail -f /var/log/lfd.log
SYNFLOOD = "1" SYNFLOOD_RATE = "60/s" SYNFLOOD_BURST = "10" PORTFLOOD = "80;tcp;80;5"
csf --status csf --disable csf --enable csf --restart
Maintain a strict whitelist policy, regularly updating and specifying only necessary IP addresses to minimize security risks.
By following these steps, your cPanel/WHM server will be well-protected with CSF, offering advanced firewall capabilities and easy management through WHM. For more expert tips and comprehensive hosting solutions, contact Netrouting. Continue to explore additional CSF features and configurations to enhance your server’s security posture further.