SV-230769r599842_rule
V-230769
SRG-OS-000033-GPOS-00014
APPL-11-000056
CAT II
10
Configure SSH to use a secure Key Exchange Algorithm.
To ensure that "KexAlgorithms" set correctly, run the following command:
/usr/bin/sudo /usr/bin/grep -q '^KexAlgorithms' /etc/ssh/sshd_config && /usr/bin/sudo /usr/bin/sed -i.bak 's/^KexAlgorithms.*/KexAlgorithms diffie-hellman-group-exchange-sha256/' /etc/ssh/sshd_config || /usr/bin/sudo /usr/bin/sed -i.bak '/.*Ciphers and keying.*/a\'$'\n''KexAlgorithms diffie-hellman-group-exchange-sha256'$'\n' /etc/ssh/sshd_config
The SSH service must be restarted for changes to take effect.
If SSH is not being used, this is Not Applicable.
Inspect the "KexAlgorithms" configuration with the following command:
Note: The location of the "sshd_config" file may vary if a different daemon is in use.
/usr/bin/grep "^KexAlgorithms" /etc/ssh/sshd_config
KexAlgorithms diffie-hellman-group-exchange-sha256
If any algorithm other than "diffie-hellman-group-exchange-sha256" is listed or the "KexAlgorithms" keyword is missing, this is a finding.
V-230769
False
APPL-11-000056
If SSH is not being used, this is Not Applicable.
Inspect the "KexAlgorithms" configuration with the following command:
Note: The location of the "sshd_config" file may vary if a different daemon is in use.
/usr/bin/grep "^KexAlgorithms" /etc/ssh/sshd_config
KexAlgorithms diffie-hellman-group-exchange-sha256
If any algorithm other than "diffie-hellman-group-exchange-sha256" is listed or the "KexAlgorithms" keyword is missing, this is a finding.
M
5246