mirror of
https://github.com/ovh/debian-cis.git
synced 2025-08-11 09:54:27 +02:00
Damcava35/update lib (#277)
* update lib/utils.sh - add 'is_pkg_a_dependency', to ensure a package is not needed by some others before removing it -> will be used in debian 12 CIS by at least the 2.1.5 recommendation - update 'is_service_enabled' to use 'systemd' instead of 'rc.d', as we are now only supporting debian LTS using systemd - add 'is_using_sbin_init' to ensure we can use systemctl, in case of running on non detected container - add 'manage_service' to enable / disable service using systemctl * chore: update script related to systemctl / service - configure_systemd-timesync.sh: use "is_service_enabled" instead of calling systemctl - disable_automounting.sh: use "manage_service" instead of "update-rc.d" - enable_auditd.sh: use "manage_service" instead of "update-rc.d" - enable_cron.sh: use "manage_service" instead of "update-rc.d" - enable_syslog-ng.sh: use "manage_service" instead of "update-rc.d" --------- Co-authored-by: Damien Cavagnini <damien.cavagnini@corp.ovh.com>
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
# shellcheck shell=bash
|
||||
# run-shellcheck
|
||||
test_audit() {
|
||||
describe Prepare failing test
|
||||
apt remove -y auditd
|
||||
|
||||
describe Running on blank host
|
||||
register_test retvalshouldbe 0
|
||||
dismiss_count_for_test
|
||||
register_test retvalshouldbe 1
|
||||
# shellcheck disable=2154
|
||||
run blank "${CIS_CHECKS_DIR}/${script}.sh" --audit-all
|
||||
|
||||
@@ -12,7 +14,8 @@ test_audit() {
|
||||
"${CIS_CHECKS_DIR}/${script}.sh" || true
|
||||
|
||||
describe Checking resolved state
|
||||
register_test retvalshouldbe 0
|
||||
register_test contain "[ OK ] auditd is enabled"
|
||||
# service still wont be enabled due to tests running inside a docker container
|
||||
register_test retvalshouldbe 1
|
||||
register_test contain "[ OK ] auditd is installed"
|
||||
run resolved "${CIS_CHECKS_DIR}/${script}.sh" --audit-all
|
||||
}
|
||||
|
Reference in New Issue
Block a user