SV-268156r1131116_rule
V-268156
SRG-OS-000480-GPOS-00227
ANIX-00-001510
CAT II
10
Configure NixOS to require reauthentication for sudo.
Add the following Nix code to the NixOS Configuration, usually located in /etc/nixos/configuration.nix or /etc/nixos/flake.nix:
security.sudo.wheelNeedsPassword = true;
Rebuild and switch to the new NixOS configuration:
$ sudo nixos-rebuild switch
Verify NixOS requires users to reauthenticate when changing roles with the following command:
$ grep -iR "%wheel" /etc/sudoers
%wheel ALL=(ALL:ALL) SETENV: ALL
If the returned line contains "NOPASSWD", this is a finding.
V-268156
False
ANIX-00-001510
Verify NixOS requires users to reauthenticate when changing roles with the following command:
$ grep -iR "%wheel" /etc/sudoers
%wheel ALL=(ALL:ALL) SETENV: ALL
If the returned line contains "NOPASSWD", this is a finding.
M
5658