-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check Configuration of password remember #157
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -282,3 +282,25 @@ | |
end | ||
end | ||
end | ||
|
||
control 'os-14' do | ||
impact 1.0 | ||
title 'Check pam config - RedHat specific' | ||
desc 'Check config of files in /etc/pam.d.' | ||
|
||
pam_files = ['/etc/pam.d/system-auth', '/etc/pam.d/password-auth'] | ||
|
||
pam_files.each do |pam_file| | ||
describe file(pam_file) do | ||
it { should exist } | ||
it { should be_owned_by 'root' } | ||
its('group') { should eq 'root' } | ||
its(:content) { should match /^password requisite pam_pwhistory.so remember=60 use_authtok$/ } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This collects 60 passwords. I suggest to go with the CIS default of 5 and make this the default argument for this policy. You can than override the policy with 60 for your needs. What do you think if we also split this into multiple pieces as CIS DIL 5.3 is doing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I set the default back to 5 |
||
its(:content) { should match /^password requisite pam_pwquality.so try_first_pass retry=3 authtok_type=$/ } | ||
its(:content) { should match /^auth required pam_faillock.so preauth silent audit even_deny_root deny=5 unlock_time=15$/ } | ||
its(:content) { should match /^auth required pam_faillock.so authfail audit even_deny_root deny=5 unlock_time=15$/ } | ||
its(:content) { should match /^account required pam_faillock.so$/ } | ||
end | ||
end | ||
only_if { os.redhat? } | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All controls that we are adding to the base line need to be applicable and tested on all major linux distributions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @chris-rock,
in dev-sec/ansible-collection-hardening there is currently no configuration of this for other distributions and I am not the Debian master that can create them. So I only change some code in dev-sec/ansible-collection-hardening and create the missing test in this repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our code for PAM configuration on any non-RHEL based distribution is severely lacking.
I would propose to open an issue for this and going on with only RHEL support here.