Enable Encrypted X11 Forwarding
An XCCDF Rule
Description
By default, remote X11 connections are not encrypted when initiated by users. SSH has the capability to encrypt remote X11 connections when SSH'sX11Forwarding
option is enabled.
To enable X11 Forwarding, add or correct the following line in
/etc/ssh/sshd_config
:
X11Forwarding yes
Rationale
Non-encrypted X displays allow an attacker to capture keystrokes and to execute commands remotely.
- ID
- xccdf_org.ssgproject.content_rule_sshd_enable_x11_forwarding
- Severity
- High
- References
- Updated
Remediation Templates
A Shell Script
# Remediation is applicable only in certain platforms
if dpkg-query --show --showformat='${db:Status-Status}
' 'kernel' 2>/dev/null | grep -q installed; then
if [ -e "/etc/ssh/sshd_config" ] ; then
LC_ALL=C sed -i "/^\s*X11Forwarding\s\+/Id" "/etc/ssh/sshd_config"
An Ansible Snippet
- name: Gather the package facts
package_facts:
manager: auto
tags:
- NIST-800-171-3.1.13
- NIST-800-53-AC-17(2)