DISA STIGS Viewer

NixOS must implement address space layout randomization to protect its memory from unauthorized code execution.

Overview

Finding ID Version Rule ID IA Controls Severity
V-268161 ANIX-00-001670 SV-268161r1039371_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.
STIG Date
Anduril NixOS Security Technical Implementation Guide 2024-10-25

Details

Check Text (C-72085r1039369_chk)
Verify NixOS enables address space layout randomization with the following command:

$ sudo sysctl kernel.randomize_va_space

kernel.randomize_va_space = 2

If "kernel.randomize_va_space" does not have a value of "2" or is missing, this is a finding.
Fix Text (F-71988r1039370_fix)
Configure /etc/nixos/configuration.nix to enable ASLR by adding the following configuration settings:

boot.kernel.sysctl = {
"kernel.randomize_va_space" = 2;
};

Rebuild the system with the following command:

$ sudo nixos-rebuild switch