mirror of
https://github.com/ovh/debian-cis.git
synced 2024-11-26 07:21:22 +01:00
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 commitd6172ad
Change default status disabled -> audit when no conf file5f28036
- 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:
parent
ef38a4cb3d
commit
81f934879e
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user