-
Notifications
You must be signed in to change notification settings - Fork 764
Fix rule accounts_password_pam_pwhistory_use_authtok #14275
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
Conversation
The remediations shouldn't update the /etc/pam.d/system-auth and /etc/pam.d/password-auth directly, it would conflict with authselect. The remediations need to update the authselect profile instead, and then let authselect to modify the files in /etc/pam.d/.
ATEX Test ResultsTest artifacts have been submitted to Testing Farm. Results: View Test Results This comment was automatically generated by the ATEX workflow. |
| pam_profile_path="/etc/authselect/$CUSTOM_PROFILE" | ||
|
|
||
| for authselect_file in "$pam_profile_path"/password-auth "$pam_profile_path"/system-auth; do | ||
| if grep -Pq '^\h*password\h+([^#\n\r]+)\h+pam_pwhistory\.so\h+([^#\n\r]+\h+)?use_authtok\b' "$authselect_file"; then |
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.
| if grep -Pq '^\h*password\h+([^#\n\r]+)\h+pam_pwhistory\.so\h+([^#\n\r]+\h+)?use_authtok\b' "$authselect_file"; then | |
| if ! grep -Pq '^\h*password\h+([^#\n\r]+)\h+pam_pwhistory\.so\h+([^#\n\r]+\h+)?use_authtok\b' "$authselect_file"; then |
Currently, this seems only add if it is already there.
|
I have fixed the test scenario |
|
@jan-cerny: The following test failed, say
Full PR test history. Your PR dashboard. 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-sigs/prow repository. I understand the commands that are listed here. |
The remediations shouldn't update the /etc/pam.d/system-auth and /etc/pam.d/password-auth directly, it would conflict with authselect. The remediations need to update the authselect profile instead, and then let authselect to modify the files in /etc/pam.d/.
Blocks #14269