Skip to content

Commit

Permalink
feat: add rules to ensure that all referred users and gids exist
Browse files Browse the repository at this point in the history
Signed-off-by: Claudius Heine <ch@denx.de>
  • Loading branch information
cmhe committed Nov 4, 2021
1 parent 137b573 commit 4c607b0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions controls/os_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -370,3 +370,19 @@
its('users') { should be_empty }
end
end

control 'os-20' do
impact 1.0
title 'All users and gids referred in /etc/group and /etc/passwd should exist'
desc 'Errors in system administration can lead to a case where gids or uids referred to do not exist'

gids = etc_group.gids.map(&:to_s)
describe passwd do
its('gids') { should be_in gids }
end

users = passwd.users
describe etc_group do
its('users') { should be_in users }
end
end

0 comments on commit 4c607b0

Please sign in to comment.