auth_pam_sudo_smartcard_enforce Enforce Multifactor Authentication for Privilege Escalation Through the sudo Command
All changes in this version
Title
Enforce Multifactor Authentication for Privilege Escalation Through the sudo Command
Control
/usr/bin/grep -Ec '^(auth\s+sufficient\s+pam_smartcard.so|auth\s+required\s+pam_deny.so)' /etc/pam.d/sudo
Discussion
The system _MUST_ be configured to enforce multifactor authentication when the sudo command is used to elevate privilege.
All users _MUST_ go through multifactor authentication to prevent unauthenticated access and potential compromise to the system.
IMPORTANT: Modification of Pluggable Authentication Modules (PAM) now require user authorization, or use of a Privacy Preferences Policy Control (PPPC) profile from MDM that authorizes modifying system administrator files or full disk access.
NOTE: /etc/pam.d/sudo will be automatically modified to its original state following any update or major upgrade to the operating system.
Related controls
ia-2.1, ia-2.2, ia-2.8
Fix
[source,bash]
----
/bin/cat > /etc/pam.d/sudo << SUDO_END
# sudo: auth account password session
auth sufficient pam_smartcard.so
auth required pam_opendirectory.so
auth required pam_deny.so
account required pam_permit.so
password required pam_deny.so
session required pam_permit.so
SUDO_END
/bin/chmod 444 /etc/pam.d/sudo
/usr/sbin/chown root:wheel /etc/pam.d/sudo
----