2019-02-14 18:10:46 +01:00
|
|
|
# run-shellcheck
|
|
|
|
test_audit() {
|
2019-08-28 12:30:13 +02:00
|
|
|
cp -a /etc/passwd /tmp/passwd.bak
|
|
|
|
|
2019-02-14 18:10:46 +01:00
|
|
|
describe Running on blank host
|
2019-08-28 11:47:49 +02:00
|
|
|
register_test retvalshouldbe 1
|
2019-02-14 18:10:46 +01:00
|
|
|
# shellcheck disable=2154
|
|
|
|
run blank /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
|
|
|
|
|
2019-08-28 11:47:49 +02:00
|
|
|
describe correcting situation
|
|
|
|
sed -i 's/audit/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg
|
|
|
|
/opt/debian-cis/bin/hardening/"${script}".sh --apply || true
|
|
|
|
|
|
|
|
describe Checking resolved state
|
|
|
|
register_test retvalshouldbe 0
|
|
|
|
run resolved /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
|
2019-08-28 12:30:13 +02:00
|
|
|
|
|
|
|
mv /tmp/passwd.bak /etc/passwd
|
2019-02-14 18:10:46 +01:00
|
|
|
}
|