diff --git a/components/pam.yml b/components/pam.yml index bd2b849cc22..25e5b86eb50 100644 --- a/components/pam.yml +++ b/components/pam.yml @@ -61,6 +61,7 @@ rules: - accounts_password_pam_pwquality_system_auth - accounts_password_pam_retry - accounts_password_pam_ucredit +- accounts_password_pam_unix_enabled - accounts_password_pam_unix_remember - accounts_password_pam_unix_rounds_password_auth - accounts_password_pam_unix_rounds_system_auth diff --git a/controls/cis_ubuntu2404.yml b/controls/cis_ubuntu2404.yml index e77fafe0867..c026f841bfe 100644 --- a/controls/cis_ubuntu2404.yml +++ b/controls/cis_ubuntu2404.yml @@ -1850,8 +1850,9 @@ controls: levels: - l1_server - l1_workstation - status: planned - notes: TODO. Rule does not seem to be implemented, nor does it map to any rules in ubuntu2204 profile. + rules: + - accounts_password_pam_unix_enabled + status: automated - id: 5.3.2.2 title: Ensure pam_faillock module is enabled (Automated) diff --git a/linux_os/guide/system/accounts/accounts-pam/accounts_password_pam_unix_enabled/bash/shared.sh b/linux_os/guide/system/accounts/accounts-pam/accounts_password_pam_unix_enabled/bash/shared.sh new file mode 100644 index 00000000000..cb2c8b7a15c --- /dev/null +++ b/linux_os/guide/system/accounts/accounts-pam/accounts_password_pam_unix_enabled/bash/shared.sh @@ -0,0 +1,3 @@ +# platform = multi_platform_ubuntu + +{{{ bash_pam_unix_enable() }}} diff --git a/linux_os/guide/system/accounts/accounts-pam/accounts_password_pam_unix_enabled/oval/shared.xml b/linux_os/guide/system/accounts/accounts-pam/accounts_password_pam_unix_enabled/oval/shared.xml new file mode 100644 index 00000000000..4fdb39e2570 --- /dev/null +++ b/linux_os/guide/system/accounts/accounts-pam/accounts_password_pam_unix_enabled/oval/shared.xml @@ -0,0 +1,36 @@ +{{% set file_stem = ["auth","account","password","session"] %}} + + + {{{ oval_metadata("Ensure pam_unix.so is properly configured in PAM configuration files") }}} + + {{% for stem in file_stem %}} + + {{% endfor %}} + + + + + {{% macro test_pam_unix(stem) %}} + + + + {{% endmacro %}} + + {{% macro object_pam_unix(stem) %}} + + /etc/pam.d/common-{{{ stem }}} + ^[\s]*{{{stem}}}[\s]+(required|\[(?=.*?\bsuccess=\d+\b)?(?=.*?\bnew_authtok_reqd=ok\b)?(?=.*?\bdefault=ignore\b)?.*\])[\s]+pam_unix\.so.*$ + 1 + + {{% endmacro %}} + + {{% for file in file_stem %}} + {{{ test_pam_unix(stem=file) }}} + {{{ object_pam_unix(stem=file) }}} + {{% endfor %}} + + diff --git a/linux_os/guide/system/accounts/accounts-pam/accounts_password_pam_unix_enabled/rule.yml b/linux_os/guide/system/accounts/accounts-pam/accounts_password_pam_unix_enabled/rule.yml new file mode 100644 index 00000000000..388433b8956 --- /dev/null +++ b/linux_os/guide/system/accounts/accounts-pam/accounts_password_pam_unix_enabled/rule.yml @@ -0,0 +1,30 @@ +documentation_complete: true + + +title: Verify pam_unix module is activated + +description: |- + pam_unix is the standard Unix authentication module. It uses standard calls from the + system's libraries to retrieve and set account information as well as authentication. + Usually this is obtained from the /etc/passwd and if shadow is enabled, the + /etc/shadow file as well. +

+ The account component performs the task of establishing the status of the user's + account and password based on the following shadow elements: expire, + last_change, max_change, min_change, warn_change. In the case of the latter, it may + offer advice to the user on changing their password or, through the + PAM_AUTHTOKEN_REQD return, delay giving service to the user until they have + established a new password. The entries listed above are documented in the shadow(5) + manual page. Should the user's record not contain one or more of these entries, the + corresponding shadow check is not performed. +

+ The authentication component performs the task of checking the users credentials + (password). The default action of this module is to not permit the user access to a + service if their official password is blank. + +rationale: |- + The system should only provide access after performing authentication of a user. + +severity: medium + +platform: package[pam]