From 7eb3f188f508a01dacd5d7b44810cdcf03122d49 Mon Sep 17 00:00:00 2001 From: Samson-W Date: Thu, 5 Nov 2020 02:47:53 +0800 Subject: [PATCH] Optimize the error message for sshd configuration relate. --- bin/hardening/9.3.10_disable_sshd_setenv.sh | 2 +- bin/hardening/9.3.14_ssh_banner.sh | 2 +- bin/hardening/9.3.15_sshd_printlastlog.sh | 2 +- bin/hardening/9.3.16_sshd_IgnoreUserKnownHosts.sh | 2 +- bin/hardening/9.3.17_sshd_GSSAPIAuthentication.sh | 2 +- bin/hardening/9.3.18_sshd_KerberosAuthentication.sh | 2 +- bin/hardening/9.3.19_sshd_StrictModes.sh | 2 +- bin/hardening/9.3.20_sshd_compression.sh | 2 +- bin/hardening/9.3.25_sshd_logingracetime.sh | 2 +- bin/hardening/9.3.2_sshd_loglevel.sh | 2 +- bin/hardening/9.3.4_disable_x11_forwarding.sh | 2 +- bin/hardening/9.3.5_sshd_maxauthtries.sh | 2 +- bin/hardening/9.3.6_enable_sshd_ignorerhosts.sh | 2 +- bin/hardening/9.3.7_disable_sshd_hostbasedauthentication.sh | 2 +- bin/hardening/9.3.8_disable_root_login.sh | 2 +- bin/hardening/9.3.9_disable_sshd_permitemptypasswords.sh | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/bin/hardening/9.3.10_disable_sshd_setenv.sh b/bin/hardening/9.3.10_disable_sshd_setenv.sh index 142c7b9..2e55353 100755 --- a/bin/hardening/9.3.10_disable_sshd_setenv.sh +++ b/bin/hardening/9.3.10_disable_sshd_setenv.sh @@ -32,7 +32,7 @@ audit () { ok "The value of keyword $SSH_PARAM has set to $SSH_VALUE, it's correct." FNRET=0 else - crit "The keyword $SSH_PARAM does not exist in the sshd runtime configuration." + crit "The keyword value pair "\"$SSH_PARAM $SSH_VALUE\"" does not exist in the sshd runtime configuration." PATTERN="^$SSH_PARAM[[:space:]]*" PATTERN_INFO="$SSH_PARAM $SSH_VALUE" does_pattern_exist_in_file $FILE "$PATTERN" diff --git a/bin/hardening/9.3.14_ssh_banner.sh b/bin/hardening/9.3.14_ssh_banner.sh index e6e1a91..acf0cac 100755 --- a/bin/hardening/9.3.14_ssh_banner.sh +++ b/bin/hardening/9.3.14_ssh_banner.sh @@ -32,7 +32,7 @@ audit () { ok "The value of keyword $SSH_PARAM has set to $SSH_VALUE, it's correct." FNRET=0 else - crit "The keyword $SSH_PARAM does not exist in the sshd runtime configuration." + crit "The keyword value pair "\"$SSH_PARAM $SSH_VALUE\"" does not exist in the sshd runtime configuration." PATTERN="^$SSH_PARAM[[:space:]]*" PATTERN_INFO="$SSH_PARAM $SSH_VALUE" does_pattern_exist_in_file $FILE "$PATTERN" diff --git a/bin/hardening/9.3.15_sshd_printlastlog.sh b/bin/hardening/9.3.15_sshd_printlastlog.sh index d95d018..8303655 100755 --- a/bin/hardening/9.3.15_sshd_printlastlog.sh +++ b/bin/hardening/9.3.15_sshd_printlastlog.sh @@ -33,7 +33,7 @@ audit () { ok "The value of keyword $SSH_PARAM has set to $SSH_VALUE, it's correct." FNRET=0 else - crit "The keyword $SSH_PARAM does not exist in the sshd runtime configuration." + crit "The keyword value pair "\"$SSH_PARAM $SSH_VALUE\"" does not exist in the sshd runtime configuration." PATTERN="^$SSH_PARAM[[:space:]]*" PATTERN_INFO="$SSH_PARAM $SSH_VALUE" does_pattern_exist_in_file $FILE "$PATTERN" diff --git a/bin/hardening/9.3.16_sshd_IgnoreUserKnownHosts.sh b/bin/hardening/9.3.16_sshd_IgnoreUserKnownHosts.sh index b0ec740..4e39bbd 100755 --- a/bin/hardening/9.3.16_sshd_IgnoreUserKnownHosts.sh +++ b/bin/hardening/9.3.16_sshd_IgnoreUserKnownHosts.sh @@ -33,7 +33,7 @@ audit () { ok "The value of keyword $SSH_PARAM has set to $SSH_VALUE, it's correct." FNRET=0 else - crit "The keyword $SSH_PARAM does not exist in the sshd runtime configuration." + crit "The keyword value pair "\"$SSH_PARAM $SSH_VALUE\"" does not exist in the sshd runtime configuration." PATTERN="^$SSH_PARAM[[:space:]]*" PATTERN_INFO="$SSH_PARAM $SSH_VALUE" does_pattern_exist_in_file $FILE "$PATTERN" diff --git a/bin/hardening/9.3.17_sshd_GSSAPIAuthentication.sh b/bin/hardening/9.3.17_sshd_GSSAPIAuthentication.sh index 9e4374a..3d24c0b 100755 --- a/bin/hardening/9.3.17_sshd_GSSAPIAuthentication.sh +++ b/bin/hardening/9.3.17_sshd_GSSAPIAuthentication.sh @@ -33,7 +33,7 @@ audit () { ok "The value of keyword $SSH_PARAM has set to $SSH_VALUE, it's correct." FNRET=0 else - crit "The keyword $SSH_PARAM does not exist in the sshd runtime configuration." + crit "The keyword value pair "\"$SSH_PARAM $SSH_VALUE\"" does not exist in the sshd runtime configuration." PATTERN="^$SSH_PARAM[[:space:]]*" PATTERN_INFO="$SSH_PARAM $SSH_VALUE" does_pattern_exist_in_file $FILE "$PATTERN" diff --git a/bin/hardening/9.3.18_sshd_KerberosAuthentication.sh b/bin/hardening/9.3.18_sshd_KerberosAuthentication.sh index e09d861..3e45f0e 100755 --- a/bin/hardening/9.3.18_sshd_KerberosAuthentication.sh +++ b/bin/hardening/9.3.18_sshd_KerberosAuthentication.sh @@ -33,7 +33,7 @@ audit () { ok "The value of keyword $SSH_PARAM has set to $SSH_VALUE, it's correct." FNRET=0 else - crit "The keyword $SSH_PARAM does not exist in the sshd runtime configuration." + crit "The keyword value pair "\"$SSH_PARAM $SSH_VALUE\"" does not exist in the sshd runtime configuration." PATTERN="^$SSH_PARAM[[:space:]]*" PATTERN_INFO="$SSH_PARAM $SSH_VALUE" does_pattern_exist_in_file $FILE "$PATTERN" diff --git a/bin/hardening/9.3.19_sshd_StrictModes.sh b/bin/hardening/9.3.19_sshd_StrictModes.sh index f6cce5c..f10df26 100755 --- a/bin/hardening/9.3.19_sshd_StrictModes.sh +++ b/bin/hardening/9.3.19_sshd_StrictModes.sh @@ -33,7 +33,7 @@ audit () { ok "The value of keyword $SSH_PARAM has set to $SSH_VALUE, it's correct." FNRET=0 else - crit "The keyword $SSH_PARAM does not exist in the sshd runtime configuration." + crit "The keyword value pair "\"$SSH_PARAM $SSH_VALUE\"" does not exist in the sshd runtime configuration." PATTERN="^$SSH_PARAM[[:space:]]*" PATTERN_INFO="$SSH_PARAM $SSH_VALUE" does_pattern_exist_in_file $FILE "$PATTERN" diff --git a/bin/hardening/9.3.20_sshd_compression.sh b/bin/hardening/9.3.20_sshd_compression.sh index 87b8abe..6a23fd4 100755 --- a/bin/hardening/9.3.20_sshd_compression.sh +++ b/bin/hardening/9.3.20_sshd_compression.sh @@ -33,7 +33,7 @@ audit () { ok "The value of keyword $SSH_PARAM has set to $SSH_VALUE, it's correct." FNRET=0 else - crit "The keyword $SSH_PARAM does not exist in the sshd runtime configuration." + crit "The keyword value pair "\"$SSH_PARAM $SSH_VALUE\"" does not exist in the sshd runtime configuration." PATTERN="^$SSH_PARAM[[:space:]]*" PATTERN_INFO="$SSH_PARAM $SSH_VALUE" does_pattern_exist_in_file $FILE "$PATTERN" diff --git a/bin/hardening/9.3.25_sshd_logingracetime.sh b/bin/hardening/9.3.25_sshd_logingracetime.sh index 77ede6f..0b87e06 100755 --- a/bin/hardening/9.3.25_sshd_logingracetime.sh +++ b/bin/hardening/9.3.25_sshd_logingracetime.sh @@ -33,7 +33,7 @@ audit () { ok "The value of keyword $SSH_PARAM has set to $SSH_VALUE, it's correct." FNRET=0 else - crit "The keyword $SSH_PARAM does not exist in the sshd runtime configuration." + crit "The keyword value pair "\"$SSH_PARAM $SSH_VALUE\"" does not exist in the sshd runtime configuration." PATTERN="^$SSH_PARAM[[:space:]]*" PATTERN_INFO="$SSH_PARAM $SSH_VALUE" does_pattern_exist_in_file $FILE "$PATTERN" diff --git a/bin/hardening/9.3.2_sshd_loglevel.sh b/bin/hardening/9.3.2_sshd_loglevel.sh index da7d379..27691b2 100755 --- a/bin/hardening/9.3.2_sshd_loglevel.sh +++ b/bin/hardening/9.3.2_sshd_loglevel.sh @@ -32,7 +32,7 @@ audit () { ok "The value of keyword $SSH_PARAM has set to $SSH_VALUE, it's correct." FNRET=0 else - crit "The keyword $SSH_PARAM does not exist in the sshd runtime configuration." + crit "The keyword value pair "\"$SSH_PARAM $SSH_VALUE\"" does not exist in the sshd runtime configuration." PATTERN="^$SSH_PARAM[[:space:]]*" PATTERN_INFO="$SSH_PARAM $SSH_VALUE" does_pattern_exist_in_file $FILE "$PATTERN" diff --git a/bin/hardening/9.3.4_disable_x11_forwarding.sh b/bin/hardening/9.3.4_disable_x11_forwarding.sh index 77ca6ed..4cd1d40 100755 --- a/bin/hardening/9.3.4_disable_x11_forwarding.sh +++ b/bin/hardening/9.3.4_disable_x11_forwarding.sh @@ -32,7 +32,7 @@ audit () { ok "The value of keyword $SSH_PARAM has set to $SSH_VALUE, it's correct." FNRET=0 else - crit "The keyword $SSH_PARAM does not exist in the sshd runtime configuration." + crit "The keyword value pair "\"$SSH_PARAM $SSH_VALUE\"" does not exist in the sshd runtime configuration." PATTERN="^$SSH_PARAM[[:space:]]*" PATTERN_INFO="$SSH_PARAM $SSH_VALUE" does_pattern_exist_in_file $FILE "$PATTERN" diff --git a/bin/hardening/9.3.5_sshd_maxauthtries.sh b/bin/hardening/9.3.5_sshd_maxauthtries.sh index 38c6dde..570c7b3 100755 --- a/bin/hardening/9.3.5_sshd_maxauthtries.sh +++ b/bin/hardening/9.3.5_sshd_maxauthtries.sh @@ -32,7 +32,7 @@ audit () { ok "The value of keyword $SSH_PARAM has set to $SSH_VALUE, it's correct." FNRET=0 else - crit "The keyword $SSH_PARAM does not exist in the sshd runtime configuration." + crit "The keyword value pair "\"$SSH_PARAM $SSH_VALUE\"" does not exist in the sshd runtime configuration." PATTERN="^$SSH_PARAM[[:space:]]*" PATTERN_INFO="$SSH_PARAM $SSH_VALUE" does_pattern_exist_in_file $FILE "$PATTERN" diff --git a/bin/hardening/9.3.6_enable_sshd_ignorerhosts.sh b/bin/hardening/9.3.6_enable_sshd_ignorerhosts.sh index 51824a7..0fc2aff 100755 --- a/bin/hardening/9.3.6_enable_sshd_ignorerhosts.sh +++ b/bin/hardening/9.3.6_enable_sshd_ignorerhosts.sh @@ -32,7 +32,7 @@ audit () { ok "The value of keyword $SSH_PARAM has set to $SSH_VALUE, it's correct." FNRET=0 else - crit "The keyword $SSH_PARAM does not exist in the sshd runtime configuration." + crit "The keyword value pair "\"$SSH_PARAM $SSH_VALUE\"" does not exist in the sshd runtime configuration." PATTERN="^$SSH_PARAM[[:space:]]*" PATTERN_INFO="$SSH_PARAM $SSH_VALUE" does_pattern_exist_in_file $FILE "$PATTERN" diff --git a/bin/hardening/9.3.7_disable_sshd_hostbasedauthentication.sh b/bin/hardening/9.3.7_disable_sshd_hostbasedauthentication.sh index c7cfa83..74e653c 100755 --- a/bin/hardening/9.3.7_disable_sshd_hostbasedauthentication.sh +++ b/bin/hardening/9.3.7_disable_sshd_hostbasedauthentication.sh @@ -32,7 +32,7 @@ audit () { ok "The value of keyword $SSH_PARAM has set to $SSH_VALUE, it's correct." FNRET=0 else - crit "The keyword $SSH_PARAM does not exist in the sshd runtime configuration." + crit "The keyword value pair "\"$SSH_PARAM $SSH_VALUE\"" does not exist in the sshd runtime configuration." PATTERN="^$SSH_PARAM[[:space:]]*" PATTERN_INFO="$SSH_PARAM $SSH_VALUE" does_pattern_exist_in_file $FILE "$PATTERN" diff --git a/bin/hardening/9.3.8_disable_root_login.sh b/bin/hardening/9.3.8_disable_root_login.sh index 967ce03..da2ee71 100755 --- a/bin/hardening/9.3.8_disable_root_login.sh +++ b/bin/hardening/9.3.8_disable_root_login.sh @@ -32,7 +32,7 @@ audit () { ok "The value of keyword $SSH_PARAM has set to $SSH_VALUE, it's correct." FNRET=0 else - crit "The keyword $SSH_PARAM does not exist in the sshd runtime configuration." + crit "The keyword value pair "\"$SSH_PARAM $SSH_VALUE\"" does not exist in the sshd runtime configuration." PATTERN="^$SSH_PARAM[[:space:]]*" PATTERN_INFO="$SSH_PARAM $SSH_VALUE" does_pattern_exist_in_file $FILE "$PATTERN" diff --git a/bin/hardening/9.3.9_disable_sshd_permitemptypasswords.sh b/bin/hardening/9.3.9_disable_sshd_permitemptypasswords.sh index 3c4b070..07e0b13 100755 --- a/bin/hardening/9.3.9_disable_sshd_permitemptypasswords.sh +++ b/bin/hardening/9.3.9_disable_sshd_permitemptypasswords.sh @@ -32,7 +32,7 @@ audit () { ok "The value of keyword $SSH_PARAM has set to $SSH_VALUE, it's correct." FNRET=0 else - crit "The keyword $SSH_PARAM does not exist in the sshd runtime configuration." + crit "The keyword value pair "\"$SSH_PARAM $SSH_VALUE\"" does not exist in the sshd runtime configuration." PATTERN="^$SSH_PARAM[[:space:]]*" PATTERN_INFO="$SSH_PARAM $SSH_VALUE" does_pattern_exist_in_file $FILE "$PATTERN"