← All rules
SOCLE-CLD-SYS-015// Kernel & network (sysctl)loweffective runtime

Disallow kernel profiling by unprivileged users

Sets kernel.perf_event_paranoid = 2 so unprivileged users cannot profile the kernel or raw CPU events.

Checked against the resolved running state (e.g. sshd -T, sysctl, systemctl show), catches drop-ins and Includes a file read would miss. Caveat: runtime ≠ persistence; a value correct now may not survive a reboot.

A pass proves✓ running now✓ on disk✓ survives rebootthe qualified verdict →
Debian 12CIS 1.1.0Debian 13CIS 1.0.0FedoraRHEL 10 / Rocky 10 / AlmaLinux 10RHEL 8 / Rocky 8 / AlmaLinux 8CIS 4.0.0RHEL 9 / Rocky 9 / AlmaLinux 9CIS 2.0.0Ubuntu 22.04CIS 3.0.0Ubuntu 24.04CIS 1.0.0Ubuntu 26.04
One check, maps to 2 standards

Pavois asserts the effective configuration, the live, resolved state, not a file. File-based scanners (OVAL/SCAP, Lynis) miss Includes, drop-ins and runtime defaults; this check sees what is actually applied.

A mapping is a cross-reference to where each standard places this requirement, anchored and cross-validated, not a claim of equivalence. A passing check is evidence toward these references, how to read it.

Why this rule matters

The Perf subsystem can expose detailed CPU, memory and instruction-level behaviour. If unprivileged users can profile the kernel, that telemetry can reveal sensitive information about kernel internals and side channels usable in exploitation. kernel.perf_event_paranoid = 2 disallows raw tracepoint, kernel and CPU-event access for unprivileged users, restricting profiling to privileged contexts.

What Pavois checks

Pavois reads the live kernel value with kernel_parameter('kernel.perf_event_paranoid') (equivalent to sysctl kernel.perf_event_paranoid), not a /etc/sysctl.d/*.conf line. A file declaring 2 is irrelevant if a later drop-in, a boot parameter, or a runtime sysctl -w left the kernel at a more permissive 1, 0 or -1. Only the effective parameter proves what unprivileged users are actually allowed to do.

describe kernel_parameter('kernel.perf_event_paranoid') do
  its('value') { should cmp 2 }
end
describe command("grep -hsE '^[[:space:]]*kernel.perf_event_paranoid[[:space:]]*=[[:space:]]*2([[:space:]]|$)' /etc/sysctl.conf /etc/sysctl.d/*.conf /run/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf 2>/dev/null") do
  its('stdout') { should match(/\S/) }
end

How to verify it is applied

Run sysctl kernel.perf_event_paranoid. Expected output:

kernel.perf_event_paranoid = 2

Inspect & investigate

No dedicated log line. Confirm with sysctl kernel.perf_event_paranoid. The effect is observable: as an unprivileged user, perf top or perf record -a will fail with a permission error referencing perf_event_paranoid once the value is 2.

Remediation

Pavois's harden plan uses the sysctl resource to set kernel.perf_event_paranoid = 2, persists it in a Pavois-managed drop-in under /etc/sysctl.d/, and applies it live (no reboot). Apply it with pavois harden apply.

Pavois applies this with its own harden engine, the plan below, not a shell script:

keykernel.perf_event_paranoid
resourcesysctl
value2
pavois harden plan local

where the target is local, a user@host SSH alias, or a container , Docs

Impact & precautions

Risk if not applied: unprivileged users can profile the kernel, leaking internals and side-channel data useful for exploitation.

Precautions before applying:

  • This breaks unprivileged profiling. Developers, CI runners, or observability agents that run perf as a non-root user will lose access. Grant the CAP_PERFMON/CAP_SYS_ADMIN capability or run those tools privileged where genuinely needed.
  • No application or boot lockout risk; the change is fully reversible at runtime.

Standards mapping

StandardReferenceTypeVersionConfidence
ANSSI BP-028R9direct2.0high
NISTAC-6supporting800-53 Rev 5 · 800-171 Rev 2 (pinned)medium

Each reference is a cross-reference anchored in the upstream benchmark and cross-validated against the SCAP Security Guide and ansible-lockdown, not a claim of equivalence. Direct = a prescriptive, line-level requirement; supporting = an abstract control family (NIST) the check provides evidence toward. How to read a mapping.

Sources & references