From e109fe76c6794590fb544ad88aedacc814a72023 Mon Sep 17 00:00:00 2001 From: Samson-w Date: Sat, 17 Jun 2023 10:21:46 +0800 Subject: [PATCH] Update 2.2 2.3 2.4 7.6 for Debian12. --- bin/hardening/2.2_tmp_nodev.sh | 14 +++++++------- bin/hardening/2.3_tmp_nosuid.sh | 14 +++++++------- bin/hardening/2.4_tmp_noexec.sh | 14 +++++++------- bin/hardening/7.6_disable_wireless.sh | 4 ++-- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/bin/hardening/2.2_tmp_nodev.sh b/bin/hardening/2.2_tmp_nodev.sh index 8c499a0..022b0f9 100755 --- a/bin/hardening/2.2_tmp_nodev.sh +++ b/bin/hardening/2.2_tmp_nodev.sh @@ -1,7 +1,7 @@ #!/bin/bash # -# harbian-audit for Debian GNU/Linux Debian 7/8/9 or CentOS Hardening +# harbian-audit for Debian GNU/Linux Debian 7/8/9/10/11/12 or CentOS Hardening # Modify by: Samson-W (sccxboy@gmail.com) # @@ -47,10 +47,10 @@ audit () { fi else warn "$PARTITION is not partition in /etc/fstab, check tmp.mount service" - if [ $OS_RELEASE -eq 1 ]; then + if [ $OS_RELEASE -eq 2 ]; then + UNITSERVICEPATH=$CENTOS_SERVICEPATHa + else UNITSERVICEPATH=$DEBIAN_SERVICEPATH - elif [ $OS_RELEASE -eq 2 ]; then - UNITSERVICEPATH=$CENTOS_SERVICEPATH fi if [ -e $UNITSERVICEPATH ]; then has_mount_option_systemd $UNITSERVICEPATH $OPTION @@ -77,10 +77,10 @@ audit () { # This function will be called if the script status is on enabled mode apply () { - if [ $OS_RELEASE -eq 1 ]; then - UNITSERVICEPATH=$DEBIAN_SERVICEPATH - elif [ $OS_RELEASE -eq 2 ]; then + if [ $OS_RELEASE -eq 2 ]; then UNITSERVICEPATH=$CENTOS_SERVICEPATH + else + UNITSERVICEPATH=$DEBIAN_SERVICEPATH fi if [ $FNRET = 0 ]; then ok "$PARTITION is correctly set" diff --git a/bin/hardening/2.3_tmp_nosuid.sh b/bin/hardening/2.3_tmp_nosuid.sh index b55bb8b..7edc43d 100755 --- a/bin/hardening/2.3_tmp_nosuid.sh +++ b/bin/hardening/2.3_tmp_nosuid.sh @@ -1,7 +1,7 @@ #!/bin/bash # -# harbian-audit for Debian GNU/Linux Debian 7/8/9/10 or CentOS Hardening +# harbian-audit for Debian GNU/Linux Debian 7/8/9/10/11/12 or CentOS Hardening # Modify by: Samson-W (sccxboy@gmail.com) # @@ -47,10 +47,10 @@ audit () { fi else warn "$PARTITION is not partition in /etc/fstab, check tmp.mount service" - if [ $OS_RELEASE -eq 1 ]; then - UNITSERVICEPATH=$DEBIAN_SERVICEPATH - elif [ $OS_RELEASE -eq 2 ]; then + if [ $OS_RELEASE -eq 2 ]; then UNITSERVICEPATH=$CENTOS_SERVICEPATH + else + UNITSERVICEPATH=$DEBIAN_SERVICEPATH fi if [ -e $UNITSERVICEPATH ]; then has_mount_option_systemd $UNITSERVICEPATH $OPTION @@ -77,10 +77,10 @@ audit () { # This function will be called if the script status is on enabled mode apply () { - if [ $OS_RELEASE -eq 1 ]; then - UNITSERVICEPATH=$DEBIAN_SERVICEPATH - elif [ $OS_RELEASE -eq 2 ]; then + if [ $OS_RELEASE -eq 2 ]; then UNITSERVICEPATH=$CENTOS_SERVICEPATH + else + UNITSERVICEPATH=$DEBIAN_SERVICEPATH fi if [ $FNRET = 0 ]; then ok "$PARTITION is correctly set" diff --git a/bin/hardening/2.4_tmp_noexec.sh b/bin/hardening/2.4_tmp_noexec.sh index cd4f926..ada8015 100755 --- a/bin/hardening/2.4_tmp_noexec.sh +++ b/bin/hardening/2.4_tmp_noexec.sh @@ -1,7 +1,7 @@ #!/bin/bash # -# harbian-audit for Debian GNU/Linux Debian 7/8/9/10 or CentOS Hardening +# harbian-audit for Debian GNU/Linux Debian 7/8/9/10/11/12 or CentOS Hardening # Modify by: Samson-W (sccxboy@gmail.com) # @@ -47,10 +47,10 @@ audit () { fi else warn "$PARTITION is not partition in /etc/fstab, check tmp.mount service" - if [ $OS_RELEASE -eq 1 ]; then - UNITSERVICEPATH=$DEBIAN_SERVICEPATH - elif [ $OS_RELEASE -eq 2 ]; then + if [ $OS_RELEASE -eq 2 ]; then UNITSERVICEPATH=$CENTOS_SERVICEPATH + else + UNITSERVICEPATH=$DEBIAN_SERVICEPATH fi if [ -e $UNITSERVICEPATH ]; then has_mount_option_systemd $UNITSERVICEPATH $OPTION @@ -77,10 +77,10 @@ audit () { # This function will be called if the script status is on enabled mode apply () { - if [ $OS_RELEASE -eq 1 ]; then - UNITSERVICEPATH=$DEBIAN_SERVICEPATH - elif [ $OS_RELEASE -eq 2 ]; then + if [ $OS_RELEASE -eq 2 ]; then UNITSERVICEPATH=$CENTOS_SERVICEPATH + else + UNITSERVICEPATH=$DEBIAN_SERVICEPATH fi if [ $FNRET = 0 ]; then ok "$PARTITION is correctly set" diff --git a/bin/hardening/7.6_disable_wireless.sh b/bin/hardening/7.6_disable_wireless.sh index 9cbad44..459d93e 100755 --- a/bin/hardening/7.6_disable_wireless.sh +++ b/bin/hardening/7.6_disable_wireless.sh @@ -1,7 +1,7 @@ #!/bin/bash # -# harbian-audit for Debian GNU/Linux 9 or CentOS Hardening +# harbian-audit for Debian GNU/Linux 9/10/11/12 or CentOS Hardening # # @@ -17,7 +17,7 @@ HARDENING_LEVEL=3 # This function will be called if the script status is on enabled / audit mode audit () { if [ $(lspci | grep -ic wireless ) -eq 0 ]; then - info "The OS is not wireless device! " + ok "The OS is not wireless device! " FNRET=0 else if [ $(wc -l /proc/net/wireless) -lt 3 ]; then