Jump to content

How to install CSF Firewall on your WHM


Recommended Posts

ConfigServer Firewall (CSF) is a firewall configuration script that provides your server's security while giving you an advanced, easy to use interface for managing firewall settings. You can easily install it to your server via SSH and later manage it via WHM. 

Installation

Login to your server via SSH (using terminal) as root and execute further commands:
 
wget https://download.configserver.com/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh

Usage

The firewall is installed through the terminal, but configuration and use are still available on the WHM platform. In WHM Search enter 'ConfigServer Security & Firewall' and select it in the menu on the left.
 
m5zllccrbp8a.png

Firewall Configuration 

ubc5tgta6ffo.png

Be sure to disable the test mode. At first, the Firewall Status will be in Test Mode. At certain intervals, cPanel will run a periodic task (cronjob) that will reset your configuration. After finishing the configuration, the test mode needs to be disabled, otherwise, the changes will be lost.
1wjexd75bgvr.png

There are a lot of different settings on this page. For example, IPv4 Port Settings allow incoming and outgoing traffic to the server via TCP, UDP, ICMP, and other ports. Let's say you need MySQL to be able to receive remote connection. So you need to add 3306 port in TCP_IN row. Or let's say you need some applications on the server to perform queries in the remote server, so we're going to include this 3306 port in TCP_OUT row.
gx7eodhnt3hn.png
 
Ports are separated by commas. Changes are saved at the bottom of the page.
fkpiwyq067q9.png

 

After changes are saved, you need to restart both csf and lfd.
8ac4j1rj3cly.png
 
If the firewall on the server is in full and not the test mode, you will see a message:
u8w1g6wgn9tx.png
 
This is just one of the configuration options. All other features are described in the Firewall Configuration page, and changes are made the same as in the example described before.

Check server security

This is a handy tool that shows your server's security level.

pt93rje2co8m.png
 

By default, the server is not protected at the recommended level:
hgde4gqhpfkl.png
 
For your safety, you can use the tips on this page. When making changes, be careful not to interfere with applications running on the server.
n6qfc660tqex.png

Allow/deny IP addresses

Quick Allow means that the IP here will be allowed to perform any task on your server (any incoming traffic, any port, etc). It's a whitelist.
Quick Deny is an opposite list. You can, for example, place the IP addresses that performed DDoS attacks for your server there. It's a blacklist.
Quick Unblock is used if the IP address was blocked by an accident. You can unblock it with this feature.
ocxpkvym1lwm.png

Check for IPs in RBLs

z3pzdkbjrzj3.png

This tool will check every IP address in your server for any public blacklists. Take note that it takes some time to complete.
lsecfjypola7.png

We have reviewed some of the key features of CSF. However, there are many more, so we recommend that you explore the features of this tool yourself and tailor them to your server's needs.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...