From e9211e9ca206af0be11ec11fd58cbc4046dbc9b7 Mon Sep 17 00:00:00 2001 From: Alan Moore Date: Wed, 15 Jan 2025 13:53:57 +0000 Subject: [PATCH] Use pam_options template with bash turned off --- .../oval/shared.xml | 52 ------------------- .../rule.yml | 15 ++++++ 2 files changed, 15 insertions(+), 52 deletions(-) delete mode 100644 linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_password_pam_pwhistory_enforce_root/oval/shared.xml diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_password_pam_pwhistory_enforce_root/oval/shared.xml b/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_password_pam_pwhistory_enforce_root/oval/shared.xml deleted file mode 100644 index 1a822cfd471..00000000000 --- a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_password_pam_pwhistory_enforce_root/oval/shared.xml +++ /dev/null @@ -1,52 +0,0 @@ -{{% if "sle12" in product or "debian" in product or "ubuntu" in product %}} -{{%- set accounts_password_pam_file = '/etc/pam.d/common-password' -%}} -{{% else %}} -{{%- set accounts_password_pam_file = '/etc/pam.d/system-auth' -%}} -{{% endif %}} - - - - {{{ oval_metadata("Enforce password history for root of pam_pwhistory.") }}} - - - - - - - - - - - - - {{{ accounts_password_pam_file }}} - - 1 - - - - - ^\s*password\s+(?:(?:sufficient)|(?:required)|(?:requisite)|(?:\[.*\]))\s+pam_pwhistory\.so.*$ - - - - - - - - - {{{ accounts_password_pam_file }}} - ^\s*password\s+(?:(?:sufficient)|(?:required)|(?:requisite)|(?:\[.*\]))\s+pam_pwhistory\.so\s+[^#\n\r]*\benforce_for_root\b.*$ - 1 - - - diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_password_pam_pwhistory_enforce_root/rule.yml b/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_password_pam_pwhistory_enforce_root/rule.yml index 4d3b37d621c..a20269e5a4d 100644 --- a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_password_pam_pwhistory_enforce_root/rule.yml +++ b/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_password_pam_pwhistory_enforce_root/rule.yml @@ -16,3 +16,18 @@ rationale: 'Preventing re-use of previous passwords helps ensure that a compromi severity: medium platform: package[pam] + +template: + name: pam_options + vars: + path: /etc/pam.d/common-password + type: password + control_flag: requisite + module: pam_pwhistory.so + arguments: + - argument: enforce_for_root + new_argument: enforce_for_root +{{% if 'ubuntu' in product %}} + backends: + - bash: "off" +{{% endif %}}