SV-268174r1131156_rule
V-268174
SRG-OS-000118-GPOS-00060
ANIX-00-001930
CAT II
10
Configure NixOS to disable inactive users.
Add the following Nix code to the NixOS Configuration, usually located in /etc/nixos/configuration.nix or /etc/nixos/flake.nix:
Ensure the lib functions are available:
{ config, lib, ... }:
environment.etc."/default/useradd".text = lib.mkForce
''
INACTIVE=35
'';
Rebuild and switch to the new NixOS configuration:
$ sudo nixos-rebuild switch
Verify NixOS disables account identifiers (individuals, groups, roles, and devices) after 35 days of inactivity with the following command:
$ grep -i inactive /etc/default/useradd
INACTIVE=35
If INACTIVE is not set to 35 or less, or is missing or commented out, this is a finding.
V-268174
False
ANIX-00-001930
Verify NixOS disables account identifiers (individuals, groups, roles, and devices) after 35 days of inactivity with the following command:
$ grep -i inactive /etc/default/useradd
INACTIVE=35
If INACTIVE is not set to 35 or less, or is missing or commented out, this is a finding.
M
5658