Skip to content

Commit 00d24ba

Browse files
authored
added sysctl-34 for checking link protection settings (#160)
Common and long-standing exploits regard unprotected links, fifos and regular files, which are created or controlled by an attacker to gain access to other files or control over other programs. Signed-off-by: Claudius Heine <[email protected]>
1 parent 2735730 commit 00d24ba

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

controls/sysctl_spec.rb

+19
Original file line numberDiff line numberDiff line change
@@ -407,3 +407,22 @@
407407
end
408408
end
409409
end
410+
411+
control 'sysctl-34' do
412+
impact 1.0
413+
title 'Ensure links are protected'
414+
desc 'Protects against common exploits in regards to links, fifos and regular files created or controlled by attackers'
415+
only_if { !container_execution }
416+
describe kernel_parameter('fs.protected_fifos') do
417+
its(:value) { should match cmp(/(1|2)/) }
418+
end
419+
describe kernel_parameter('fs.protected_hardlinks') do
420+
its(:value) { should eq 1 }
421+
end
422+
describe kernel_parameter('fs.protected_regular') do
423+
its(:value) { should eq 2 }
424+
end
425+
describe kernel_parameter('fs.protected_symlinks') do
426+
its(:value) { should eq 1 }
427+
end
428+
end

0 commit comments

Comments
 (0)