Blame SOURCES/scap-security-guide-0.1.44-cpe-gdm.patch

0cd8e1
From 2e3cd7e8930b2456cbc6e182aa9a9f700ea9fa69 Mon Sep 17 00:00:00 2001
0cd8e1
From: Watson Sato <wsato@redhat.com>
0cd8e1
Date: Wed, 10 Apr 2019 15:41:56 +0200
0cd8e1
Subject: [PATCH] Add GDM CPE and mark GNOME group
0cd8e1
0cd8e1
---
0cd8e1
 .../gui_login_banner/group.yml                |  2 +
0cd8e1
 .../guide/system/software/gnome/group.yml     |  2 +
0cd8e1
 rhel7/cpe/rhel7-cpe-dictionary.xml            |  5 +++
0cd8e1
 .../oval/installed_env_has_gdm_package.xml    | 37 +++++++++++++++++++
0cd8e1
 ssg/constants.py                              |  1 +
0cd8e1
 5 files changed, 47 insertions(+)
0cd8e1
 create mode 100644 shared/checks/oval/installed_env_has_gdm_package.xml
0cd8e1
0cd8e1
diff --git a/linux_os/guide/system/accounts/accounts-banners/gui_login_banner/group.yml b/linux_os/guide/system/accounts/accounts-banners/gui_login_banner/group.yml
0cd8e1
index 3ee83be305..006177b16e 100644
0cd8e1
--- a/linux_os/guide/system/accounts/accounts-banners/gui_login_banner/group.yml
0cd8e1
+++ b/linux_os/guide/system/accounts/accounts-banners/gui_login_banner/group.yml
0cd8e1
@@ -9,3 +9,5 @@ description: |-
0cd8e1
     displayed in this graphical environment for these users.
0cd8e1
     The following sections describe how to configure the GDM login
0cd8e1
     banner.
0cd8e1
+
0cd8e1
+platform: gdm
0cd8e1
diff --git a/linux_os/guide/system/software/gnome/group.yml b/linux_os/guide/system/software/gnome/group.yml
0cd8e1
index 914431adb1..54d9dc547a 100644
0cd8e1
--- a/linux_os/guide/system/software/gnome/group.yml
0cd8e1
+++ b/linux_os/guide/system/software/gnome/group.yml
0cd8e1
@@ -12,3 +12,5 @@ description: |-
0cd8e1
     Red Hat Graphical environment.
0cd8e1
     

0cd8e1
     For more information on GNOME and the GNOME Project, see {{{ weblink(link="https://www.gnome.org") }}}.
0cd8e1
+
0cd8e1
+platform: gdm
0cd8e1
diff --git a/rhel7/cpe/rhel7-cpe-dictionary.xml b/rhel7/cpe/rhel7-cpe-dictionary.xml
0cd8e1
index d64c18e846..b6bc8b4e53 100644
0cd8e1
--- a/rhel7/cpe/rhel7-cpe-dictionary.xml
0cd8e1
+++ b/rhel7/cpe/rhel7-cpe-dictionary.xml
0cd8e1
@@ -47,6 +47,11 @@
0cd8e1
             
0cd8e1
             <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5" href="filename">installed_env_is_a_machine</check>
0cd8e1
       </cpe-item>
0cd8e1
+      <cpe-item name="cpe:/a:gdm">
0cd8e1
+            <title xml:lang="en-us">Package gdm is installed</title>
0cd8e1
+            
0cd8e1
+            <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5" href="filename">installed_env_has_gdm_package</check>
0cd8e1
+      </cpe-item>
0cd8e1
       <cpe-item name="cpe:/a:libuser">
0cd8e1
             <title xml:lang="en-us">Package libuser is installed</title>
0cd8e1
             
0cd8e1
diff --git a/shared/checks/oval/installed_env_has_gdm_package.xml b/shared/checks/oval/installed_env_has_gdm_package.xml
0cd8e1
new file mode 100644
0cd8e1
index 0000000000..57fb7a655c
0cd8e1
--- /dev/null
0cd8e1
+++ b/shared/checks/oval/installed_env_has_gdm_package.xml
0cd8e1
@@ -0,0 +1,37 @@
0cd8e1
+<def-group>
0cd8e1
+  
0cd8e1
+  id="installed_env_has_gdm_package" version="1">
0cd8e1
+    <metadata>
0cd8e1
+      <title>Package gdm is installed</title>
0cd8e1
+      <affected family="unix">
0cd8e1
+        <platform>multi_platform_all</platform>
0cd8e1
+      </affected>
0cd8e1
+      <description>Checks if package gdm is installed.</description>
0cd8e1
+      <reference ref_id="cpe:/a:gdm" source="CPE" />
0cd8e1
+    </metadata>
0cd8e1
+    <criteria>
0cd8e1
+      <criterion comment="Package gdm is installed" test_ref="test_env_has_gdm_installed" />
0cd8e1
+    </criteria>
0cd8e1
+  </definition>
0cd8e1
+
0cd8e1
+{{% if pkg_system == "rpm" %}}
0cd8e1
+  
0cd8e1
+  id="test_env_has_gdm_installed" version="1"
0cd8e1
+  comment="system has package gdm installed">
0cd8e1
+    <linux:object object_ref="obj_env_has_gdm_installed" />
0cd8e1
+  </linux:rpminfo_test>
0cd8e1
+  <linux:rpminfo_object id="obj_env_has_gdm_installed" version="1">
0cd8e1
+    <linux:name>gdm</linux:name>
0cd8e1
+  </linux:rpminfo_object>
0cd8e1
+{{% elif pkg_system == "dpkg" %}}
0cd8e1
+  
0cd8e1
+  id="test_env_has_gdm_installed" version="1"
0cd8e1
+  comment="system has package gdm installed">
0cd8e1
+    <linux:object object_ref="obj_env_has_gdm_installed" />
0cd8e1
+  </linux:dpkginfo_test>
0cd8e1
+  <linux:dpkginfo_object id="obj_env_has_gdm_installed" version="1">
0cd8e1
+    <linux:name>gdm</linux:name>
0cd8e1
+  </linux:dpkginfo_object>
0cd8e1
+{{% endif %}}
0cd8e1
+
0cd8e1
+</def-group>
0cd8e1
diff --git a/ssg/constants.py b/ssg/constants.py
0cd8e1
index 94d9d8c180..6e4fd3c741 100644
0cd8e1
--- a/ssg/constants.py
0cd8e1
+++ b/ssg/constants.py
0cd8e1
@@ -376,6 +376,7 @@
0cd8e1
 XCCDF_PLATFORM_TO_CPE = {
0cd8e1
     "machine": "cpe:/a:machine",
0cd8e1
     "container": "cpe:/a:container",
0cd8e1
+    "gdm": "cpe:/a:gdm",
0cd8e1
     "libuser": "cpe:/a:libuser",
0cd8e1
     "nss-pam-ldapd": "cpe:/a:nss-pam-ldapd",
0cd8e1
     "pam": "cpe:/a:pam",