Fixed fail2ban and replaced cent8 with el8

This commit is contained in:
2020-12-09 13:29:25 +01:00
parent b112be5aeb
commit 2a6de08f75
12 changed files with 63 additions and 12 deletions

View File

@@ -1,7 +1,7 @@
##----------##
# Centos #
##----------##
if [ "$shortdist" = "cent8" ]; then
if [ "$shortdist" = "el8" ]; then
#SeLinux
semanage port -a -t ssh_port_t -p tcp 4242
systemctl enable ufw > $OUTPUT 2>&1
@@ -14,7 +14,7 @@ fi
# UFW #
##-------##
if [ "$shortdist" = "cent8" ]; then
if [ "$shortdist" = "el8" ]; then
sed -i -e '/tuple/d' -e '/dapp/d' /usr/share/ufw/iptables/user.rules
sed -i -e '/tuple/d' -e '/dapp/d' /usr/share/ufw/iptables/user6.rules
echo "y" | ufw reset > $OUTPUT 2>&1
@@ -42,6 +42,15 @@ curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/config/fai
curl --retry 7 --retry-delay 5 -s https://plugins.svn.wordpress.org/wp-fail2ban/trunk/filters.d/wordpress-hard.conf -o /etc/fail2ban/filter.d/wordpress-hard.local
curl --retry 7 --retry-delay 5 -s https://plugins.svn.wordpress.org/wp-fail2ban/trunk/filters.d/wordpress-soft.conf -o /etc/fail2ban/filter.d/wordpress-soft.local
if [ "$shortdist" = "el8" ]; then
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/Filters/action.d/ufw.conf -o /etc/fail2ban/action.d/ufw.conf
ln -s /var/log/secure /var/log/auth.log
fi
#Start fail2ban service
systemctl start fail2ban
systemctl enable fail2ban
#General jails
rm /etc/fail2ban/jail.d/*
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/Jails/sshd.jail -o /etc/fail2ban/jail.d/sshd.local

View File

@@ -31,7 +31,7 @@ if [ "$shortdist" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] || [ "$osrel" = "deb
if dpkg-query -Wf'${db:Status-abbrev}' postfix 2>/dev/null | grep -q '^i'; then apt purge -y postfix > $OUTPUT 2>&1; fi
elif [ "$shortdist" = "cent8" ]; then
elif [ "$shortdist" = "el8" ]; then
################
# Centos #
################