SV-268143r1131089_rule
V-268143
SRG-OS-000163-GPOS-00072
ANIX-00-001000
CAT II
10
Configure NixOS to automatically terminate all network connections associated with SSH traffic after being unresponsive.
Add the following Nix code to the NixOS Configuration, usually located in /etc/nixos/configuration.nix or /etc/nixos/flake.nix:
services.openssh.extraConfig = ''
ClientAliveCountMax 1
'';
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 becoming unresponsive with the following command:
$ grep -i clientalivecount /etc/ssh/sshd_config
ClientAliveCountMax 1
If "ClientAliveCountMax" is not set to "1", is commented out, or is missing, this is a finding.
V-268143
False
ANIX-00-001000
Verify that all network connections associated with SSH traffic are automatically terminated after becoming unresponsive with the following command:
$ grep -i clientalivecount /etc/ssh/sshd_config
ClientAliveCountMax 1
If "ClientAliveCountMax" is not set to "1", is commented out, or is missing, this is a finding.
M
5658