Skip to content

Commit

Permalink
Fix quote in bash remediation
Browse files Browse the repository at this point in the history
Fix missing quote in
account_disable_inactivity_system_auth &
account_disable_inactivity_password_auth
bash remediation

Signed-off-by: Armando Acosta <[email protected]>
  • Loading branch information
mrkanon committed Aug 1, 2024
1 parent 82609bf commit b2cc9e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fi
if ! grep -Pz \
"auth\s*required\s*pam_lastlog\.so[^#]*inactive=35[\s\S]*\n\s*auth\s*sufficient\s*pam_unix\.so"\
"$PAM_FILE_PATH" ; then
readarray -t pam_lastlog_lines <<< $(grep -oP '^\s*auth.*pam_lastlog\.so[^#]*inactive=35.*' $PAM_FILE_PATH)
readarray -t pam_lastlog_lines <<< "$(grep -oP '^\s*auth.*pam_lastlog\.so[^#]*inactive=35.*' $PAM_FILE_PATH)"
sed -i "/^\s*auth.*pam_lastlog\.so[^#]*inactive=35.*/d" "$PAM_FILE_PATH"
for line in "${pam_lastlog_lines[@]}"; do
sed -i "/^\s*auth.*pam_unix\.so.*/i$line" "$PAM_FILE_PATH"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fi
if ! grep -Pz \
"auth\s*required\s*pam_lastlog\.so[^#]*inactive=35[\s\S]*\n\s*auth\s*sufficient\s*pam_unix\.so"\
"$PAM_FILE_PATH" ; then
readarray -t pam_lastlog_lines <<< $(grep -oP '^\s*auth.*pam_lastlog\.so[^#]*inactive=35.*' $PAM_FILE_PATH)
readarray -t pam_lastlog_lines <<< "$(grep -oP '^\s*auth.*pam_lastlog\.so[^#]*inactive=35.*' $PAM_FILE_PATH)"
sed -i "/^\s*auth.*pam_lastlog\.so[^#]*inactive=35.*/d" "$PAM_FILE_PATH"
for line in "${pam_lastlog_lines[@]}"; do
sed -i "/^\s*auth.*pam_unix\.so.*/i$line" "$PAM_FILE_PATH"
Expand Down

0 comments on commit b2cc9e6

Please sign in to comment.