Blame SOURCES/scap-security-guide-0.1.55-add_sshd_x11_proxy_localhost-PR_6534.patch

a297d8
From 389d25be2b69e4e5c828d9b0b72573e0962cabb4 Mon Sep 17 00:00:00 2001
a297d8
From: Vojtech Polasek <vpolasek@redhat.com>
a297d8
Date: Wed, 13 Jan 2021 17:07:48 +0100
a297d8
Subject: [PATCH 1/4] add rule
a297d8
a297d8
---
a297d8
 .../sshd_x11_use_localhost/rule.yml           | 43 +++++++++++++++++++
a297d8
 shared/references/cce-redhat-avail.txt        |  3 --
a297d8
 2 files changed, 43 insertions(+), 3 deletions(-)
a297d8
 create mode 100644 linux_os/guide/services/ssh/ssh_server/sshd_x11_use_localhost/rule.yml
a297d8
a297d8
diff --git a/linux_os/guide/services/ssh/ssh_server/sshd_x11_use_localhost/rule.yml b/linux_os/guide/services/ssh/ssh_server/sshd_x11_use_localhost/rule.yml
a297d8
new file mode 100644
a297d8
index 0000000000..67131e509c
a297d8
--- /dev/null
a297d8
+++ b/linux_os/guide/services/ssh/ssh_server/sshd_x11_use_localhost/rule.yml
a297d8
@@ -0,0 +1,43 @@
a297d8
+documentation_complete: true
a297d8
+
a297d8
+prodtype: fedora,ol7,rhel7
a297d8
+
a297d8
+title: 'Prevent remote hosts from connecting to the proxy display'
a297d8
+
a297d8
+description: |-
a297d8
+    The SSH daemon should prevent remote hosts from connecting to the proxy
a297d8
+    display. Make sure that the option <tt>X11UseLocalhost</tt> is set to
a297d8
+    <tt>yes</tt> within the SSH server configuration file.
a297d8
+
a297d8
+
a297d8
+rationale: |-
a297d8
+    When X11 forwarding is enabled, there may be additional exposure to the
a297d8
+    server and client displays if the sshd proxy display is configured to listen
a297d8
+    on the wildcard address. By default, sshd binds the forwarding server to the
a297d8
+    loopback address and sets the hostname part of the <tt>DISPLAY</tt>
a297d8
+    environment variable to localhost. This prevents remote hosts from
a297d8
+    connecting to the proxy display.  
a297d8
+
a297d8
+severity: medium
a297d8
+
a297d8
+identifiers:
a297d8
+    cce@rhel7: CCE-83404-4
a297d8
+
a297d8
+references:
a297d8
+    srg: SRG-OS-000480-GPOS-00227
a297d8
+    stig@rhel7: RHEL-07-040711
a297d8
+    disa: CCI-000366
a297d8
+    nist: CM-6(b)
a297d8
+
a297d8
+ocil_clause: "the display proxy is listening on wildcard address"
a297d8
+
a297d8
+ocil: |-
a297d8
+    {{{ ocil_sshd_option(default="yes", option="X11UseLocalhost", value="yes") }}}
a297d8
+
a297d8
+template:
a297d8
+    name: sshd_lineinfile
a297d8
+    vars:
a297d8
+        missing_parameter_pass: 'false'
a297d8
+        parameter: X11UseLocalhost
a297d8
+        rule_id: sshd_x11_use_localhost
a297d8
+        value: 'yes'
a297d8
From a40b9e68305afb52c2c674848b71cbcaee25fe32 Mon Sep 17 00:00:00 2001
a297d8
From: Vojtech Polasek <vpolasek@redhat.com>
a297d8
Date: Wed, 13 Jan 2021 17:08:08 +0100
a297d8
Subject: [PATCH 2/4] add rule to the stig profile
a297d8
a297d8
---
a297d8
 rhel7/profiles/stig.profile | 1 +
a297d8
 1 file changed, 1 insertion(+)
a297d8
a297d8
diff --git a/rhel7/profiles/stig.profile b/rhel7/profiles/stig.profile
a297d8
index 88b50d5ef4..817e0982e5 100644
a297d8
--- a/rhel7/profiles/stig.profile
a297d8
+++ b/rhel7/profiles/stig.profile
a297d8
@@ -286,6 +286,7 @@ selections:
a297d8
     - package_vsftpd_removed
a297d8
     - package_tftp-server_removed
a297d8
     - sshd_enable_x11_forwarding
a297d8
+    - sshd_x11_use_localhost
a297d8
     - tftpd_uses_secure_mode
a297d8
     - package_xorg-x11-server-common_removed
a297d8
     - xwindows_runlevel_target
a297d8
a297d8
From be2f96b80fbfb74708381e15a2a6e76c3952bbb5 Mon Sep 17 00:00:00 2001
a297d8
From: vojtapolasek <krecoun@gmail.com>
a297d8
Date: Fri, 15 Jan 2021 07:46:09 +0100
a297d8
Subject: [PATCH 4/4] Update
a297d8
 linux_os/guide/services/ssh/ssh_server/sshd_x11_use_localhost/rule.yml
a297d8
a297d8
Co-authored-by: Gabriel Becker <ggasparb@redhat.com>
a297d8
---
a297d8
 .../services/ssh/ssh_server/sshd_x11_use_localhost/rule.yml     | 2 +-
a297d8
 1 file changed, 1 insertion(+), 1 deletion(-)
a297d8
a297d8
diff --git a/linux_os/guide/services/ssh/ssh_server/sshd_x11_use_localhost/rule.yml b/linux_os/guide/services/ssh/ssh_server/sshd_x11_use_localhost/rule.yml
a297d8
index 67131e509c..7267d2443a 100644
a297d8
--- a/linux_os/guide/services/ssh/ssh_server/sshd_x11_use_localhost/rule.yml
a297d8
+++ b/linux_os/guide/services/ssh/ssh_server/sshd_x11_use_localhost/rule.yml
a297d8
@@ -37,7 +37,7 @@ ocil: |-
a297d8
 template:
a297d8
     name: sshd_lineinfile
a297d8
     vars:
a297d8
-        missing_parameter_pass: 'false'
a297d8
+        missing_parameter_pass: 'true'
a297d8
         parameter: X11UseLocalhost
a297d8
         rule_id: sshd_x11_use_localhost
a297d8
         value: 'yes'