Blame SOURCES/scap-security-guide-0.1.61-update_RHEL_08_040320-PR_8170.patch

62ebbd
diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/ansible/shared.yml b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/ansible/shared.yml
62ebbd
index 5b3afb324df..67d6836e873 100644
62ebbd
--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/ansible/shared.yml
62ebbd
+++ b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/ansible/shared.yml
62ebbd
@@ -14,12 +14,3 @@
62ebbd
       - xorg-x11-server-Xwayland
62ebbd
 {{% endif %}}
62ebbd
     state: absent
62ebbd
-
62ebbd
-
62ebbd
-- name: Switch to multi-user runlevel
62ebbd
-  file:
62ebbd
-    src: /usr/lib/systemd/system/multi-user.target
62ebbd
-    dest: /etc/systemd/system/default.target
62ebbd
-    state: link
62ebbd
-    force: yes
62ebbd
-
62ebbd
diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/bash/shared.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/bash/shared.sh
62ebbd
index dbabe572d2a..496dc74be7c 100644
62ebbd
--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/bash/shared.sh
62ebbd
+++ b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/bash/shared.sh
62ebbd
@@ -12,6 +12,3 @@
62ebbd
 {{% if product not in ["rhel7", "ol7"] %}}
62ebbd
 {{{ bash_package_remove("xorg-x11-server-Xwayland") }}}
62ebbd
 {{% endif %}}
62ebbd
-
62ebbd
-# configure run level
62ebbd
-systemctl set-default multi-user.target
62ebbd
\ No newline at end of file
62ebbd
diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/oval/shared.xml b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/oval/shared.xml
62ebbd
index 0710efe9f1b..0868ec6eae7 100644
62ebbd
--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/oval/shared.xml
62ebbd
+++ b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/oval/shared.xml
62ebbd
@@ -2,10 +2,6 @@
62ebbd
   <definition class="compliance" id="xwindows_remove_packages" version="1">
62ebbd
     {{{ oval_metadata("Ensure that the default runlevel target is set to multi-user.target.") }}}
62ebbd
     <criteria>
62ebbd
-      {{%- if init_system == "systemd" and target_oval_version != [5, 10] %}}
62ebbd
-      
62ebbd
-        definition_ref="xwindows_runlevel_target" />
62ebbd
-      {{%- endif %}}
62ebbd
       
62ebbd
         test_ref="package_xorg-x11-server-Xorg_removed" />
62ebbd
       
62ebbd
diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/rule.yml b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/rule.yml
62ebbd
index 10e51577a12..6ceb07bd574 100644
62ebbd
--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/rule.yml
62ebbd
+++ b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/rule.yml
62ebbd
@@ -19,14 +19,6 @@ description: |-
62ebbd
     {{% else %}}
62ebbd
     
sudo {{{ pkg_manager }}} remove xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-server-utils xorg-x11-server-Xwayland
62ebbd
     {{% endif %}}
62ebbd
-    Additionally, setting the system's default target to
62ebbd
-    <tt>multi-user.target</tt> will prevent automatic startup of the X server.
62ebbd
-    To do so, run:
62ebbd
-    
$ systemctl set-default multi-user.target
62ebbd
-    You should see the following output:
62ebbd
-    
Removed symlink /etc/systemd/system/default.target.
62ebbd
-    Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/multi-user.target.
62ebbd
-
62ebbd
 
62ebbd
 rationale: |-
62ebbd
     Unnecessary service packages must not be installed to decrease the attack surface of the system. X windows has a long history of security
62ebbd
@@ -72,6 +64,8 @@ warnings:
62ebbd
         The installation and use of a Graphical User Interface (GUI) increases your attack vector and decreases your
62ebbd
         overall security posture. Removing the package xorg-x11-server-common package will remove the graphical target
62ebbd
         which might bring your system to an inconsistent state requiring additional configuration to access the system
62ebbd
-        again. If a GUI is an operational requirement, a tailored profile that removes this rule should used before
62ebbd
+        again.
62ebbd
+        The rule <tt>xwindows_runlevel_target</tt> can be used to configure the system to boot into the multi-user.target.
62ebbd
+        If a GUI is an operational requirement, a tailored profile that removes this rule should be used before
62ebbd
         continuing installation.
62ebbd
 {{{ ovirt_rule_notapplicable_warning("X11 graphic libraries are dependency of OpenStack Cinderlib storage provider") | indent(4) }}}
62ebbd
diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/correct_target.pass.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/correct_target.pass.sh
62ebbd
deleted file mode 100644
62ebbd
index 9bf62a42d28..00000000000
62ebbd
--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/correct_target.pass.sh
62ebbd
+++ /dev/null
62ebbd
@@ -1,5 +0,0 @@
62ebbd
-#!/bin/bash
62ebbd
-
62ebbd
-yum -y remove xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-server-utils xorg-x11-server-Xwayland
62ebbd
-
62ebbd
-systemctl set-default multi-user.target
62ebbd
diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/correct_target_under_lib.pass.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/correct_target_under_lib.pass.sh
62ebbd
deleted file mode 100644
62ebbd
index 4eeb6971486..00000000000
62ebbd
--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/correct_target_under_lib.pass.sh
62ebbd
+++ /dev/null
62ebbd
@@ -1,5 +0,0 @@
62ebbd
-#!/bin/bash
62ebbd
-
62ebbd
-yum -y remove xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-server-utils xorg-x11-server-Xwayland
62ebbd
-
62ebbd
-ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
62ebbd
diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/packages_installed.fail.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/packages_installed.fail.sh
62ebbd
new file mode 100644
62ebbd
index 00000000000..b3908cff002
62ebbd
--- /dev/null
62ebbd
+++ b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/packages_installed.fail.sh
62ebbd
@@ -0,0 +1,8 @@
62ebbd
+#!/bin/bash
62ebbd
+
62ebbd
+{{{ bash_package_install("xorg-x11-server-Xorg") }}}
62ebbd
+{{{ bash_package_install("xorg-x11-server-utils") }}}
62ebbd
+{{{ bash_package_install("xorg-x11-server-common") }}}
62ebbd
+{{% if product not in ["rhel7", "ol7"] %}}
62ebbd
+{{{ bash_package_install("xorg-x11-server-Xwayland") }}}
62ebbd
+{{% endif %}}
62ebbd
diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/packages_installed_removed.pass.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/packages_installed_removed.pass.sh
62ebbd
new file mode 100644
62ebbd
index 00000000000..abafdbd624a
62ebbd
--- /dev/null
62ebbd
+++ b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/packages_installed_removed.pass.sh
62ebbd
@@ -0,0 +1,16 @@
62ebbd
+#!/bin/bash
62ebbd
+# based on shared/templates/package_removed/tests/package-installed-removed.pass.sh
62ebbd
+
62ebbd
+{{{ bash_package_install("xorg-x11-server-Xorg") }}}
62ebbd
+{{{ bash_package_install("xorg-x11-server-utils") }}}
62ebbd
+{{{ bash_package_install("xorg-x11-server-common") }}}
62ebbd
+{{% if product not in ["rhel7", "ol7"] %}}
62ebbd
+{{{ bash_package_install("xorg-x11-server-Xwayland") }}}
62ebbd
+{{% endif %}}
62ebbd
+
62ebbd
+{{{ bash_package_remove("xorg-x11-server-Xorg") }}}
62ebbd
+{{{ bash_package_remove("xorg-x11-server-utils") }}}
62ebbd
+{{{ bash_package_remove("xorg-x11-server-common") }}}
62ebbd
+{{% if product not in ["rhel7", "ol7"] %}}
62ebbd
+{{{ bash_package_remove("xorg-x11-server-Xwayland") }}}
62ebbd
+{{% endif %}}
62ebbd
diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/packages_removed.pass.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/packages_removed.pass.sh
62ebbd
new file mode 100644
62ebbd
index 00000000000..a403e108082
62ebbd
--- /dev/null
62ebbd
+++ b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/packages_removed.pass.sh
62ebbd
@@ -0,0 +1,8 @@
62ebbd
+#!/bin/bash
62ebbd
+
62ebbd
+{{{ bash_package_remove("xorg-x11-server-Xorg") }}}
62ebbd
+{{{ bash_package_remove("xorg-x11-server-utils") }}}
62ebbd
+{{{ bash_package_remove("xorg-x11-server-common") }}}
62ebbd
+{{% if product not in ["rhel7", "ol7"] %}}
62ebbd
+{{{ bash_package_remove("xorg-x11-server-Xwayland") }}}
62ebbd
+{{% endif %}}
62ebbd
diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel7_packages_installed_correct_target.fail.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel7_packages_installed_correct_target.fail.sh
62ebbd
deleted file mode 100644
62ebbd
index ff7d0efda29..00000000000
62ebbd
--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel7_packages_installed_correct_target.fail.sh
62ebbd
+++ /dev/null
62ebbd
@@ -1,4 +0,0 @@
62ebbd
-#!/bin/bash
62ebbd
-# platform = Red Hat Enterprise Linux 7
62ebbd
-# packages = xorg-x11-server-Xorg,xorg-x11-server-common,xorg-x11-server-utils
62ebbd
-
62ebbd
diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel7_packages_installed_wrong_target.fail.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel7_packages_installed_wrong_target.fail.sh
62ebbd
deleted file mode 100644
62ebbd
index d8ecd8c7361..00000000000
62ebbd
--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel7_packages_installed_wrong_target.fail.sh
62ebbd
+++ /dev/null
62ebbd
@@ -1,5 +0,0 @@
62ebbd
-#!/bin/bash
62ebbd
-# platform = Red Hat Enterprise Linux 7
62ebbd
-# packages = xorg-x11-server-Xorg,xorg-x11-server-common,xorg-x11-server-utils
62ebbd
-
62ebbd
-systemctl set-default graphical.target
62ebbd
diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel8_packages_installed_correct_target.fail.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel8_packages_installed_correct_target.fail.sh
62ebbd
deleted file mode 100644
62ebbd
index 14f1a97bc4f..00000000000
62ebbd
--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel8_packages_installed_correct_target.fail.sh
62ebbd
+++ /dev/null
62ebbd
@@ -1,4 +0,0 @@
62ebbd
-#!/bin/bash
62ebbd
-# platform = Red Hat Enterprise Linux 8
62ebbd
-# packages = xorg-x11-server-Xorg,xorg-x11-server-common,xorg-x11-server-utils,xorg-x11-server-Xwayland
62ebbd
-
62ebbd
diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel8_packages_installed_wrong_target.fail.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel8_packages_installed_wrong_target.fail.sh
62ebbd
deleted file mode 100644
62ebbd
index c678ef711d9..00000000000
62ebbd
--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/rhel8_packages_installed_wrong_target.fail.sh
62ebbd
+++ /dev/null
62ebbd
@@ -1,5 +0,0 @@
62ebbd
-#!/bin/bash
62ebbd
-# platform = Red Hat Enterprise Linux 8
62ebbd
-# packages = xorg-x11-server-Xorg,xorg-x11-server-common,xorg-x11-server-utils,xorg-x11-server-Xwayland
62ebbd
-
62ebbd
-systemctl set-default graphical.target
62ebbd
diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/wrong_target.fail.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/wrong_target.fail.sh
62ebbd
deleted file mode 100644
62ebbd
index bf8a615b1dc..00000000000
62ebbd
--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/wrong_target.fail.sh
62ebbd
+++ /dev/null
62ebbd
@@ -1,5 +0,0 @@
62ebbd
-#!/bin/bash
62ebbd
-
62ebbd
-yum -y remove xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-server-utils xorg-x11-server-Xwayland
62ebbd
-
62ebbd
-systemctl set-default graphical.target
62ebbd
diff --git a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/wrong_target_under_lib.fail.sh b/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/wrong_target_under_lib.fail.sh
62ebbd
deleted file mode 100644
62ebbd
index 652088b85ae..00000000000
62ebbd
--- a/linux_os/guide/services/xwindows/disabling_xwindows/xwindows_remove_packages/tests/wrong_target_under_lib.fail.sh
62ebbd
+++ /dev/null
62ebbd
@@ -1,5 +0,0 @@
62ebbd
-#!/bin/bash
62ebbd
-
62ebbd
-yum -y remove xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-server-utils xorg-x11-server-Xwayland
62ebbd
-
62ebbd
-ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target