Allow Only SSH Protocol 2
An XCCDF Rule
Description
Only SSH protocol version 2 connections should be permitted. The default setting in/etc/ssh/sshd_config
is correct, and can be
verified by ensuring that the following
line appears:
Protocol 2
warning alert: Warning
As of
openssh-server
version 7.4
and above, the only protocol
supported is version 2, and line Protocol 2in
/etc/ssh/sshd_config
is not necessary.Rationale
SSH protocol version 1 is an insecure implementation of the SSH protocol and has many well-known vulnerability exploits. Exploits of the SSH daemon could provide immediate root access to the system.
- ID
- xccdf_org.ssgproject.content_rule_sshd_allow_only_protocol2
- Severity
- High
- References
- Updated
Remediation Templates
A Shell Script
# Remediation is applicable only in certain platforms
if rpm --quiet -q kernel; then
# Find the include keyword, extract from the line the glob expression representing included files.
# And if it is a relative path prepend '/etc/ssh/'
included_files=$(grep -oP "^\s*(?i)include.*" /etc/ssh/sshd_config | sed -e 's/\s*include\s*//I' | sed -e 's|^[^/]|/etc/ssh/&|')
for included_file in ${included_files} ; do
An Ansible Snippet
- name: Gather the package facts
package_facts:
manager: auto
tags:
- CJIS-5.5.6
- NIST-800-171-3.1.13