Skip to content

NixOS must terminate all SSH connections after becoming unresponsive.

An XCCDF Rule

Description

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.

ID
SV-268143r1039317_rule
Version
ANIX-00-001000
Severity
Medium
References
Updated

Remediation Templates

A Manual Procedure

Configure NixOS to automatically terminate all network connections associated with SSH traffic after being unresponsive. 

Add or edit the following in the NixOS configuration: /etc/nixos/configuration.nix:

services.openssh.extraConfig = ''
 ClientAliveCountMax 1