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

Severity
Group ID
Group Title
Version
Rule ID
Date
STIG Version
mediumV-268152SRG-OS-000362-GPOS-00149ANIX-00-001450SV-268152r1039344_rule2024-10-251
Description
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 /etc/nixos/configuration.nix to prevent unauthorized users from using nix by adding the following configuration settings: nix.settings.allowed-users = [ "root" "@wheel" ]; Note: extra usergroups may be permitted by adding them with the format "@group" (e.g.: "@users"). Rebuild the system with the following command: $ sudo nixos-rebuild switch