RHEL 9 must restrict usage of ptrace to descendant processes.
An XCCDF Rule
Description
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
- ID
- SV-257811r1044872_rule
- Version
- RHEL-09-213080
- Severity
- Medium
- References
- Updated
Remediation Templates
A Manual Procedure
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: