Skip to content

Commit

Permalink
feat: add rule to ensure shadow group does not have any members
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
cmhe committed Nov 4, 2021
1 parent 82c676d commit e6671b4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions controls/os_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -355,3 +355,18 @@
its('gids') { should_not contain_duplicates }
end
end

control 'os-19' do
impact 1.0
title 'Shadow group should not have any users'
desc 'Members of the shadow group could have access to password hashes, so no user should be a member of that group'
shadow_group_entry = etc_group.where(name: shadow_group)

describe passwd.gids(shadow_group_entry.gids) do
its('count') { should eq 0 }
end

describe shadow_group_entry do
its('users') { should be_empty }
end
end

0 comments on commit e6671b4

Please sign in to comment.