From a9f57d351325fecbe4171bc1124bab03c1ab39a2 Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Thu, 3 Dec 2020 11:28:41 +0100 Subject: [PATCH] Fixed UFW defaults for Centos Fixed selinux ssh port --- CoreModules/generic/conf.sh | 13 +++++++++++++ CoreModules/generic/dnf.pkg.list | 2 +- CoreModules/generic/preconf.sh | 2 -- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CoreModules/generic/conf.sh b/CoreModules/generic/conf.sh index c0dd3f9..243aff2 100644 --- a/CoreModules/generic/conf.sh +++ b/CoreModules/generic/conf.sh @@ -1,7 +1,20 @@ +##--------------------## +# (Centos) SeLinux # +##--------------------## +if [ "$shortdist" = "cent8" ]; then + semanage port -a -t ssh_port_t -p tcp 4242 +fi + ##-------## # UFW # ##-------## +if [ "$shortdist" = "cent8" ]; 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 +fi + sed -i '/IPV6=/c\IPV6=yes' /etc/default/ufw ufw default deny incoming > $OUTPUT 2>&1 ufw default allow outgoing > $OUTPUT 2>&1 diff --git a/CoreModules/generic/dnf.pkg.list b/CoreModules/generic/dnf.pkg.list index 0afbab6..baf282a 100644 --- a/CoreModules/generic/dnf.pkg.list +++ b/CoreModules/generic/dnf.pkg.list @@ -1 +1 @@ -cronie \ No newline at end of file +cronie policycoreutils-python-utils \ No newline at end of file diff --git a/CoreModules/generic/preconf.sh b/CoreModules/generic/preconf.sh index 0db20d1..f951b96 100644 --- a/CoreModules/generic/preconf.sh +++ b/CoreModules/generic/preconf.sh @@ -1,4 +1,3 @@ -echo "DEBUG Start preconf" if [ "$shortdist" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] || [ "$osrel" = "deb10" ] ; then ######################## # Debian/Ubunbtu # @@ -36,7 +35,6 @@ elif [ "$shortdist" = "cent8" ]; then ################ # Centos # ################ -echo "DEBUG running cent8 preconf" ##--------------## # Repositories # ##--------------##