From 2696577a46b958249e39aa20b6c1133ddc70e489 Mon Sep 17 00:00:00 2001 From: Armando Acosta Date: Mon, 19 May 2025 16:18:49 -0600 Subject: [PATCH 1/2] Add OL9 to accounts_password template Signed-off-by: Armando Acosta --- shared/templates/accounts_password/ansible.template | 2 +- shared/templates/accounts_password/bash.template | 2 +- shared/templates/accounts_password/oval.template | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shared/templates/accounts_password/ansible.template b/shared/templates/accounts_password/ansible.template index dc73e57ccf5..1c3516b966c 100644 --- a/shared/templates/accounts_password/ansible.template +++ b/shared/templates/accounts_password/ansible.template @@ -5,7 +5,7 @@ # disruption = low - (xccdf-var var_password_pam_{{{ VARIABLE }}}) -{{% if product == "ol8" or 'rhel' in product %}} +{{% if product in ["ol8","ol9"] or 'rhel' in product %}} - name: {{{ rule_title }}} - Find pwquality.conf.d files ansible.builtin.find: paths: /etc/security/pwquality.conf.d/ diff --git a/shared/templates/accounts_password/bash.template b/shared/templates/accounts_password/bash.template index 44e50228073..ee3042885b8 100644 --- a/shared/templates/accounts_password/bash.template +++ b/shared/templates/accounts_password/bash.template @@ -6,7 +6,7 @@ {{{ bash_instantiate_variables("var_password_pam_" ~ VARIABLE) }}} -{{% if product == "ol8" or 'rhel' in product %}} +{{% if product in ["ol8","ol9"] or 'rhel' in product %}} if grep -sq {{{ VARIABLE }}} /etc/security/pwquality.conf.d/*.conf ; then sed -i "/{{{ VARIABLE }}}/d" /etc/security/pwquality.conf.d/*.conf fi diff --git a/shared/templates/accounts_password/oval.template b/shared/templates/accounts_password/oval.template index 7eacdf62517..0161d1b9858 100644 --- a/shared/templates/accounts_password/oval.template +++ b/shared/templates/accounts_password/oval.template @@ -1,4 +1,4 @@ -{{% if product == "ol8" or 'rhel' in product %}} +{{% if product in ["ol8","ol9"] or 'rhel' in product %}} {{% set filepath_regex="^/etc/security/pwquality\.conf(\.d/[^/]+\.conf)?$" %}} {{% else %}} {{% set filepath_regex="^/etc/security/pwquality\.conf$" %}} From 2f6149dc920769c0b21f3efb8c84534951b8e6c3 Mon Sep 17 00:00:00 2001 From: Armando Acosta Date: Mon, 19 May 2025 16:19:25 -0600 Subject: [PATCH 2/2] Add OL9 to accounts_password tests Signed-off-by: Armando Acosta --- .../tests/conflicting_values_directory.fail.sh | 2 +- .../accounts_password/tests/correct_value_directory.pass.sh | 2 +- .../accounts_password/tests/multiple_correct_value.pass.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shared/templates/accounts_password/tests/conflicting_values_directory.fail.sh b/shared/templates/accounts_password/tests/conflicting_values_directory.fail.sh index 8c002663d64..17a1bd387d2 100644 --- a/shared/templates/accounts_password/tests/conflicting_values_directory.fail.sh +++ b/shared/templates/accounts_password/tests/conflicting_values_directory.fail.sh @@ -1,6 +1,6 @@ #!/bin/bash # This test only applies to platforms that check the pwquality.conf.d directory -# platform = Oracle Linux 8,multi_platform_rhel +# platform = Oracle Linux 8,Oracle Linux 9,multi_platform_rhel # variables = var_password_pam_{{{ VARIABLE }}}={{{ TEST_VAR_VALUE }}} truncate -s 0 /etc/security/pwquality.conf diff --git a/shared/templates/accounts_password/tests/correct_value_directory.pass.sh b/shared/templates/accounts_password/tests/correct_value_directory.pass.sh index 689093008c5..5f3be9f6cc1 100644 --- a/shared/templates/accounts_password/tests/correct_value_directory.pass.sh +++ b/shared/templates/accounts_password/tests/correct_value_directory.pass.sh @@ -1,6 +1,6 @@ #!/bin/bash # This test only applies to platforms that check the pwquality.conf.d directory -# platform = Oracle Linux 8,multi_platform_rhel +# platform = Oracle Linux 8,Oracle Linux 9,multi_platform_rhel # variables = var_password_pam_{{{ VARIABLE }}}={{{ TEST_VAR_VALUE }}} # This test will ensure that OVAL also checks the configuration in diff --git a/shared/templates/accounts_password/tests/multiple_correct_value.pass.sh b/shared/templates/accounts_password/tests/multiple_correct_value.pass.sh index def17658cf5..371e114452d 100644 --- a/shared/templates/accounts_password/tests/multiple_correct_value.pass.sh +++ b/shared/templates/accounts_password/tests/multiple_correct_value.pass.sh @@ -1,6 +1,6 @@ #!/bin/bash # This test only applies to platforms that check the pwquality.conf.d directory -# platform = Oracle Linux 8 +# platform = Oracle Linux 8, Oracle Linux 9 # variables = var_password_pam_{{{ VARIABLE }}}={{{ TEST_VAR_VALUE }}} {{% if product == "ubuntu2404" %}}