We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

Learn how to – Install and Use CSF Firewall on RHEL / CentOS 8/7

Learn how to – Install and Use CSF Firewall on RHEL / CentOS 8/7.

How do I install and use CSF Firewall on RHEL / CentOS 8?. The first thing you do after installing your RHEL/CentOS 8 server is to configure firewall and harden server against any form of malicious access. The most popular firewall service used in RHEL based systems is Firewalld. ConfigServer Security & Firewall (CSF) is a powerful, open-source Stateful Packet Inspection (SPI) firewall, Login/Intrusion Detection and Security application for Linux servers.

Features of CSF

Here are the top features of ConfigServer Security & Firewall.

  • Straight-forward SPI iptables firewall script
  • Daemon process that checks for login authentication failures for openSSH, Mod_security failures, htpasswd, ftp, imap e.t.c.
  • Excessive connection blocking
  • BOGON packet protection
  • Directory and file watching
  • SYN Flood protection
  • IDS (Intrusion Detection System) – the last line of detection alerts you to changes to system and application binaries
  • Ping of death protection
  • Port Scan tracking and blocking
  • Port Flooding Detection – Per IP, per Port connection flooding detection and mitigation to help block DOS attacks
  • UI integration for Cpanel, Webmin, and DirectAdmin
  • Distributed Login Failure Attack detection
  • IPv6 Support with ip6tables
  • Integrated UI – no need for a separate Control Panel or Apache to use the csf configuration
  • Integrated with the CloudFlare Firewall
  • And lots more

Install CSF Firewall on RHEL / CentOS 8

If the system is not running critical applications, you can upgrade installed packages and do a reboot.

sudo dnf -y update

When done, install Perl.

sudo dnf -y install @perl

Check Perl version.

$ perl -v
This is perl 5, version 26, subversion 2 (v5.26.2) built for x86_64-linux-thread-multi
(with 52 registered patches, see perl -V for more detail)

Copyright 1987-2018, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

CSF is installed using an automation script. Download it using curl command.

curl -SL https://download.configserver.com/csf.tgz | tar -xzf -

Navigate into created folder – csf :

cd csf

Run installer.

sudo sh install.sh

See sample output below.

Test installation

$ sudo perl /usr/local/csf/bin/csftest.pl
Testing ip_tables/iptable_filter…OK
Testing ipt_LOG…OK
Testing ipt_multiport/xt_multiport…OK
Testing ipt_REJECT…OK
Testing ipt_state/xt_state…OK
Testing ipt_limit/xt_limit…OK
Testing ipt_recent…OK
Testing xt_connlimit…OK
Testing ipt_owner/xt_owner…OK
Testing iptable_nat/ipt_REDIRECT…OK
Testing iptable_nat/ipt_DNAT…OK
RESULT: csf should function on this server

Configure and Start CSF on RHEL / CentOS 8

We now have CSF installed on RHEL / CentOS 8. The main configuration file is /etc/csf/csf.conf. Modify this file to tune your firewall rules and policies. See sections below for allowed TCP and UDP ports.

Disable Testing.

sudo perl -pi -w -e "s/TESTING = "1""/TESTING = ""0""/"" /etc/csf/csf.conf

Ignore IP addresses on allow list.

web analytics

Cart

Your Cart is Empty

Back To Shop