SV-268138r1131081_rule
V-268138
SRG-OS-000109-GPOS-00056
ANIX-00-000900
CAT II
10
Configure NixOS to ensure the root user is locked.
Add the following Nix code to the NixOS Configuration, usually located in /etc/nixos/configuration.nix or /etc/nixos/flake.nix:
users.mutableUsers = false;
Rebuild and switch to the new NixOS configuration:
$ sudo nixos-rebuild switch
Verify the NixOS operating system prevents directly logging in to the root account with the following command:
$ sudo passwd -S root
root L 01/02/1970 -1 -1 -1 -1
If the second field in the output is not "L" or "NP", then the root account is not locked and has a password configured, and this is a finding.
V-268138
False
ANIX-00-000900
Verify the NixOS operating system prevents directly logging in to the root account with the following command:
$ sudo passwd -S root
root L 01/02/1970 -1 -1 -1 -1
If the second field in the output is not "L" or "NP", then the root account is not locked and has a password configured, and this is a finding.
M
5658