Check: ANIX-00-001670
Anduril NixOS STIG:
ANIX-00-001670
(in version v1 r1)
Title
NixOS must implement address space layout randomization to protect its memory from unauthorized code execution. (Cat II impact)
Discussion
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.
Check Content
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
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
Additional Identifiers
Rule ID: SV-268161r1039371_rule
Vulnerability ID: V-268161
Group Title: SRG-OS-000433-GPOS-00193
Expert Comments
CCIs
Number | Definition |
---|---|
CCI-002824 |
Implement organization-defined controls to protect the system memory from unauthorized code execution. |
Controls
Number | Title |
---|---|
SI-16 |
Memory Protection |