Skip to content

Commit

Permalink
Use the new macro to update the accounts_password_pam_retry remediation
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmcanonical committed Dec 1, 2024
1 parent b638ab1 commit a798043
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@

{{{ bash_instantiate_variables("var_password_pam_retry") }}}

{{{ bash_ensure_pam_module_options('/etc/pam.d/common-password', 'password', 'requisite', 'pam_pwquality.so', 'retry', "$var_password_pam_retry", "$var_password_pam_retry") }}}
{{{ bash_pam_pwquality_enable() }}}
PAM_FILE_PATH=/usr/share/pam-configs/cac_pwquality
if grep -qE 'pam_pwquality\.so.*retry=[^[:space:]]' "$PAM_FILE_PATH"; then
sed -i -E '/pam_pwquality\.so/ s/\bretry=[^[:space:]]*\b ?//' "$PAM_FILE_PATH"
fi
{{{ bash_pam_pwquality_parameter_value('retry', "$var_password_pam_retry") }}}

0 comments on commit a798043

Please sign in to comment.