Skip to content

Commit b1fa8c1

Browse files
committed
feat: add rule to check for password change dates in the past
A password changed date in the future could be used to circumvent password expiration dates. This rule checks that any password change dates are in the past. Signed-off-by: Claudius Heine <ch@denx.de>
1 parent e503f97 commit b1fa8c1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

controls/os_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,3 +282,12 @@
282282
end
283283
end
284284
end
285+
286+
control 'os-14' do
287+
impact 1.0
288+
title 'All password change dates are in the past'
289+
desc 'The password change date is used to detect expired passwords. Entering future dates might circumvent that.'
290+
describe shadow.where { last_change.to_i > (Date.today - Date.new(1970, 1, 1)).to_i } do
291+
its('users') { should be_empty }
292+
end
293+
end

0 commit comments

Comments
 (0)