DISA STIGS Viewer

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

Overview

Finding ID Version Rule ID IA Controls Severity
V-268160 ANIX-00-001660 SV-268160r1039368_rule   Medium
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
STIG Date
Anduril NixOS Security Technical Implementation Guide 2024-10-25

Details

Check Text (C-72084r1039366_chk)
Verify NixOS prevents internal kernel addresses from being leaked with the following command:

$ sudo sysctl kernel.kptr_restrict

kernel.kptr_restrict = 1

If "kernel.kptr_restrict" does not have a value of "1" or is missing, this is a finding.
Fix Text (F-71987r1039367_fix)
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;
};

Rebuild the system with the following command:

$ sudo nixos-rebuild switch