From eea0ffab6bfe29eebf9f4b3e9c117b2f3d845169 Mon Sep 17 00:00:00 2001 From: Alexandre Skrzyniarz Date: Wed, 3 Apr 2024 12:16:31 +0200 Subject: [PATCH] add a pam_account_password_faillock_deny tenplate and rewrite accounts_passwords_pam_faillock_deny rule to use the template. --- .../oval/debian.xml | 1 - .../oval/openeuler.xml | 291 ----------------- .../oval/shared.xml | 291 ----------------- .../oval/ubuntu.xml | 201 ------------ .../rule.yml | 3 + .../ansible.template | 0 .../bash.template | 0 .../oval.template | 298 ++++++++++++++++++ .../template.yml | 4 + .../tests/authselect_modified_pam.fail.sh | 0 .../conflicting_settings_authselect.fail.sh | 0 .../pam_faillock_conflicting_settings.fail.sh | 0 .../tests/pam_faillock_disabled.fail.sh | 0 ...am_faillock_expected_faillock_conf.pass.sh | 0 .../pam_faillock_expected_pam_files.pass.sh | 0 ...pam_faillock_lenient_faillock_conf.fail.sh | 0 .../pam_faillock_lenient_pam_files.fail.sh | 0 ...ck_multiple_pam_unix_faillock_conf.fail.sh | 0 ...illock_multiple_pam_unix_pam_files.fail.sh | 0 ...am_faillock_not_required_pam_files.fail.sh | 0 ...am_faillock_stricter_faillock_conf.pass.sh | 0 .../pam_faillock_stricter_pam_files.pass.sh | 0 .../tests/ubuntu_commented_values.fail.sh | 0 .../tests/ubuntu_common.sh | 0 .../tests/ubuntu_correct.pass.sh | 0 .../tests/ubuntu_correct_pamd.pass.sh | 0 .../tests/ubuntu_empty_faillock_conf.fail.sh | 0 .../tests/ubuntu_missing_pamd.fail.sh | 0 .../tests/ubuntu_multiple_pam_unix.fail.sh | 0 .../tests/ubuntu_wrong_value.fail.sh | 0 30 files changed, 305 insertions(+), 784 deletions(-) delete mode 120000 linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/oval/debian.xml delete mode 100644 linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/oval/openeuler.xml delete mode 100644 linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/oval/shared.xml delete mode 100644 linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/oval/ubuntu.xml rename linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/ansible/shared.yml => shared/templates/pam_account_password_faillock_deny/ansible.template (100%) rename linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/bash/shared.sh => shared/templates/pam_account_password_faillock_deny/bash.template (100%) create mode 100644 shared/templates/pam_account_password_faillock_deny/oval.template create mode 100644 shared/templates/pam_account_password_faillock_deny/template.yml rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/authselect_modified_pam.fail.sh (100%) rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/conflicting_settings_authselect.fail.sh (100%) rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/pam_faillock_conflicting_settings.fail.sh (100%) rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/pam_faillock_disabled.fail.sh (100%) rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/pam_faillock_expected_faillock_conf.pass.sh (100%) rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/pam_faillock_expected_pam_files.pass.sh (100%) rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/pam_faillock_lenient_faillock_conf.fail.sh (100%) rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/pam_faillock_lenient_pam_files.fail.sh (100%) rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/pam_faillock_multiple_pam_unix_faillock_conf.fail.sh (100%) rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/pam_faillock_multiple_pam_unix_pam_files.fail.sh (100%) rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/pam_faillock_not_required_pam_files.fail.sh (100%) rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/pam_faillock_stricter_faillock_conf.pass.sh (100%) rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/pam_faillock_stricter_pam_files.pass.sh (100%) rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/ubuntu_commented_values.fail.sh (100%) rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/ubuntu_common.sh (100%) rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/ubuntu_correct.pass.sh (100%) rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/ubuntu_correct_pamd.pass.sh (100%) rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/ubuntu_empty_faillock_conf.fail.sh (100%) rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/ubuntu_missing_pamd.fail.sh (100%) rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/ubuntu_multiple_pam_unix.fail.sh (100%) rename {linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny => shared/templates/pam_account_password_faillock_deny}/tests/ubuntu_wrong_value.fail.sh (100%) diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/oval/debian.xml b/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/oval/debian.xml deleted file mode 120000 index 70f08ba8db12..000000000000 --- a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/oval/debian.xml +++ /dev/null @@ -1 +0,0 @@ -ubuntu.xml \ No newline at end of file diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/oval/openeuler.xml b/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/oval/openeuler.xml deleted file mode 100644 index 0abb80d8d5de..000000000000 --- a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/oval/openeuler.xml +++ /dev/null @@ -1,291 +0,0 @@ - - - {{{ oval_metadata("Lockout account after failed login attempts") }}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ^[\s]*auth\N+pam_unix\.so - - - - ^[\s]*auth[\s]+(required|\[(?=.*?\bsuccess=ok\b)?(?=.*?\bnew_authtok_reqd=ok\b)?(?=.*?\bignore=ignore\b)?(?=.*?\bdefault=bad\b)?.*\])[\s]+pam_faillock\.so[\s\w\d=]+preauth[\s\S]*^[\s]*auth[\s]+(sufficient|\[(?=.*\bsuccess=done\b)?(?=.*?\bnew_authtok_reqd=done\b)?(?=.*?\bdefault=ignore\b)?.*\])[\s]+pam_unix\.so[\s\S]*^[\s]*auth[\s]+(required|\[(?=.*?\bsuccess=ok\b)?(?=.*?\bnew_authtok_reqd=ok\b)?(?=.*?\bignore=ignore\b)?(?=.*?\bdefault=die\b)?.*\])[\s]+pam_faillock\.so[\s\w\d=]+authfail - - - - ^[\s]*account[\s]+(required|\[(?=.*?\bsuccess=ok\b)?(?=.*?\bnew_authtok_reqd=ok\b)?(?=.*?\bignore=ignore\b)?(?=.*?\bdefault=bad\b)?.*\])[\s]+pam_unix\.so[\s\S]*^[\s]*account[\s]+(required|\[(?=.*?\bsuccess=ok\b)?(?=.*?\bnew_authtok_reqd=ok\b)?(?=.*?\bignore=ignore\b)?(?=.*?\bdefault=bad\b)?.*\])[\s]+pam_faillock\.so - - - - ^[\s]*auth[\s]+.+[\s]+pam_faillock.so[\s]+[^\n]*deny=([0-9]+) - - - - ^[\s]*deny[\s]*=[\s]*([0-9]+) - - - - - ^/etc/pam.d/system-auth$ - - - 1 - - - - - - - - - ^/etc/pam.d/password-auth$ - - 1 - - - - - - - - - ^/etc/pam.d/system-auth$ - - 1 - - - - - - - - ^/etc/pam.d/system-auth$ - - 1 - - - - - - - - - ^/etc/pam.d/password-auth$ - - 1 - - - - - - - - ^/etc/pam.d/password-auth$ - - 1 - - - - - - - - - - - - - - - - 0 - - - - - ^/etc/pam.d/system-auth$ - - 1 - - - - - - - - - - - - - - - ^/etc/pam.d/password-auth$ - - 1 - - - - - - - - - - - - - - - ^/etc/security/faillock.conf$ - - 1 - - - - - - - - - - - - diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/oval/shared.xml b/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/oval/shared.xml deleted file mode 100644 index 4c3b56ba06c2..000000000000 --- a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/oval/shared.xml +++ /dev/null @@ -1,291 +0,0 @@ - - - {{{ oval_metadata("Lockout account after failed login attempts") }}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ^[\s]*auth\N+pam_unix\.so - - - - ^[\s]*auth[\s]+(required|\[(?=.*?\bsuccess=ok\b)(?=.*?\bnew_authtok_reqd=ok\b)(?=.*?\bignore=ignore\b)(?=.*?\bdefault=bad\b).*\])[\s]+pam_faillock\.so[\s\w\d=]+preauth[\s\S]*^[\s]*auth[\s]+(sufficient|\[(?=.*\bsuccess=done\b)(?=.*?\bnew_authtok_reqd=done\b)(?=.*?\bdefault=ignore\b).*\])[\s]+pam_unix\.so[\s\S]*^[\s]*auth[\s]+(required|\[(?=.*?\bsuccess=ok\b)(?=.*?\bnew_authtok_reqd=ok\b)(?=.*?\bignore=ignore\b)(?=.*?\bdefault=bad\b).*\])[\s]+pam_faillock\.so[\s\w\d=]+authfail - - - - ^[\s]*account[\s]+(required|\[(?=.*?\bsuccess=ok\b)(?=.*?\bnew_authtok_reqd=ok\b)(?=.*?\bignore=ignore\b)(?=.*?\bdefault=bad\b).*\])[\s]+pam_faillock\.so[\s\S]*^[\s]*account[\s]+(required|\[(?=.*?\bsuccess=ok\b)(?=.*?\bnew_authtok_reqd=ok\b)(?=.*?\bignore=ignore\b)(?=.*?\bdefault=bad\b).*\])[\s]+pam_unix\.so - - - - ^[\s]*auth[\s]+.+[\s]+pam_faillock.so[\s]+[^\n]*deny=([0-9]+) - - - - ^[\s]*deny[\s]*=[\s]*([0-9]+) - - - - - ^/etc/pam.d/system-auth$ - - - 1 - - - - - - - - - ^/etc/pam.d/password-auth$ - - 1 - - - - - - - - - ^/etc/pam.d/system-auth$ - - 1 - - - - - - - - ^/etc/pam.d/system-auth$ - - 1 - - - - - - - - - ^/etc/pam.d/password-auth$ - - 1 - - - - - - - - ^/etc/pam.d/password-auth$ - - 1 - - - - - - - - - - - - - - - - 0 - - - - - ^/etc/pam.d/system-auth$ - - 1 - - - - - - - - - - - - - - - ^/etc/pam.d/password-auth$ - - 1 - - - - - - - - - - - - - - - ^/etc/security/faillock.conf$ - - 1 - - - - - - - - - - - - diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/oval/ubuntu.xml b/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/oval/ubuntu.xml deleted file mode 100644 index 443a85b29346..000000000000 --- a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/oval/ubuntu.xml +++ /dev/null @@ -1,201 +0,0 @@ -{{# Very similar OVAL is used in several rules, differing primarily in faillock.so parameter. #}} -{{# For transferability, we define the parameter and corresponding regular expressions in jinja. #}} -{{# The rules should ideally use a single template. #}} - -{{% set prm_name = "deny" %}} -{{% set prm_regex_conf = "^[\s]*deny[\s]*=[\s]*([0-9]+)" %}} -{{% set prm_regex_pamd = "^[\s]*auth[\s]+.+[\s]+pam_faillock.so[\s]+[^\n]*deny=([0-9]+)" %}} -{{% set ext_variable = "var_accounts_passwords_pam_faillock_deny" %}} -{{% set description = "Lockout account after failed login attempts." %}} - - - - {{{ oval_metadata(description) }}} - - - - - - - - - - - - - - - - - - - - - - - - - ^\s*auth.*pam_unix\.so - - - - ^\s*auth\s+required\s+pam_faillock\.so.*preauth.*[\s\S]*^\s*auth.*pam_unix\.so[\s\S]*^\s*auth\s+\[default=die\]\s+pam_faillock\.so\s+authfail[\s\S]*^\s*auth\s+sufficient\s+pam_faillock\.so\s+authsucc - - - - ^\s*account\s+required\s+pam_faillock\.so\s*(#.*)?$ - - - - {{{ prm_regex_pamd }}} - - - - {{{ prm_regex_conf }}} - - - - - - - - - /etc/pam.d/common-auth - - 1 - - - - - - - - - /etc/pam.d/common-auth - - 1 - - - - - - - - - /etc/pam.d/common-account - - 1 - - - - - - - - - - - - - 0 - - - - - - - - - - - - - - - - /etc/pam.d/common-auth - - 1 - - - - - - - - - - - - - - - - - /etc/security/faillock.conf - - 1 - - diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/rule.yml b/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/rule.yml index 1e44643c60cb..7b4a749a6178 100644 --- a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/rule.yml +++ b/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/rule.yml @@ -131,3 +131,6 @@ warnings: srg_requirement: |- {{{ full_name }}} must automatically lock an account when three unsuccessful logon attempts occur. + +template: + name: pam_account_password_faillock_deny diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/ansible/shared.yml b/shared/templates/pam_account_password_faillock_deny/ansible.template similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/ansible/shared.yml rename to shared/templates/pam_account_password_faillock_deny/ansible.template diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/bash/shared.sh b/shared/templates/pam_account_password_faillock_deny/bash.template similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/bash/shared.sh rename to shared/templates/pam_account_password_faillock_deny/bash.template diff --git a/shared/templates/pam_account_password_faillock_deny/oval.template b/shared/templates/pam_account_password_faillock_deny/oval.template new file mode 100644 index 000000000000..54a7981edbf7 --- /dev/null +++ b/shared/templates/pam_account_password_faillock_deny/oval.template @@ -0,0 +1,298 @@ +{{# Very similar OVAL is used in several rules, differing primarily in faillock.so parameter. #}} +{{# For transferability, we define the parameter and corresponding regular expressions in jinja. #}} +{{# The rules should ideally use a single template. #}} + +{{% set prm_name = "deny" %}} +{{% set prm_regex_conf = "^[\s]*deny[\s]*=[\s]*([0-9]+)" %}} +{{% set prm_regex_pamd = "^[\s]*auth[\s]+.+[\s]+pam_faillock.so[\s]+[^\n]*deny=([0-9]+)" %}} +{{% set ext_variable = "var_accounts_passwords_pam_faillock_deny" %}} +{{% set description = "Lockout account after failed login attempts." %}} + + + + {{{ oval_metadata(description) }}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ^\s*auth\N+pam_unix\.so + + + + {{% if 'debian' in product or 'ubuntu' in product %}} + ^\s*auth\s+required\s+pam_faillock\.so.*preauth.*[\s\S]*^\s*auth.*pam_unix\.so[\s\S]*^\s*auth\s+\[default=die\]\s+pam_faillock\.so\s+authfail[\s\S]*^\s*auth\s+sufficient\s+pam_faillock\.so\s+authsucc + {{% elif 'openeuler' in product %}} + ^[\s]*auth[\s]+(required|\[(?=.*?\bsuccess=ok\b)?(?=.*?\bnew_authtok_reqd=ok\b)?(?=.*?\bignore=ignore\b)?(?=.*?\bdefault=bad\b)?.*\])[\s]+pam_faillock\.so[\s\w\d=]+preauth[\s\S]*^[\s]*auth[\s]+(sufficient|\[(?=.*\bsuccess=done\b)?(?=.*?\bnew_authtok_reqd=done\b)?(?=.*?\bdefault=ignore\b)?.*\])[\s]+pam_unix\.so[\s\S]*^[\s]*auth[\s]+(required|\[(?=.*?\bsuccess=ok\b)?(?=.*?\bnew_authtok_reqd=ok\b)?(?=.*?\bignore=ignore\b)?(?=.*?\bdefault=die\b)?.*\])[\s]+pam_faillock\.so[\s\w\d=]+authfail + {{% else %}} + ^[\s]*auth[\s]+(required|\[(?=.*?\bsuccess=ok\b)(?=.*?\bnew_authtok_reqd=ok\b)(?=.*?\bignore=ignore\b)(?=.*?\bdefault=bad\b).*\])[\s]+pam_faillock\.so[\s\w\d=]+preauth[\s\S]*^[\s]*auth[\s]+(sufficient|\[(?=.*\bsuccess=done\b)(?=.*?\bnew_authtok_reqd=done\b)(?=.*?\bdefault=ignore\b).*\])[\s]+pam_unix\.so[\s\S]*^[\s]*auth[\s]+(required|\[(?=.*?\bsuccess=ok\b)(?=.*?\bnew_authtok_reqd=ok\b)(?=.*?\bignore=ignore\b)(?=.*?\bdefault=bad\b).*\])[\s]+pam_faillock\.so[\s\w\d=]+authfail + {{% endif %}} + + + + {{% if 'debian' in product or 'ubuntu' in product %}} + ^\s*account\s+required\s+pam_faillock\.so\s*(#.*)?$ + {{% elif 'openeuler' in product %}} + ^[\s]*account[\s]+(required|\[(?=.*?\bsuccess=ok\b)?(?=.*?\bnew_authtok_reqd=ok\b)?(?=.*?\bignore=ignore\b)?(?=.*?\bdefault=bad\b)?.*\])[\s]+pam_unix\.so[\s\S]*^[\s]*account[\s]+(required|\[(?=.*?\bsuccess=ok\b)?(?=.*?\bnew_authtok_reqd=ok\b)?(?=.*?\bignore=ignore\b)?(?=.*?\bdefault=bad\b)?.*\])[\s]+pam_faillock\.so + {{% else %}} + ^[\s]*account[\s]+(required|\[(?=.*?\bsuccess=ok\b)(?=.*?\bnew_authtok_reqd=ok\b)(?=.*?\bignore=ignore\b)(?=.*?\bdefault=bad\b).*\])[\s]+pam_faillock\.so[\s\S]*^[\s]*account[\s]+(required|\[(?=.*?\bsuccess=ok\b)(?=.*?\bnew_authtok_reqd=ok\b)(?=.*?\bignore=ignore\b)(?=.*?\bdefault=bad\b).*\])[\s]+pam_unix\.so + {{% endif %}} + + + + {{{ prm_regex_pamd }}} + + + + {{{ prm_regex_conf }}} + + + {{% macro generate_test_faillock_enabled(file_stem) %}} + + + + + + + /etc/pam.d/{{{file_stem}}}-auth + + 1 + + + + + + + + + /etc/pam.d/{{{ file_stem }}}-auth + + 1 + + {{% endmacro %}} + + {{{ generate_test_faillock_enabled (file_stem="system") }}} + {{{ generate_test_faillock_enabled (file_stem="password") }}} + {{{ generate_test_faillock_enabled (file_stem="common") }}} + + {{% macro generate_test_faillock_account(file_stem, file) %}} + + + + + + + /etc/pam.d/{{{ file }}} + + 1 + + {{% endmacro %}} + + {{{ generate_test_faillock_account (file_stem="system", file="system-auth") }}} + {{{ generate_test_faillock_account (file_stem="password", file="password-auth") }}} + {{{ generate_test_faillock_account (file_stem="common", file="common-account") }}} + + {{% macro generate_check_parameter_in_pam_file(file_stem) %}} + + + + + + + + + + + + + + /etc/pam.d/{{{ file_stem }}}-auth + + 1 + + {{% endmacro %}} + + + + + + + + + + + 0 + + + {{{ generate_check_parameter_in_pam_file (file_stem="system") }}} + {{{ generate_check_parameter_in_pam_file (file_stem="password") }}} + {{{ generate_check_parameter_in_pam_file (file_stem="common") }}} + + + + + + + + + + + + + + + /etc/security/faillock.conf + + 1 + + + diff --git a/shared/templates/pam_account_password_faillock_deny/template.yml b/shared/templates/pam_account_password_faillock_deny/template.yml new file mode 100644 index 000000000000..b57de6fbb63e --- /dev/null +++ b/shared/templates/pam_account_password_faillock_deny/template.yml @@ -0,0 +1,4 @@ +supported_languages: + - ansible + - bash + - oval diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/authselect_modified_pam.fail.sh b/shared/templates/pam_account_password_faillock_deny/tests/authselect_modified_pam.fail.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/authselect_modified_pam.fail.sh rename to shared/templates/pam_account_password_faillock_deny/tests/authselect_modified_pam.fail.sh diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/conflicting_settings_authselect.fail.sh b/shared/templates/pam_account_password_faillock_deny/tests/conflicting_settings_authselect.fail.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/conflicting_settings_authselect.fail.sh rename to shared/templates/pam_account_password_faillock_deny/tests/conflicting_settings_authselect.fail.sh diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_conflicting_settings.fail.sh b/shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_conflicting_settings.fail.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_conflicting_settings.fail.sh rename to shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_conflicting_settings.fail.sh diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_disabled.fail.sh b/shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_disabled.fail.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_disabled.fail.sh rename to shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_disabled.fail.sh diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_expected_faillock_conf.pass.sh b/shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_expected_faillock_conf.pass.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_expected_faillock_conf.pass.sh rename to shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_expected_faillock_conf.pass.sh diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_expected_pam_files.pass.sh b/shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_expected_pam_files.pass.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_expected_pam_files.pass.sh rename to shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_expected_pam_files.pass.sh diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_lenient_faillock_conf.fail.sh b/shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_lenient_faillock_conf.fail.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_lenient_faillock_conf.fail.sh rename to shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_lenient_faillock_conf.fail.sh diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_lenient_pam_files.fail.sh b/shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_lenient_pam_files.fail.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_lenient_pam_files.fail.sh rename to shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_lenient_pam_files.fail.sh diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_multiple_pam_unix_faillock_conf.fail.sh b/shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_multiple_pam_unix_faillock_conf.fail.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_multiple_pam_unix_faillock_conf.fail.sh rename to shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_multiple_pam_unix_faillock_conf.fail.sh diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_multiple_pam_unix_pam_files.fail.sh b/shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_multiple_pam_unix_pam_files.fail.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_multiple_pam_unix_pam_files.fail.sh rename to shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_multiple_pam_unix_pam_files.fail.sh diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_not_required_pam_files.fail.sh b/shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_not_required_pam_files.fail.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_not_required_pam_files.fail.sh rename to shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_not_required_pam_files.fail.sh diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_stricter_faillock_conf.pass.sh b/shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_stricter_faillock_conf.pass.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_stricter_faillock_conf.pass.sh rename to shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_stricter_faillock_conf.pass.sh diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_stricter_pam_files.pass.sh b/shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_stricter_pam_files.pass.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/pam_faillock_stricter_pam_files.pass.sh rename to shared/templates/pam_account_password_faillock_deny/tests/pam_faillock_stricter_pam_files.pass.sh diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/ubuntu_commented_values.fail.sh b/shared/templates/pam_account_password_faillock_deny/tests/ubuntu_commented_values.fail.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/ubuntu_commented_values.fail.sh rename to shared/templates/pam_account_password_faillock_deny/tests/ubuntu_commented_values.fail.sh diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/ubuntu_common.sh b/shared/templates/pam_account_password_faillock_deny/tests/ubuntu_common.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/ubuntu_common.sh rename to shared/templates/pam_account_password_faillock_deny/tests/ubuntu_common.sh diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/ubuntu_correct.pass.sh b/shared/templates/pam_account_password_faillock_deny/tests/ubuntu_correct.pass.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/ubuntu_correct.pass.sh rename to shared/templates/pam_account_password_faillock_deny/tests/ubuntu_correct.pass.sh diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/ubuntu_correct_pamd.pass.sh b/shared/templates/pam_account_password_faillock_deny/tests/ubuntu_correct_pamd.pass.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/ubuntu_correct_pamd.pass.sh rename to shared/templates/pam_account_password_faillock_deny/tests/ubuntu_correct_pamd.pass.sh diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/ubuntu_empty_faillock_conf.fail.sh b/shared/templates/pam_account_password_faillock_deny/tests/ubuntu_empty_faillock_conf.fail.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/ubuntu_empty_faillock_conf.fail.sh rename to shared/templates/pam_account_password_faillock_deny/tests/ubuntu_empty_faillock_conf.fail.sh diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/ubuntu_missing_pamd.fail.sh b/shared/templates/pam_account_password_faillock_deny/tests/ubuntu_missing_pamd.fail.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/ubuntu_missing_pamd.fail.sh rename to shared/templates/pam_account_password_faillock_deny/tests/ubuntu_missing_pamd.fail.sh diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/ubuntu_multiple_pam_unix.fail.sh b/shared/templates/pam_account_password_faillock_deny/tests/ubuntu_multiple_pam_unix.fail.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/ubuntu_multiple_pam_unix.fail.sh rename to shared/templates/pam_account_password_faillock_deny/tests/ubuntu_multiple_pam_unix.fail.sh diff --git a/linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/ubuntu_wrong_value.fail.sh b/shared/templates/pam_account_password_faillock_deny/tests/ubuntu_wrong_value.fail.sh similarity index 100% rename from linux_os/guide/system/accounts/accounts-pam/locking_out_password_attempts/accounts_passwords_pam_faillock_deny/tests/ubuntu_wrong_value.fail.sh rename to shared/templates/pam_account_password_faillock_deny/tests/ubuntu_wrong_value.fail.sh