SV-268142r1131087_rule
V-268142
SRG-OS-000163-GPOS-00072
ANIX-00-000990
CAT II
10
Configure NixOS to automatically terminate all network connections associated with SSH traffic after being unresponsive for 10 minutes.
Add the following Nix code to the NixOS Configuration, usually located in /etc/nixos/configuration.nix or /etc/nixos/flake.nix:
services.openssh.extraConfig = ''
ClientAliveInterval 600
'';
Rebuild and switch to the new NixOS configuration:
$ sudo nixos-rebuild switch
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.
V-268142
False
ANIX-00-000990
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.
M
5658