5.3.7 Ensure access to the su command is restricted
Audit#
Run the following command:
# grep -Pi '^\h*auth\h+(?:required|requisite)\h+pam_wheel\.so\h+(?:[^#\n\r]+\h+)?((?!\2)(use_uid\b|group=\H+\b))\h+(?:[^#\n\r]+\h+)?((?!\1)(use_uid\b|group=\H+\b))(\h+.*)?$' /etc/pam.d/su
Verify the output matches:
Run the following command and verify that the group specified in
Verify the output does not contain any users in the relevant group:
Remediation#
Create an empty group that will be specified for use of the su command. The group should be named according to site policy.
Example:
Add the following line to the /etc/pam.d/su file, specifying the empty group: