Skip to content

Commit 81ce2ab

Browse files
authored
Merge pull request #172 from dev-sec/protected_fifos
fix handling of sysctl fs.protected_fifos and fs.protected_regular
2 parents 34b215b + 5247b07 commit 81ce2ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

controls/sysctl_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,13 +414,13 @@
414414
desc 'Protects against common exploits in regards to links, fifos and regular files created or controlled by attackers'
415415
only_if { !container_execution }
416416
describe kernel_parameter('fs.protected_fifos') do
417-
its(:value) { should match cmp(/(1|2)/) }
417+
its(:value) { should eq(1).or eq(2).or eq(nil) } # include nil because RHEL7 does not have this parameter
418418
end
419419
describe kernel_parameter('fs.protected_hardlinks') do
420420
its(:value) { should eq 1 }
421421
end
422422
describe kernel_parameter('fs.protected_regular') do
423-
its(:value) { should eq 2 }
423+
its(:value) { should eq(2).or eq(nil) } # include nil because RHEL7 does not have this parameter
424424
end
425425
describe kernel_parameter('fs.protected_symlinks') do
426426
its(:value) { should eq 1 }

0 commit comments

Comments
 (0)