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

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

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