SV-268160r1131126_rule
V-268160
SRG-OS-000433-GPOS-00192
ANIX-00-001660
CAT II
10
Configure NixOS to prevent internal kernel addresses from being leaked.
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.kptr_restrict" = 1;
};
Rebuild and switch to the new NixOS configuration:
$ sudo nixos-rebuild switch
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.
V-268160
False
ANIX-00-001660
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.
M
5658