adamwill / rpms / openscap

Forked from rpms/openscap 3 years ago
Clone
Blob Blame History Raw
From 26ff8c8d0ed9b2b5852243e3d0546c7e0c7b038a Mon Sep 17 00:00:00 2001
From: "(GalaxyMaster)" <galaxy4public@users.noreply.github.com>
Date: Tue, 10 Nov 2020 01:50:25 +1100
Subject: [PATCH] Added CentOS 8 CPE

Signed-off-by: (GalaxyMaster) <galaxy4public@users.noreply.github.com>
---
 cpe/openscap-cpe-dict.xml |  4 ++++
 cpe/openscap-cpe-oval.xml | 22 ++++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/cpe/openscap-cpe-dict.xml b/cpe/openscap-cpe-dict.xml
index e140dbb0d..5ea7cb867 100644
--- a/cpe/openscap-cpe-dict.xml
+++ b/cpe/openscap-cpe-dict.xml
@@ -49,6 +49,10 @@
             <title xml:lang="en-us">Community Enterprise Operating System 7</title>
             <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5" href="openscap-cpe-oval.xml">oval:org.open-scap.cpe.rhel:def:1007</check>
       </cpe-item>
+      <cpe-item name="cpe:/o:centos:centos:8">
+            <title xml:lang="en-us">Community Enterprise Operating System 8</title>
+            <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5" href="openscap-cpe-oval.xml">oval:org.open-scap.cpe.rhel:def:1008</check>
+      </cpe-item>
       <cpe-item name="cpe:/o:scientificlinux:scientificlinux:5">
             <title xml:lang="en-us">Scientific Linux 5</title>
             <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5" href="openscap-cpe-oval.xml">oval:org.open-scap.cpe.scientific:def:5</check>
diff --git a/cpe/openscap-cpe-oval.xml b/cpe/openscap-cpe-oval.xml
index 51211777b..2d3ef02a2 100644
--- a/cpe/openscap-cpe-oval.xml
+++ b/cpe/openscap-cpe-oval.xml
@@ -172,6 +172,19 @@
                         <criterion comment="Community Enterprise Operating System 7 is installed" test_ref="oval:org.open-scap.cpe.rhel:tst:1007"/>
                   </criteria>
             </definition>
+            <definition class="inventory" id="oval:org.open-scap.cpe.rhel:def:1008" version="1">
+                  <metadata>
+                        <title>Community Enterprise Operating System 8</title>
+                        <affected family="unix">
+                              <platform>Community Enterprise Operating System 8</platform>
+                        </affected>
+                        <reference ref_id="cpe:/o:centos:centos:8" source="CPE"/>
+                        <description>The operating system installed on the system is Community Enterprise Operating System 8</description>
+                  </metadata>
+                  <criteria>
+                        <criterion comment="Community Enterprise Operating System 8 is installed" test_ref="oval:org.open-scap.cpe.rhel:tst:1008"/>
+                  </criteria>
+            </definition>
             <definition class="inventory" id="oval:org.open-scap.cpe.scientific:def:5" version="1">
                   <metadata>
                         <title>Scientific Linux 5</title>
@@ -843,6 +856,11 @@
                   <object object_ref="oval:org.open-scap.cpe.redhat-release:obj:3"/>
                   <state state_ref="oval:org.open-scap.cpe.rhel:ste:1007"/>
             </rpmverifyfile_test>
+            <rpmverifyfile_test check_existence="at_least_one_exists" id="oval:org.open-scap.cpe.rhel:tst:1008" version="1" check="at least one" comment="centos-release is version 8"
+                  xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">
+                  <object object_ref="oval:org.open-scap.cpe.redhat-release:obj:3"/>
+                  <state state_ref="oval:org.open-scap.cpe.rhel:ste:1008"/>
+            </rpmverifyfile_test>
             <rpmverifyfile_test check_existence="at_least_one_exists" id="oval:org.open-scap.cpe.scientific:tst:5" version="1" check="at least one" comment="sl-release is version 5"
                   xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">
                   <object object_ref="oval:org.open-scap.cpe.redhat-release:obj:3"/>
@@ -1205,6 +1223,10 @@
                   <name operation="pattern match">^centos-release</name>
                   <version operation="pattern match">^7</version>
             </rpmverifyfile_state>
+            <rpmverifyfile_state id="oval:org.open-scap.cpe.rhel:ste:1008" version="1" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">
+                  <name operation="pattern match">^centos-release</name>
+                  <version operation="pattern match">^8</version>
+            </rpmverifyfile_state>
             <rpmverifyfile_state id="oval:org.open-scap.cpe.scientific:ste:5" version="1" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">
                   <name operation="pattern match">^sl-release</name>
                   <version operation="pattern match">^5</version>