-
Notifications
You must be signed in to change notification settings - Fork 717
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
Fix rule ubtu 20 010072 #11074
Fix rule ubtu 20 010072 #11074
Conversation
This commit will properly fix STIG by ensuring that the pam_faillock arguments are properly set in /etc/pam.d/common-auth and within /etc/security/faillok.conf.
This commit will fix oval checks for accounts-pam which includes regex modularization, and proper line remediations for /etc/pam.d/common-auth along with /etc/security/faillock.conf.
This commit will simplify conditional logic to use pam_path jinja assigned variable.
Hi @dexterle. Thanks for your PR. I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
feedback: |
This datastream diff is auto generated by the check Click here to see the full diffansible remediation for rule 'xccdf_org.ssgproject.content_rule_account_passwords_pam_faillock_audit' differs.
--- xccdf_org.ssgproject.content_rule_account_passwords_pam_faillock_audit
+++ xccdf_org.ssgproject.content_rule_account_passwords_pam_faillock_audit
@@ -99,6 +99,16 @@
when:
- result_pam_faillock_is_enabled.found == 0
+ - name: Account Lockouts Must Be Logged - Enable pam_faillock.so authsucc editing
+ PAM files
+ ansible.builtin.lineinfile:
+ path: /etc/pam.d/common-auth
+ line: auth sufficient pam_faillock.so authsucc
+ insertbefore: ^auth.*sufficient.*pam_unix\.so.*
+ state: present
+ when:
+ - not result_authselect_present.stat.exists
+
- name: Account Lockouts Must Be Logged - Enable pam_faillock.so authfail editing
PAM files
ansible.builtin.lineinfile:
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_audit' differs.
--- xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_audit
+++ xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_audit
@@ -106,6 +106,16 @@
when:
- result_pam_faillock_is_enabled.found == 0
+ - name: Account Lockouts Must Be Logged - Enable pam_faillock.so authsucc editing
+ PAM files
+ ansible.builtin.lineinfile:
+ path: /etc/pam.d/common-auth
+ line: auth sufficient pam_faillock.so authsucc
+ insertbefore: ^auth.*sufficient.*pam_unix\.so.*
+ state: present
+ when:
+ - not result_authselect_present.stat.exists
+
- name: Account Lockouts Must Be Logged - Enable pam_faillock.so authfail editing
PAM files
ansible.builtin.lineinfile:
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_deny' differs.
--- xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_deny
+++ xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_deny
@@ -137,6 +137,16 @@
when:
- result_pam_faillock_is_enabled.found == 0
+ - name: Lock Accounts After Failed Password Attempts - Enable pam_faillock.so authsucc
+ editing PAM files
+ ansible.builtin.lineinfile:
+ path: /etc/pam.d/common-auth
+ line: auth sufficient pam_faillock.so authsucc
+ insertbefore: ^auth.*sufficient.*pam_unix\.so.*
+ state: present
+ when:
+ - not result_authselect_present.stat.exists
+
- name: Lock Accounts After Failed Password Attempts - Enable pam_faillock.so authfail
editing PAM files
ansible.builtin.lineinfile:
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_deny_root' differs.
--- xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_deny_root
+++ xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_deny_root
@@ -130,6 +130,16 @@
- result_pam_faillock_is_enabled.found == 0
- name: Configure the root Account for Failed Password Attempts - Enable pam_faillock.so
+ authsucc editing PAM files
+ ansible.builtin.lineinfile:
+ path: /etc/pam.d/common-auth
+ line: auth sufficient pam_faillock.so authsucc
+ insertbefore: ^auth.*sufficient.*pam_unix\.so.*
+ state: present
+ when:
+ - not result_authselect_present.stat.exists
+
+ - name: Configure the root Account for Failed Password Attempts - Enable pam_faillock.so
authfail editing PAM files
ansible.builtin.lineinfile:
path: '{{ item }}'
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_dir' differs.
--- xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_dir
+++ xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_dir
@@ -125,6 +125,16 @@
when:
- result_pam_faillock_is_enabled.found == 0
+ - name: Lock Accounts Must Persist - Enable pam_faillock.so authsucc editing PAM
+ files
+ ansible.builtin.lineinfile:
+ path: /etc/pam.d/common-auth
+ line: auth sufficient pam_faillock.so authsucc
+ insertbefore: ^auth.*sufficient.*pam_unix\.so.*
+ state: present
+ when:
+ - not result_authselect_present.stat.exists
+
- name: Lock Accounts Must Persist - Enable pam_faillock.so authfail editing PAM
files
ansible.builtin.lineinfile:
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_enforce_local' differs.
--- xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_enforce_local
+++ xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_enforce_local
@@ -119,6 +119,16 @@
when:
- result_pam_faillock_is_enabled.found == 0
+ - name: Enforce pam_faillock for Local Accounts Only - Enable pam_faillock.so authsucc
+ editing PAM files
+ ansible.builtin.lineinfile:
+ path: /etc/pam.d/common-auth
+ line: auth sufficient pam_faillock.so authsucc
+ insertbefore: ^auth.*sufficient.*pam_unix\.so.*
+ state: present
+ when:
+ - not result_authselect_present.stat.exists
+
- name: Enforce pam_faillock for Local Accounts Only - Enable pam_faillock.so authfail
editing PAM files
ansible.builtin.lineinfile:
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_interval' differs.
--- xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_interval
+++ xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_interval
@@ -130,6 +130,16 @@
- result_pam_faillock_is_enabled.found == 0
- name: Set Interval For Counting Failed Password Attempts - Enable pam_faillock.so
+ authsucc editing PAM files
+ ansible.builtin.lineinfile:
+ path: /etc/pam.d/common-auth
+ line: auth sufficient pam_faillock.so authsucc
+ insertbefore: ^auth.*sufficient.*pam_unix\.so.*
+ state: present
+ when:
+ - not result_authselect_present.stat.exists
+
+ - name: Set Interval For Counting Failed Password Attempts - Enable pam_faillock.so
authfail editing PAM files
ansible.builtin.lineinfile:
path: '{{ item }}'
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_silent' differs.
--- xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_silent
+++ xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_silent
@@ -124,6 +124,16 @@
- result_pam_faillock_is_enabled.found == 0
- name: Do Not Show System Messages When Unsuccessful Logon Attempts Occur - Enable
+ pam_faillock.so authsucc editing PAM files
+ ansible.builtin.lineinfile:
+ path: /etc/pam.d/common-auth
+ line: auth sufficient pam_faillock.so authsucc
+ insertbefore: ^auth.*sufficient.*pam_unix\.so.*
+ state: present
+ when:
+ - not result_authselect_present.stat.exists
+
+ - name: Do Not Show System Messages When Unsuccessful Logon Attempts Occur - Enable
pam_faillock.so authfail editing PAM files
ansible.builtin.lineinfile:
path: '{{ item }}'
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_unlock_time' differs.
--- xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_unlock_time
+++ xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_unlock_time
@@ -139,6 +139,16 @@
- /etc/pam.d/password-auth
when:
- result_pam_faillock_is_enabled.found == 0
+
+ - name: Set Lockout Time for Failed Password Attempts - Enable pam_faillock.so authsucc
+ editing PAM files
+ ansible.builtin.lineinfile:
+ path: /etc/pam.d/common-auth
+ line: auth sufficient pam_faillock.so authsucc
+ insertbefore: ^auth.*sufficient.*pam_unix\.so.*
+ state: present
+ when:
+ - not result_authselect_present.stat.exists
- name: Set Lockout Time for Failed Password Attempts - Enable pam_faillock.so authfail
editing PAM files |
Code Climate has analyzed commit fa50612 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 53.8% (0.0% change). View more on Code Climate. |
/packit retest-failed |
/test |
@dodys: The
Use
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest |
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.
do not break the oval check into multiple checks, that is the only way to test the order of configuration, because it matters.
Also DISA's configuration is missing the preauth IMO
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
closing this in favor of #11355 |
Description:
Rationale:
Review Hints:
Build the product:
To test these changes with Ansible:
To test changes with bash, run the remediation section:
xccdf_org.ssgproject.content_rule_accounts_passwords_pam_faillock_audit
Checkout Manual STIG OVAL definitions, and use software like DISA STIG Viewer to view definitions.
This STIG can be tested with the latest Ubuntu 2004 Benchmark SCAP. For reference, please review the latest artifacts: https://public.cyber.mil/stigs/downloads/