From eea44e512471f78a5fad8b783b185c7dc7469375 Mon Sep 17 00:00:00 2001 From: Samson-W Date: Wed, 22 May 2019 01:36:37 +0800 Subject: [PATCH] Optimizational function for 8.3.3 8.3.6 --- bin/hardening/8.3.3_configure_syslog-ng.sh | 20 ++++++++++++++++---- bin/hardening/8.3.6_remote_syslog-ng_acl.sh | 16 ++++++++++++++-- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/bin/hardening/8.3.3_configure_syslog-ng.sh b/bin/hardening/8.3.3_configure_syslog-ng.sh index d112ef6..fbd7638 100755 --- a/bin/hardening/8.3.3_configure_syslog-ng.sh +++ b/bin/hardening/8.3.3_configure_syslog-ng.sh @@ -14,17 +14,29 @@ set -u # One variable unset, it's over HARDENING_LEVEL=3 SERVICE_NAME="syslog-ng" +PACKAGE_R='rsyslog' # This function will be called if the script status is on enabled / audit mode audit () { - info "Ensure default and local facilities are preserved on the system" - info "No measure here, please review the file by yourself" + is_pkg_installed $PACKAGE_R + if [ $FNRET = 0 ]; then + ok "$PACKAGE_R has installed, so pass." + FNRET=0 + else + info "Ensure default and local facilities are preserved on the system" + info "No measure here, please review the file by yourself" + fi } # This function will be called if the script status is on enabled mode apply () { - info "Ensure default and local facilities are preserved on the system" - info "No measure here, please review the file by yourself" + is_pkg_installed $PACKAGE_R + if [ $FNRET = 0 ]; then + ok "$PACKAGE_R has installed, so pass." + else + info "Ensure default and local facilities are preserved on the system" + info "No measure here, please review the file by yourself" + fi } # This function will check config parameters required diff --git a/bin/hardening/8.3.6_remote_syslog-ng_acl.sh b/bin/hardening/8.3.6_remote_syslog-ng_acl.sh index 57ad8b8..13b5dba 100755 --- a/bin/hardening/8.3.6_remote_syslog-ng_acl.sh +++ b/bin/hardening/8.3.6_remote_syslog-ng_acl.sh @@ -12,15 +12,27 @@ set -e # One error, it's over set -u # One variable unset, it's over HARDENING_LEVEL=3 +PACKAGE_R='rsyslog' # This function will be called if the script status is on enabled / audit mode audit () { - info "Not implemented yet" + is_pkg_installed $PACKAGE_R + if [ $FNRET = 0 ]; then + ok "$PACKAGE_R has installed, so pass." + FNRET=0 + else + info "Not implemented yet" + fi } # This function will be called if the script status is on enabled mode apply () { - info "Not implemented yet" + is_pkg_installed $PACKAGE_R + if [ $FNRET = 0 ]; then + ok "$PACKAGE_R has installed, so pass." + else + info "Not implemented yet" + fi } # This function will check config parameters required