Skip to content

NixOS must implement nonexecutable data to protect its memory from unauthorized code execution.

An XCCDF Rule

Description

Some adversaries launch attacks with the intent of executing code in nonexecutable regions of memory or in memory locations that are prohibited. Security safeguards employed to protect memory include, for example, data execution prevention and address space layout randomization. Data execution prevention safeguards can either be hardware-enforced or software-enforced with hardware providing the greater strength of mechanism. Examples of attacks are buffer overflow attacks. Satisfies: SRG-OS-000433-GPOS-00192, SRG-OS-000132-GPOS-00067

ID
SV-268160r1039368_rule
Version
ANIX-00-001660
Severity
Medium
References
Updated

Remediation Templates

A Manual Procedure

Configure NixOS to prevent internal kernel addresses from being leaked by editing /etc/nixos/configuration.nix to add the following:

 boot.kernel.sysctl = {
"kernel.kptr_restrict" = 1;
};