SV-268161r1131128_rule
V-268161
SRG-OS-000433-GPOS-00193
ANIX-00-001670
CAT II
10
Configure /etc/nixos/configuration.nix to enable ASLR.
Add the following Nix code to the NixOS Configuration, usually located in /etc/nixos/configuration.nix or /etc/nixos/flake.nix:
boot.kernel.sysctl = {
"kernel.randomize_va_space" = 2;
};
Rebuild and switch to the new NixOS configuration:
$ sudo nixos-rebuild switch
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.
V-268161
False
ANIX-00-001670
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.
M
5658