From d4703574010bb573286701b08812ee4200ff18c0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= <jcerny@redhat.com>
Date: Thu, 9 Aug 2018 04:20:42 -0400
Subject: [PATCH] Add RHEL8 CPE to OpenSCAP CPE dictionary
---
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 277be121c..1d4dbfebc 100644
--- a/cpe/openscap-cpe-dict.xml
+++ b/cpe/openscap-cpe-dict.xml
@@ -17,6 +17,10 @@
<title xml:lang="en-us">Red Hat Enterprise Linux 7</title>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5" href="openscap-cpe-oval.xml">oval:org.open-scap.cpe.rhel:def:7</check>
</cpe-item>
+ <cpe-item name="cpe:/o:redhat:enterprise_linux:8">
+ <title xml:lang="en-us">Red Hat Enterprise Linux 8</title>
+ <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5" href="openscap-cpe-oval.xml">oval:org.open-scap.cpe.rhel:def:8</check>
+ </cpe-item>
<cpe-item name="cpe:/o:oracle:linux:5">
<title xml:lang="en-us">Oracle Linux 5</title>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5" href="openscap-cpe-oval.xml">oval:org.open-scap.cpe.ol:def:5</check>
diff --git a/cpe/openscap-cpe-oval.xml b/cpe/openscap-cpe-oval.xml
index bfb0b8336..b2a7d18ae 100644
--- a/cpe/openscap-cpe-oval.xml
+++ b/cpe/openscap-cpe-oval.xml
@@ -68,6 +68,19 @@
</criteria>
</criteria>
</definition>
+ <definition class="inventory" id="oval:org.open-scap.cpe.rhel:def:8" version="1">
+ <metadata>
+ <title>Red Hat Enterprise Linux 8</title>
+ <affected family="unix">
+ <platform>Red Hat Enterprise Linux 8</platform>
+ </affected>
+ <reference ref_id="cpe:/o:redhat:enterprise_linux:8" source="CPE"/>
+ <description>The operating system installed on the system is Red Hat Enterprise Linux 8</description>
+ </metadata>
+ <criteria>
+ <criterion comment="Red Hat Enterprise Linux 8 is installed" test_ref="oval:org.open-scap.cpe.rhel:tst:8"/>
+ </criteria>
+ </definition>
<definition class="inventory" id="oval:org.open-scap.cpe.ol:def:5" version="1">
<metadata>
<title>Oracle Linux 5</title>
@@ -633,6 +646,11 @@
<object object_ref="oval:org.open-scap.cpe.redhat-release:obj:3"/>
<state state_ref="oval:org.open-scap.cpe.rhel:ste:7"/>
</rpmverifyfile_test>
+ <rpmverifyfile_test check_existence="at_least_one_exists" id="oval:org.open-scap.cpe.rhel:tst:8" version="1" check="at least one" comment="redhat-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:8"/>
+ </rpmverifyfile_test>
<rpminfo_test check_existence="at_least_one_exists" id="oval:org.open-scap.cpe.ol:tst:5" version="1" check="at least one" comment="oraclelinux-release is version 5"
xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">
<object object_ref="oval:org.open-scap.cpe.oraclelinux-release:obj:1"/>
@@ -939,6 +957,10 @@
<name operation="pattern match">^redhat-release</name>
<version operation="pattern match">^7[^\d]</version>
</rpmverifyfile_state>
+ <rpmverifyfile_state id="oval:org.open-scap.cpe.rhel:ste:8" version="1" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">
+ <name operation="pattern match">^redhat-release</name>
+ <version operation="pattern match">^8[^\d]</version>
+ </rpmverifyfile_state>
<rpmverifyfile_state id="oval:org.open-scap.cpe.rhel:ste:1005" version="1" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">
<name operation="pattern match">^centos-release</name>
<version operation="pattern match">^5</version>