ConfigServer Security & Firewall (CSF) very useful for WHM/cPanel security manner. CSF is generally considered a more advanced firewall as there are more configuration. CSF is firewall application suite for linux servers. CSF a Stateful Packet Inspection (SPI) firewall, Login/Intrusion Detection and Security application for Linux servers.

ConfigServer Firewall provides below these Scripts.
• Straight-forward SPI IP tables firewall script
• Daemon process that checks for login authentication failures for

  • Courier imap, Dovecot, uw-imap, Kerio
  • openSSH
  • cPanel, WHM, Webmail (cPanel servers only)
  • Pure-ftpd, vsftpd, Proftpd
  • Password protected web pages (htpasswd)
  • Mod_security failures (v1 and v2)
  • Suhosin failures
  • Exim SMTP AUTH
  • Custom login failures with separate log file and regular expression matching

• POP3/IMAP login tracking to enforce logins per hour
• SSH login notification
• SU login notification
• Excessive connection blocking
• UI Integration for cPanel, DirectAdmin and Webmin
• Easy upgrade between versions from within cPanel/WHM, DirectAdmin or Webmin
• Easy upgrade between versions from shell
• Pre-configured to work on a cPanel server with all the standard cPanel ports open
• Pre-configured to work on a DirectAdmin server with all the standard DirectAdmin ports open
• Auto-configures the SSH port if it’s non-standard on installation
• Block traffic on unused server IP addresses – helps reduce the risk to your server
• Alert when end-user scripts sending excessive emails per hour – for identifying spamming scripts
• Suspicious process reporting – reports potential exploits running on the server
• Excessive user processes reporting
• Excessive user process usage reporting and optional termination
• Suspicious file reporting – reports potential exploit files in /tmp and similar directories
• Directory and file watching – reports if a watched directory or a file changes
• Block traffic on a variety of Block Lists including DShield Block List and Spamhaus DROP List
• BOGON packet protection
• Pre-configured settings for Low, Medium or High firewall security (cPanel servers only)
• Works with multiple ethernet devices
• Server Security Check – Performs a basic security and settings check on the server (via cPanel/DirectAdmin/Webmin UI)
• Allow Dynamic DNS IP addresses – always allow your IP address even if it changes whenever you connect to the internet
• Alert sent if server load average remains high for a specified length of time
• mod_security log reporting (if installed)
• Email relay tracking – tracks all email sent through the server and issues alerts for excessive usage (cPanel servers only)
• IDS (Intrusion Detection System) – the last line of detection alerts you to changes to system and application binaries
• SYN Flood protection
• Ping of death protection
• Port Scan tracking and blocking
• Permanent and Temporary (with TTL) IP blocking
• Exploit checks
• Account modification tracking – sends alerts if an account entry is modified, e.g. if the password is changed or the login shell
• Shared syslog aware
• Messenger Service – Allows you to redirect connection requests from blocked IP addresses to preconfigured text and html pages to inform the visitor that they have been blocked in the firewall. This can be particularly useful for those with a large user base and help process support requests more efficiently
• Country Code blocking – Allows you to deny or allow access by ISO Country Code
• Port Flooding Detection – Per IP, per Port connection flooding detection and mitigation to help block DOS attacks
• DirectAdmin UI integration
• Updated Webmin UI integration
• WHM root access notification (cPanel servers only)
• lfd Clustering – allows IP address blocks to be automatically propagated around a group of servers running lfd. It allows allows cluster-wide allows, removals and configuration changes
• Quick start csf – deferred startup by lfd for servers with large block and/or allow lists
• Distributed Login Failure Attack detection
• Temporary IP allows (with TTL)
• IPv6 Support with ip6tables
• Integrated UI – no need for a separate Control Panel or Apache to use the csf configuration
• Integrated support for cse within the Integrated UI
• cPanel Reseller access to per reseller configurable options Unblock, Deny, Allow and Search IP address blocks
• System Statistics – Basic graphs showing the performance of the server, e.g. Load Averages, CPU Usage, Memory Usage, etc
• ipset support for large IP lists
• …lots more!
The reason we have developed this suite is that we have found over the years of providing server services that many of the tools available for the task are either over-complex, not user-friendly, or simply aren’t as effective as they could be.

Now Let’s Start to learn how to install CSF:
Follow these Steps.

Step 1 : Open Putty Application.

Type Host Name or IP Address with Port Number (22) then Open.

Step 3 : Now DOS Window open on the screen.

Step 4 : Login as: (Type your Root User Id / WHM User Name)

Step 5 : Installation
Installation is quite Straight forward.

Please go to the “/usr/src/” directory and download (ConfigServer Firewall) CSF with wget command:

cd /usr/src
rm -fv csf.tgz


You should get the information on the screen that CSF(ConfigServer Firewall) installation is completed:


Now how we can check that CSF really works on this server:

Go to the “/usr/local/csf/bin/” directory, and run “”.

cd /usr/local/csf/bin/

If you see the test results as shown below, then CSF is running without any problems on your server:

RESULT: CSF Application functional perfectly run on this server.


Step: 6: Now we configure CSF on CentOS 7

Note : Before stepping into the CSF configuration process, the first thing you must know is that “CentOS 7” has a default firewall application called “firewalld”. You have to stop firewalld and remove it from the startup.

Stop the firewalld:

systemctl stop firewalld

Disable/Remove firewalld from the startup:

systemctl disable firewalld

Then go to the CSF Configuration directory “/etc/csf/” and edit the file “csf.conf” with the vim editor:

cd /etc/csf/
vim csf.conf

Change line 11 “TESTING “ to “0” for applying the firewall configuration.


By default CSF allows incoming and outgoing traffic for the SSH standard port 22, if you use a different SSH port then please add your port to the configuration in line 139 “TCP_IN”.

Now start CSF and LFD with systemctl command:

systemctl start csf
systemctl start lfd

And then enable the CSF and LFD services to be started at boot time:

systemctl enable csf
systemctl enable lfd

Now you can see the list default rules of CSF with command:

csf -l

Now ConfigServer Firewall Installed Successfully.