FIX(tests): change sed in conf file disabled->audit following d6172ad

In test cases, changed in sed command "disabled" to "audit" to enable
apply part, following this commit
d6172ad Change default status disabled -> audit when no conf file

 5f28036 - Change default status to audit for file with custom
  `create_config` (Charles Herlin Thu Feb 14 14:33:21 2019 +0100)
This commit is contained in:
Charles Herlin 2019-02-15 17:42:17 +01:00
parent 6cbe8f572f
commit cf42666833
13 changed files with 14 additions and 13 deletions

View File

@ -15,7 +15,7 @@ test_audit() {
run noncompliant /opt/debian-cis/bin/hardening/"${script}".sh --audit-all run noncompliant /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
describe correcting situation describe correcting situation
sed -i 's/disabled/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg sed -i 's/audit/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg
/opt/debian-cis/bin/hardening/"${script}".sh --apply || true /opt/debian-cis/bin/hardening/"${script}".sh --apply || true
describe Checking resolved state describe Checking resolved state

View File

@ -15,7 +15,7 @@ test_audit() {
run noncompliant /opt/debian-cis/bin/hardening/"${script}".sh --audit-all run noncompliant /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
describe correcting situation describe correcting situation
sed -i 's/disabled/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg sed -i 's/audit/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg
/opt/debian-cis/bin/hardening/"${script}".sh || true /opt/debian-cis/bin/hardening/"${script}".sh || true
describe Checking resolved state describe Checking resolved state

View File

@ -15,7 +15,7 @@ test_audit() {
run noncompliant /opt/debian-cis/bin/hardening/"${script}".sh --audit-all run noncompliant /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
describe correcting situation describe correcting situation
sed -i 's/disabled/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg sed -i 's/audit/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg
/opt/debian-cis/bin/hardening/"${script}".sh --apply || true /opt/debian-cis/bin/hardening/"${script}".sh --apply || true
describe Checking resolved state describe Checking resolved state

View File

@ -15,7 +15,8 @@ test_audit() {
run noncompliant /opt/debian-cis/bin/hardening/"${script}".sh --audit-all run noncompliant /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
describe correcting situation describe correcting situation
sed -i 's/disabled/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg sed -i 's/audit/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg
cat /opt/debian-cis/etc/conf.d/"${script}".cfg
/opt/debian-cis/bin/hardening/"${script}".sh --apply || true /opt/debian-cis/bin/hardening/"${script}".sh --apply || true
describe Checking resolved state describe Checking resolved state

View File

@ -11,7 +11,7 @@ test_audit() {
# the service needs to be started for the reload to succeed # the service needs to be started for the reload to succeed
service ssh start service ssh start
# if the audit script provides "apply" option, enable and run it # if the audit script provides "apply" option, enable and run it
sed -i 's/disabled/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg sed -i 's/audit/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg
/opt/debian-cis/bin/hardening/"${script}".sh || true /opt/debian-cis/bin/hardening/"${script}".sh || true
describe Checking resolved state describe Checking resolved state

View File

@ -11,7 +11,7 @@ test_audit() {
# the service needs to be started for the reload to succeed # the service needs to be started for the reload to succeed
service ssh start service ssh start
# if the audit script provides "apply" option, enable and run it # if the audit script provides "apply" option, enable and run it
sed -i 's/disabled/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg sed -i 's/audit/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg
/opt/debian-cis/bin/hardening/"${script}".sh || true /opt/debian-cis/bin/hardening/"${script}".sh || true
cp -a /etc/ssh/sshd_config /tmp/sshd_config.bak cp -a /etc/ssh/sshd_config /tmp/sshd_config.bak

View File

@ -11,7 +11,7 @@ test_audit() {
# the service needs to be started for the reload to succeed # the service needs to be started for the reload to succeed
service ssh start service ssh start
# if the audit script provides "apply" option, enable and run it # if the audit script provides "apply" option, enable and run it
sed -i 's/disabled/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg sed -i 's/audit/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg
/opt/debian-cis/bin/hardening/"${script}".sh || true /opt/debian-cis/bin/hardening/"${script}".sh || true
describe Checking resolved state describe Checking resolved state

View File

@ -11,7 +11,7 @@ test_audit() {
# the service needs to be started for the reload to succeed # the service needs to be started for the reload to succeed
service ssh start service ssh start
# if the audit script provides "apply" option, enable and run it # if the audit script provides "apply" option, enable and run it
sed -i 's/disabled/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg sed -i 's/audit/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg
/opt/debian-cis/bin/hardening/"${script}".sh || true /opt/debian-cis/bin/hardening/"${script}".sh || true
describe Checking resolved state describe Checking resolved state

View File

@ -11,7 +11,7 @@ test_audit() {
# the service needs to be started for the reload to succeed # the service needs to be started for the reload to succeed
service ssh start service ssh start
# if the audit script provides "apply" option, enable and run it # if the audit script provides "apply" option, enable and run it
sed -i 's/disabled/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg sed -i 's/audit/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg
/opt/debian-cis/bin/hardening/"${script}".sh || true /opt/debian-cis/bin/hardening/"${script}".sh || true
describe Checking resolved state describe Checking resolved state

View File

@ -12,7 +12,7 @@ test_audit() {
# the service needs to be started for the reload to succeed # the service needs to be started for the reload to succeed
service ssh start service ssh start
# if the audit script provides "apply" option, enable and run it # if the audit script provides "apply" option, enable and run it
sed -i 's/disabled/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg sed -i 's/audit/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg
/opt/debian-cis/bin/hardening/"${script}".sh || true /opt/debian-cis/bin/hardening/"${script}".sh || true
describe Checking resolved state describe Checking resolved state

View File

@ -19,7 +19,7 @@ test_audit() {
# the service needs to be started for the reload to succeed # the service needs to be started for the reload to succeed
service ssh start service ssh start
# if the audit script provides "apply" option, enable and run it # if the audit script provides "apply" option, enable and run it
sed -i 's/disabled/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg sed -i 's/audit/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg
/opt/debian-cis/bin/hardening/"${script}".sh || true /opt/debian-cis/bin/hardening/"${script}".sh || true
describe Checking resolved state describe Checking resolved state

View File

@ -11,7 +11,7 @@ test_audit() {
# the service needs to be started for the reload to succeed # the service needs to be started for the reload to succeed
service ssh start service ssh start
# if the audit script provides "apply" option, enable and run it # if the audit script provides "apply" option, enable and run it
sed -i 's/disabled/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg sed -i 's/audit/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg
/opt/debian-cis/bin/hardening/"${script}".sh || true /opt/debian-cis/bin/hardening/"${script}".sh || true
describe Checking resolved state describe Checking resolved state

View File

@ -11,7 +11,7 @@ test_audit() {
# the service needs to be started for the reload to succeed # the service needs to be started for the reload to succeed
service ssh start service ssh start
# if the audit script provides "apply" option, enable and run it # if the audit script provides "apply" option, enable and run it
sed -i 's/disabled/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg sed -i 's/audit/enabled/' /opt/debian-cis/etc/conf.d/"${script}".cfg
/opt/debian-cis/bin/hardening/"${script}".sh || true /opt/debian-cis/bin/hardening/"${script}".sh || true
describe Checking resolved state describe Checking resolved state