mirror of
https://github.com/ovh/debian-cis.git
synced 2024-11-25 06:54:29 +01:00
605a768fe1
Fill tests Apply shellcheck recommendations
25 lines
784 B
Bash
25 lines
784 B
Bash
# run-shellcheck
|
|
test_audit() {
|
|
describe Running on blank host
|
|
register_test retvalshouldbe 0
|
|
# shellcheck disable=2154
|
|
run blank /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
|
|
|
|
useradd -m testhomeuser
|
|
chown root:root /home/testhomeuser
|
|
|
|
describe Wrong home owner
|
|
register_test retvalshouldbe 1
|
|
run wronghomeowner /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
|
|
|
|
echo "EXCEPTIONS=\"/home/testhomeuser:testhomeuser:root\"" >> /opt/debian-cis/etc/conf.d/"${script}".cfg
|
|
sed -i 's/audit/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg
|
|
|
|
describe Added exceptions
|
|
register_test retvalshouldbe 0
|
|
run exceptions /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
|
|
|
|
# Cleanup
|
|
userdel testhomeuser
|
|
}
|