From 67649ec407a3827fed840edcc8dfb7a10559b539 Mon Sep 17 00:00:00 2001 From: Thibault Ayanides Date: Thu, 5 Nov 2020 12:06:14 +0100 Subject: [PATCH] IMP: dismiss for count some tests on blank host --- tests/hardening/2.2.1.1_use_time_sync.sh | 2 +- tests/hardening/6.1.13_find_suid_files.sh | 2 +- tests/hardening/6.1.14_find_sgid_files.sh | 2 +- tests/hardening/99.3.2_acc_sudoers_no_all.sh | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/hardening/2.2.1.1_use_time_sync.sh b/tests/hardening/2.2.1.1_use_time_sync.sh index 4526501..a171856 100644 --- a/tests/hardening/2.2.1.1_use_time_sync.sh +++ b/tests/hardening/2.2.1.1_use_time_sync.sh @@ -4,7 +4,7 @@ test_audit() { describe Running on blank host register_test retvalshouldbe 1 - register_test contain "None of the following time sync packages are installed" + dismiss_count_for_test run blank /opt/debian-cis/bin/hardening/"${script}".sh --audit-all describe Correcting situation diff --git a/tests/hardening/6.1.13_find_suid_files.sh b/tests/hardening/6.1.13_find_suid_files.sh index 11ecdfd..c8d8844 100755 --- a/tests/hardening/6.1.13_find_suid_files.sh +++ b/tests/hardening/6.1.13_find_suid_files.sh @@ -8,7 +8,7 @@ test_audit() { describe Running on blank host register_test retvalshouldbe 0 - register_test contain "No unknown suid files found" + dismiss_count_for_test run blank /opt/debian-cis/bin/hardening/"${script}".sh --audit-all describe Tests purposely failing diff --git a/tests/hardening/6.1.14_find_sgid_files.sh b/tests/hardening/6.1.14_find_sgid_files.sh index 23cd9c3..67727bd 100755 --- a/tests/hardening/6.1.14_find_sgid_files.sh +++ b/tests/hardening/6.1.14_find_sgid_files.sh @@ -8,7 +8,7 @@ test_audit() { describe Running on blank host register_test retvalshouldbe 0 - register_test contain "No unknown sgid files found" + dismiss_count_for_test # shellcheck disable=2154 run blank /opt/debian-cis/bin/hardening/"${script}".sh --audit-all diff --git a/tests/hardening/99.3.2_acc_sudoers_no_all.sh b/tests/hardening/99.3.2_acc_sudoers_no_all.sh index 699bd26..461e9b0 100644 --- a/tests/hardening/99.3.2_acc_sudoers_no_all.sh +++ b/tests/hardening/99.3.2_acc_sudoers_no_all.sh @@ -2,6 +2,7 @@ test_audit() { describe Running on blank host register_test retvalshouldbe 0 + dismiss_count_for_test register_test contain "There is no carte-blanche sudo permission in" # shellcheck disable=2154 run blank /opt/debian-cis/bin/hardening/"${script}".sh --audit-all