diff --git a/controls/1_4_secure_boot_settings.rb b/controls/1_4_secure_boot_settings.rb index 6350344..407cc71 100644 --- a/controls/1_4_secure_boot_settings.rb +++ b/controls/1_4_secure_boot_settings.rb @@ -30,6 +30,7 @@ describe.one do grub_conf.locations.each do |f| describe file(f) do + next unless file(f).exist? it { should exist } it { should_not be_readable.by 'group' } it { should_not be_writable.by 'group' } @@ -55,6 +56,7 @@ describe.one do grub_conf.locations.each do |f| describe file(f) do + next unless file(f).exist? its(:content) { should match(/^set superusers/) } its(:content) { should match(/^password/) } end diff --git a/controls/1_6_mandatory_access_control.rb b/controls/1_6_mandatory_access_control.rb index b705739..d3ac5ca 100644 --- a/controls/1_6_mandatory_access_control.rb +++ b/controls/1_6_mandatory_access_control.rb @@ -166,6 +166,7 @@ describe.one do grub_conf.locations.each do |f| describe file(f) do + next unless file(f).exist? its('content') { should_not match /apparmor=0/ } end end diff --git a/controls/4_1_configure_system_accounting_auditd.rb b/controls/4_1_configure_system_accounting_auditd.rb index b830d1d..4b74b9e 100644 --- a/controls/4_1_configure_system_accounting_auditd.rb +++ b/controls/4_1_configure_system_accounting_auditd.rb @@ -127,6 +127,7 @@ describe.one do grub_conf.locations.each do |f| describe file(f) do + next unless file(f).exist? its('content') { should match(/audit=1/) } end end