mirror of
https://github.com/ovh/debian-cis.git
synced 2025-07-15 21:32:17 +02:00

- 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"
22 lines
699 B
Bash
22 lines
699 B
Bash
# shellcheck shell=bash
|
|
# run-shellcheck
|
|
test_audit() {
|
|
describe Prepare failing test
|
|
apt remove -y auditd
|
|
|
|
describe Running on blank host
|
|
register_test retvalshouldbe 1
|
|
# shellcheck disable=2154
|
|
run blank "${CIS_CHECKS_DIR}/${script}.sh" --audit-all
|
|
|
|
describe Correcting situation
|
|
sed -i 's/audit/enabled/' "${CIS_CONF_DIR}/conf.d/${script}.cfg"
|
|
"${CIS_CHECKS_DIR}/${script}.sh" || true
|
|
|
|
describe Checking resolved state
|
|
# 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
|
|
}
|