Skip to content

Commit e6671b4

Browse files
committed
feat: add rule to ensure shadow group does not have any members
Members of the shadow group could have access to password hashes and other content of the shadow files. Signed-off-by: Claudius Heine <[email protected]>
1 parent 82c676d commit e6671b4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

controls/os_spec.rb

+15
Original file line numberDiff line numberDiff line change
@@ -355,3 +355,18 @@
355355
its('gids') { should_not contain_duplicates }
356356
end
357357
end
358+
359+
control 'os-19' do
360+
impact 1.0
361+
title 'Shadow group should not have any users'
362+
desc 'Members of the shadow group could have access to password hashes, so no user should be a member of that group'
363+
shadow_group_entry = etc_group.where(name: shadow_group)
364+
365+
describe passwd.gids(shadow_group_entry.gids) do
366+
its('count') { should eq 0 }
367+
end
368+
369+
describe shadow_group_entry do
370+
its('users') { should be_empty }
371+
end
372+
end

0 commit comments

Comments
 (0)