Blame SOURCES/scap-security-guide-0.1.64-stig_readd_ssh_rules-PR_9318.patch

792d3d
From e368a515911cd09727d8cd1c7e8b46dc7bdff4fa Mon Sep 17 00:00:00 2001
792d3d
From: Gabriel Becker <ggasparb@redhat.com>
792d3d
Date: Tue, 9 Aug 2022 17:28:33 +0200
792d3d
Subject: [PATCH] Reintroduce back the sshd timeout rules in RHEL8 STIG
792d3d
 profile.
792d3d
792d3d
---
792d3d
 .../ssh/ssh_server/sshd_set_idle_timeout/rule.yml  |  1 +
792d3d
 .../ssh/ssh_server/sshd_set_keepalive_0/rule.yml   |  1 +
792d3d
 products/rhel8/profiles/stig.profile               | 14 +++++++-------
792d3d
 tests/data/profile_stability/rhel8/stig.profile    |  2 ++
792d3d
 .../data/profile_stability/rhel8/stig_gui.profile  |  2 ++
792d3d
 5 files changed, 13 insertions(+), 7 deletions(-)
792d3d
792d3d
diff --git a/linux_os/guide/services/ssh/ssh_server/sshd_set_idle_timeout/rule.yml b/linux_os/guide/services/ssh/ssh_server/sshd_set_idle_timeout/rule.yml
792d3d
index 46ea0558a42..1e9c6172758 100644
792d3d
--- a/linux_os/guide/services/ssh/ssh_server/sshd_set_idle_timeout/rule.yml
792d3d
+++ b/linux_os/guide/services/ssh/ssh_server/sshd_set_idle_timeout/rule.yml
792d3d
@@ -57,6 +57,7 @@ references:
792d3d
     stigid@ol7: OL07-00-040320
792d3d
     stigid@ol8: OL08-00-010201
792d3d
     stigid@rhel7: RHEL-07-040320
792d3d
+    stigid@rhel8: RHEL-08-010201
792d3d
     stigid@sle12: SLES-12-030190
792d3d
     stigid@sle15: SLES-15-010280
792d3d
     stigid@ubuntu2004: UBTU-20-010037
792d3d
diff --git a/linux_os/guide/services/ssh/ssh_server/sshd_set_keepalive_0/rule.yml b/linux_os/guide/services/ssh/ssh_server/sshd_set_keepalive_0/rule.yml
792d3d
index 0f0693ddc6c..f6e98a61d9a 100644
792d3d
--- a/linux_os/guide/services/ssh/ssh_server/sshd_set_keepalive_0/rule.yml
792d3d
+++ b/linux_os/guide/services/ssh/ssh_server/sshd_set_keepalive_0/rule.yml
792d3d
@@ -53,6 +53,7 @@ references:
792d3d
     stigid@ol7: OL07-00-040340
792d3d
     stigid@ol8: OL08-00-010200
792d3d
     stigid@rhel7: RHEL-07-040340
792d3d
+    stigid@rhel8: RHEL-08-010200
792d3d
     stigid@sle12: SLES-12-030191
792d3d
     stigid@sle15: SLES-15-010320
792d3d
     vmmsrg: SRG-OS-000480-VMM-002000
792d3d
diff --git a/products/rhel8/profiles/stig.profile b/products/rhel8/profiles/stig.profile
792d3d
index 6b44436a2b1..124b7520d3a 100644
792d3d
--- a/products/rhel8/profiles/stig.profile
792d3d
+++ b/products/rhel8/profiles/stig.profile
792d3d
@@ -170,13 +170,13 @@ selections:
792d3d
     # RHEL-08-010190
792d3d
     - dir_perms_world_writable_sticky_bits
792d3d
 
792d3d
-    # These two items don't behave as they used to in RHEL8.6 and RHEL9
792d3d
-    # anymore. They will be disabled for now until an alternative
792d3d
-    # solution is found.
792d3d
-    # # RHEL-08-010200
792d3d
-    # - sshd_set_keepalive_0
792d3d
-    # # RHEL-08-010201
792d3d
-    # - sshd_set_idle_timeout
792d3d
+    # Although these rules have a different behavior in RHEL>=8.6
792d3d
+    # they still need to be selected so it follows exactly what STIG
792d3d
+    # states.
792d3d
+    # RHEL-08-010200
792d3d
+    - sshd_set_keepalive_0
792d3d
+    # RHEL-08-010201
792d3d
+    - sshd_set_idle_timeout
792d3d
 
792d3d
     # RHEL-08-010210
792d3d
     - file_permissions_var_log_messages
792d3d
diff --git a/tests/data/profile_stability/rhel8/stig.profile b/tests/data/profile_stability/rhel8/stig.profile
792d3d
index 47f53a9d023..6c75d0ae1b1 100644
792d3d
--- a/tests/data/profile_stability/rhel8/stig.profile
792d3d
+++ b/tests/data/profile_stability/rhel8/stig.profile
792d3d
@@ -369,6 +369,8 @@ selections:
792d3d
 - sshd_enable_warning_banner
792d3d
 - sshd_print_last_log
792d3d
 - sshd_rekey_limit
792d3d
+- sshd_set_idle_timeout
792d3d
+- sshd_set_keepalive_0
792d3d
 - sshd_use_strong_rng
792d3d
 - sshd_x11_use_localhost
792d3d
 - sssd_certificate_verification
792d3d
diff --git a/tests/data/profile_stability/rhel8/stig_gui.profile b/tests/data/profile_stability/rhel8/stig_gui.profile
792d3d
index c4e60ddcde5..8a7a469b940 100644
792d3d
--- a/tests/data/profile_stability/rhel8/stig_gui.profile
792d3d
+++ b/tests/data/profile_stability/rhel8/stig_gui.profile
792d3d
@@ -379,6 +379,8 @@ selections:
792d3d
 - sshd_enable_warning_banner
792d3d
 - sshd_print_last_log
792d3d
 - sshd_rekey_limit
792d3d
+- sshd_set_idle_timeout
792d3d
+- sshd_set_keepalive_0
792d3d
 - sshd_use_strong_rng
792d3d
 - sshd_x11_use_localhost
792d3d
 - sssd_certificate_verification