Skip to content
MediumOS hardeningBLWK-KERNEL-001

ptrace scope allows tracing sibling processes ​

What this means ​

ptrace is unrestricted: kernel.yama.ptrace_scope is 0 (or the Yama LSM isn't loaded at all, which the collector reports the same way, since without Yama there is no restriction to begin with). Any process can attach to and read the memory of any other process owned by the same user — including credential-scraping via /proc/<pid>/mem, a documented credential-access technique.

How to fix it ​

Set kernel.yama.ptrace_scope=1 via /etc/sysctl.d/ and run sysctl --system.

Check it yourself ​

Run a scan and look for BLWK-KERNEL-001 in the results:

sh
bulwark scan

Installed the standalone CLI package instead of the app? The command is bulwarkctl.

How Bulwark decides

Bulwark reads sysctl_kernel and reports this check when:

text
ptrace_scope == 0

If a value can't be read, Bulwark reports the check as undetermined rather than passing it. View the rule source.

References ​

Released under the Apache License 2.0.