Skip to content

Add hidepid Option to /proc

An XCCDF Rule

Description

The hidepid mount option is applicable to /proc and is used to control who can access the information in /proc/[pid] directories. The option can have one of the following values:

0: Everybody may access all /proc/[pid] directories.
1: Users may not access files and subdirectories inside any /proc/[pid] directories
   but their own. The /proc/[pid] directories themselves remain visible.
2: Same as for mode 1, but in addition the /proc/[pid] directories belonging to other
   users become invisible.
For example, if you choose the value 2: Add the hidepid=2 option to the fourth column of /etc/fstab for the line which controls mounting of /proc.

warning alert: Functionality Warning

Hiding the pid of processes may lead to problems with PolicyKit and D-Bus, it may also convey a false sense of security. Proceed to https://access.redhat.com/solutions/6704531 for more details.

Rationale

Users should not be able to see and access directories within /proc, which are not related to their own processes in a system. Otherwise, sensitive information from other users could be seem.

ID
xccdf_org.ssgproject.content_rule_mount_option_proc_hidepid
Severity
Low
References
Updated



Remediation - Shell Script

# Remediation is applicable only in certain platforms
if ( ! ( { rpm --quiet -q kernel ;} && { rpm --quiet -q rpm-ostree ;} && { rpm --quiet -q bootc ;} ) && ! ( [ -f /.dockerenv ] || [ -f /run/.containerenv ] ) ); then

function perform_remediation {
    


Remediation - Ansible

- name: Gather the package facts
  package_facts:
    manager: auto
  tags:
  - CCE-85882-9
  - configure_strategy