Skip to content

Commit

Permalink
Apply bash_pam_pwquality_enable before parameter remediation for temp…
Browse files Browse the repository at this point in the history
…late accounts_password
  • Loading branch information
alanmcanonical committed Dec 17, 2024
1 parent c8ed226 commit 5585978
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions shared/templates/accounts_password/bash.template
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ fi
}}}
{{% endif %}}

{{% if product == "ubuntu2404" %}}
{{{ bash_pam_pwquality_enable() }}}
{{% endif %}}

{{{ bash_replace_or_append('/etc/security/pwquality.conf', '^' ~ VARIABLE , '$var_password_pam_' ~ VARIABLE , '%s = %s') }}}
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/bin/bash
# variables = var_password_pam_{{{ VARIABLE }}}={{{ TEST_VAR_VALUE }}}

{{% if product == "ubuntu2404" %}}
{{{ bash_pam_pwquality_enable() }}}
{{% endif %}}

truncate -s 0 /etc/security/pwquality.conf

echo "{{{ VARIABLE }}} = {{{ TEST_CORRECT_VALUE }}}" >> /etc/security/pwquality.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
# This test will ensure that OVAL also checks the configuration in
# /etc/security/pwquality.conf.d/*.conf files

{{% if product == "ubuntu2404" %}}
{{{ bash_pam_pwquality_enable() }}}
{{% endif %}}

truncate -s 0 /etc/security/pwquality.conf

config_dir="/etc/security/pwquality.conf.d"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/bin/bash
# variables = var_password_pam_{{{ VARIABLE }}}={{{ TEST_VAR_VALUE }}}

{{% if product == "ubuntu2404" %}}
{{{ bash_pam_pwquality_enable() }}}
{{% endif %}}

truncate -s 0 /etc/security/pwquality.conf

echo "{{{ VARIABLE }}} = {{{ TEST_CORRECT_VALUE }}}" >> /etc/security/pwquality.conf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# platform = Oracle Linux 8
# variables = var_password_pam_{{{ VARIABLE }}}={{{ TEST_VAR_VALUE }}}

{{% if product == "ubuntu2404" %}}
{{{ bash_pam_pwquality_enable() }}}
{{% endif %}}

truncate -s 0 /etc/security/pwquality.conf

echo "{{{ VARIABLE }}} = {{{ TEST_CORRECT_VALUE }}}" >> /etc/security/pwquality.conf
Expand Down

0 comments on commit 5585978

Please sign in to comment.