Enable Kernel Page-Table Isolation (KPTI)
Requires the pti=on kernel boot parameter to force Kernel Page-Table Isolation, mitigating Meltdown and protecting KASLR.
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.
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
Kernel Page-Table Isolation (KPTI) keeps the kernel's page tables separate from user-space ones, so a user process can no longer read kernel memory through the Meltdown (CVE-2017-5754) side channel. It also strengthens the kernel against attempts to defeat KASLR by leaking kernel addresses. Forcing pti=on ensures the mitigation is active even on CPUs where the kernel might otherwise auto-disable it.
What Pavois checks
Pavois reads the live kernel command line from /proc/cmdline and checks for pti=on. This is the boot line the running kernel parsed, not /etc/default/grub, a GRUB edit never regenerated would pass a file scan while PTI is still off. You can confirm the actual mitigation status via /sys/devices/system/cpu/vulnerabilities/meltdown.
describe command('cat /proc/cmdline') do
its('stdout') { should match(/(^| )pti=on( |$)/) }
end
describe command("grep -hwsF 'pti=on' /etc/default/grub /etc/kernel/cmdline /boot/grub/grub.cfg /boot/grub2/grub.cfg /boot/efi/EFI/*/grub.cfg 2>/dev/null") do
its('stdout') { should match(/\S/) }
endHow to verify it is applied
Run cat /proc/cmdline and confirm it contains pti=on. Confirm the mitigation is active with:
cat /sys/devices/system/cpu/vulnerabilities/meltdown
Expected output reports Mitigation: PTI.
Inspect & investigate
Mitigation state is exposed under sysfs: cat /sys/devices/system/cpu/vulnerabilities/meltdown. The kernel also logs PTI at boot, dmesg | grep -iE 'page table isolation|pti' or journalctl -k | grep -i pti.
Remediation
pavois harden apply uses the kernel_cmdline resource to add pti=on to the bootloader configuration and regenerate it, so the option is present on next boot. A reboot is required to take effect.
Pavois applies this with its own harden engine, the plan below, not a shell script:
| param | pti=on |
|---|---|
| reboot_required | true |
| resource | kernel_cmdline |
pavois harden plan localwhere the target is local, a user@host SSH alias, or a container , Docs
Impact & precautions
KPTI adds a measurable performance cost for syscall-heavy workloads (extra TLB flushes on kernel/user transitions), historically up to ~5-30% for I/O-bound or syscall-intensive applications. Precautions:
- Benchmark databases, high-IOPS storage and proxies before enabling fleet-wide.
- On CPUs not affected by Meltdown, forcing
pti=onpays the cost without added security; weigh per platform. - Applies after reboot only, schedule a maintenance window.
Standards mapping
| Standard | Reference | Type | Version | Confidence |
|---|---|---|---|---|
| ANSSI BP-028 | R8 | direct | 2.0 | high |
| NIST | SI-16 | supporting | 800-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.