Fix Ubuntu remediation for pam_faillock rules#11488
Conversation
The line `auth required pam_faillock.so preauth` is now added above the Primary block instead of above pam_unix.so. This prevents it from interfering with modules from other rules, specifically, pam_pkcs11.so in smartcard_pam_enabled.
The macro now ignores commented and empty lines when determining the position for pam_faillock authfail in the pam stack.
Cleaned up the comments in pam template and added missing tests for remediation.
|
Hi @mpurg. 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. DetailsInstructions 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. |
|
Code Climate has analyzed commit c538c20 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 58.5% (0.0% change). View more on Code Climate. |
Description:
pam_faillock authfailmodule in modified pam files.pam_faillock preauthabove the Primary block instead of abovepam_unix.Rationale:
pam_faillock authfailmodule when the pam file contains commented or empty lines, potentially locking the system.pam_faillock preauthmodule directly abovepam_unixinterferes with modules from other rules, specifically,pam_pkcs11insmartcard_pam_enabled.Example /etc/pam.d/common-auth on Ubuntu 22.04 after remediation:
After fix: