Skip to content

Commit

Permalink
another slow control
Browse files Browse the repository at this point in the history
Signed-off-by: wdower <57142072+wdower@users.noreply.github.com>
  • Loading branch information
wdower committed Jul 11, 2024
1 parent c8bb212 commit f0c6338
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions controls/SV-230319.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,22 @@
tag 'host'
tag 'container'

partitions = etc_fstab.params.map { |partition| partition['mount_point'] }.uniq

cmd = "find #{partitions.join(' ')} -xdev -type d -perm -0002 -gid +999 -print"
failing_dirs = command(cmd).stdout.split("\n").uniq
if input('disable_slow_controls')
describe 'This control consistently takes a long to run and has been disabled using the disable_slow_controls attribute.' do
skip 'This control consistently takes a long to run and has been disabled using the disable_slow_controls attribute. You must enable this control for a full accredidation for production.'
end
else

partitions = etc_fstab.params.map { |partition| partition['mount_point'] }.uniq

cmd = "find #{partitions.join(' ')} -xdev -type d -perm -0002 -gid +999 -print"
failing_dirs = command(cmd).stdout.split("\n").uniq

describe 'Any world-writeable directories' do
it 'should be group-owned by system accounts' do
expect(failing_dirs).to be_empty, "Failing directories:\n\t- #{failing_dirs.join("\n\t- ")}"
describe 'Any world-writeable directories' do
it 'should be group-owned by system accounts' do
expect(failing_dirs).to be_empty, "Failing directories:\n\t- #{failing_dirs.join("\n\t- ")}"
end
end
end
end

0 comments on commit f0c6338

Please sign in to comment.