#!/bin/sh -x
yum -y install --skip-broken perl-libwww-perl perl-LWP-Protocol-https auditd rsyslog;
systemctl enable auditd;
systemctl restart auditd;
systemctl enable rsyslog;
systemctl restart rsyslog;
cd /usr/src;
rm -fv "csf.tgz";
wget https://download.configserver.com/csf.tgz;
tar -xzf csf.tgz;
cd csf;
chmod 0755 install.sh;
sh install.sh;
/usr/sbin/csf -x;
yum install ipset* -y --skip-broken;
wget repo.zarat.dev/csf/iptables -O /etc/sysconfig/iptables;
wget repo.zarat.dev/csf/iptables -O /etc/sysconfig/ip6tables;
systemctl enable iptables;
systemctl enable ip6tables;
systemctl restart iptables ip6tables;
wget repo.zarat.dev/csf/iptables -O /etc/sysconfig/iptables;
wget repo.zarat.dev/csf/iptables -O /etc/sysconfig/ip6tables;
wget repo.zarat.dev/csf/csf2.conf -O /etc/csf/csf.conf;
wget repo.zarat.dev/csf/csf.ignore -O /etc/csf/csf.ignore;
wget repo.zarat.dev/csf/csf.rignore -O /etc/csf/csf.rignore;
wget repo.zarat.dev/csf/regex.custom.pm -O /usr/local/csf/bin/regex.custom.pm;
ln -s /usr/local/csf/bin/regex.custom.pm /etc/csf;
/usr/sbin/csf -e;
systemctl restart csf lfd;
/usr/sbin/csf -u --update;