STIGUI
V-268156CAT II — Medium severitySV-268156r1131116_rule

NixOS must require users to reauthenticate when changing roles.

Rule version ANIX-00-001510 · STIG v1 · 2025-08-19

Discussion

Without reauthentication, users may access resources or perform tasks for which they do not have authorization.

When operating systems provide the capability to change security roles, it is critical the user reauthenticate.

Check

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.

Fix

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

Identifiers

Group ID
V-268156
Group title
SRG-OS-000480-GPOS-00227
Rule ID
SV-268156r1131116_rule
Check ID
C-72080r1131114_chk
Fix ID
F-71983r1131115_fix