Ensure the Group Used by pam_wheel.so Module Exists on System and is Empty
An XCCDF Rule
Description
Ensure that the group
referenced by
var_pam_wheel_group_for_su
variable and used as value for the pam_wheel.so
group
option exists and has no members. This empty group used by
pam_wheel.so
in /etc/pam.d/su
ensures that no user can run commands with
altered privileges through the su
command.
warning alert: Warning
Note that this rule just ensures the group exists and has no members. This rule does not
configure
pam_wheel.so
module. The pam_wheel.so
module configuration is
accomplished by use_pam_wheel_group_for_su
rule.Rationale
The su
program allows to run commands with a substitute user and group ID.
It is commonly used to run commands as the root user.
Limiting access to such command is considered a good security practice.
- ID
- xccdf_org.ssgproject.content_rule_ensure_pam_wheel_group_empty
- Severity
- Medium
- Updated
Remediation - Shell Script
# Remediation is applicable only in certain platforms
if dpkg-query --show --showformat='${db:Status-Status}\n' 'libpam-runtime' 2>/dev/null | grep -q installed; then
var_pam_wheel_group_for_su='<xccdf-1.2:sub xmlns:xccdf-1.2="http://checklists.nist.gov/xccdf/1.2" idref="xccdf_org.ssgproject.content_value_var_pam_wheel_group_for_su" use="legacy"/>'
Remediation - Ansible
- name: Gather the package facts
package_facts:
manager: auto
tags:
- PCI-DSSv4-2.2.6
- ensure_pam_wheel_group_empty