STIGUI
V-268152CAT II — Medium severitySV-268152r1131105_rule

NixOS must prohibit user installation of system software without explicit privileged status.

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

Discussion

Allowing regular users to install software, without explicit privileges, creates the risk that untested or potentially malicious software will be installed on the system. Explicit privileges (escalated or administrative privileges) provide the regular user with explicit capabilities and control that exceeds the rights of a regular user.

Operating system functionality will vary, and while users are not permitted to install unapproved software, there may be instances where the organization allows the user to install approved software packages, such as from an approved software repository.

The operating system or software configuration management utility must enforce control of software installation by users based upon what types of software installations are permitted (e.g., updates and security patches to existing software) and what types of installations are prohibited (e.g., software whose pedigree with regard to being potentially malicious is unknown or suspect) by the organization.

Check

Verify NixOS prevents unauthorized users from using nix with the following command:

$ grep -R allowed-users /etc/nixos/

/etc/nixos/configuration.nix:nix.settings.allowed-users = [ "root" "@wheel" ];

If any other groups or users are included in "nix.settings.allowed-users" other than "root" and "wheel", or the configuration setting does not exist, this is a finding.

Fix

Configure NixOS to prevent unauthorized users from using nix.

Add the following Nix code to the NixOS Configuration, usually located in /etc/nixos/configuration.nix or /etc/nixos/flake.nix:

nix.settings.allowed-users = [ "root" "@wheel" ];

Note: Extra usergroups may be permitted by adding them with the format "@group" (e.g.: "@users").

Rebuild and switch to the new NixOS configuration: $ sudo nixos-rebuild switch

Identifiers

Group ID
V-268152
Group title
SRG-OS-000362-GPOS-00149
Rule ID
SV-268152r1131105_rule
Check ID
C-72076r1039342_chk
Fix ID
F-71979r1131104_fix