RHEL-09-213080 - RHEL 9 must restrict usage of ptrace to descendant processes.

Information

Unrestricted usage of ptrace allows compromised binaries to run ptrace on other processes of the user. Like this, the attacker can steal sensitive information from the target processes (e.g., SSH sessions, web browser, etc.) without any additional assistance from the user (i.e., without resorting to phishing).

Satisfies: SRG-OS-000132-GPOS-00067, SRG-OS-000480-GPOS-00227

Solution

Configure the currently loaded kernel parameter to the secure setting:

$ sudo sysctl -w kernel.yama.ptrace_scope=1

Configure RHEL 9 to restrict usage of ptrace to descendant processes by adding the following line to a file in the "/etc/sysctl.d" directory:

kernel.yama.ptrace_scope = 1

The system configuration files must be reloaded for the changes to take effect. To reload the contents of the files, run the following command:

$ sysctl --system

See Also

https://dl.dod.cyber.mil/wp-content/uploads/stigs/zip/U_RHEL_9_V2R3_STIG.zip

Item Details

Category: SYSTEM AND COMMUNICATIONS PROTECTION

References: 800-53|SC-2, CAT|II, CCI|CCI-001082, Rule-ID|SV-257811r1044872_rule, STIG-ID|RHEL-09-213080, Vuln-ID|V-257811

Plugin: Unix

Control ID: e055db6d582ed47bcfd89ce4171d4596bddddcb3ec84e15d4b1c128dc6afbf88