Check: ANIX-00-001450
Anduril NixOS STIG:
ANIX-00-001450
(in version v1 r1)
Title
NixOS must prohibit user installation of system software without explicit privileged status. (Cat II impact)
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 Content
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 Text
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
Additional Identifiers
Rule ID: SV-268152r1039344_rule
Vulnerability ID: V-268152
Group Title: SRG-OS-000362-GPOS-00149
Expert Comments
CCIs
Number | Definition |
---|---|
CCI-003980 |
Allow user installation of software only with explicit privileged status. |
Controls
Number | Title |
---|---|
No controls are assigned to this check |