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

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