From 6f9b8cb16c3f0763ab5111766f8994330f52038e Mon Sep 17 00:00:00 2001 From: Alan Moore Date: Wed, 15 Jan 2025 13:57:07 +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_use_authtok/oval/shared.xml diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_password_pam_pwhistory_use_authtok/oval/shared.xml b/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_password_pam_pwhistory_use_authtok/oval/shared.xml deleted file mode 100644 index 377eb4f24d20..000000000000 --- a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_password_pam_pwhistory_use_authtok/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]*\buse_authtok\b.*$ - 1 - - - diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_password_pam_pwhistory_use_authtok/rule.yml b/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_password_pam_pwhistory_use_authtok/rule.yml index 2097396dc5df..d7575f75d088 100644 --- a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_password_pam_pwhistory_use_authtok/rule.yml +++ b/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_password_pam_pwhistory_use_authtok/rule.yml @@ -16,3 +16,18 @@ rationale: |- 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: use_authtok + new_argument: use_authtok +{{% if 'ubuntu' in product %}} + backends: + - bash: "off" +{{% endif %}}