Check: ANIX-00-000990
Anduril NixOS STIG:
ANIX-00-000990
(in version v1 r1)
Title
NixOS must terminate all SSH connections after 10 minutes of becoming unresponsive. (Cat II impact)
Discussion
Terminating an idle session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended. In addition, quickly terminating an idle session will also free up resources committed by the managed network element. Terminating network connections associated with communications sessions includes, for example, de-allocating associated TCP/IP address/port pairs at the operating system level, and de-allocating networking assignments at the application level if multiple application sessions are using a single operating system-level network connection. This does not mean that the operating system terminates all sessions or network access; it only ends the inactive session and releases the resources associated with that session. Satisfies: SRG-OS-000163-GPOS-00072, SRG-OS-000279-GPOS-00109, SRG-OS-000395-GPOS-00175
Check Content
Verify that all network connections associated with SSH traffic are automatically terminated after 10 minutes of becoming unresponsive with the following command: $ grep -i clientaliveinterval /etc/ssh/sshd_config ClientAliveInterval 600 If "ClientAliveInterval" does not have a value of "600" or less, is commented out, or is missing, this is a finding.
Fix Text
Configure NixOS to automatically terminate all network connections associated with SSH traffic after being unresponsive for 10 minutes. Add or edit the following in the NixOS configuration: /etc/nixos/configuration.nix: services.openssh.extraConfig = '' ClientAliveInterval 600 ''; Rebuild the NixOS configuration with the following command: $ sudo nixos-rebuild switch
Additional Identifiers
Rule ID: SV-268142r1039535_rule
Vulnerability ID: V-268142
Group Title: SRG-OS-000163-GPOS-00072
Expert Comments
CCIs
Number | Definition |
---|---|
CCI-001133 |
Terminate the network connection associated with a communications session at the end of the session or after an organization-defined time period of inactivity. |
CCI-002361 |
Automatically terminate a user session after organization-defined conditions or trigger events requiring session disconnect. |
CCI-002891 |
Verify session and network connection termination after the completion of nonlocal maintenance and diagnostic sessions. |