Skip to content

Commit

Permalink
Add word boundary for hash algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmcanonical committed Dec 3, 2024
1 parent 4ad76c9 commit e62ce4c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
{{% set line_pattern = "^[\s]*password[\s]+(?:(?:required)|(?:sufficient))[\s]+pam_unix\.so[\s]+" %}}
{{% endif %}}

{{% set pam_unix_algorithms = "(sha512|yescrypt|gost_yescrypt|blowfish|sha256|md5|bigcrypt)" %}}
{{% set hashing_pattern = line_pattern + "(?!.*" + pam_unix_algorithms + "[^#]*" + pam_unix_algorithms + ").*" + pam_unix_algorithms + ".*$" %}}
{{% set pam_unix_algorithms = "\\b(sha512|yescrypt|gost_yescrypt|blowfish|sha256|md5|bigcrypt)\\b" %}}
{{% set hashing_pattern = line_pattern + "(?!.*" + pam_unix_algorithms + "[^#]*" + pam_unix_algorithms + ")[^#]*" + pam_unix_algorithms + ".*$" %}}

<!--
In addition to the pam file, what usually differ between products are the controls in the
Expand Down

0 comments on commit e62ce4c

Please sign in to comment.