#1 Add CentOS 8 CPE (backport upstream PR #1622)
Opened 10 months ago by adamwill. Modified 10 months ago
rpms/ adamwill/openscap c8s-pr1622  into  c8s

Add CentOS 8 CPE (backport upstream PR #1622)
Adam Williamson • 10 months ago  

@@ -0,0 +1,73 @@ 

+ 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>

file modified
+1

@@ -13,6 +13,7 @@ 

  Patch5:         openscap-1.3.5-memory-PR_1627.patch

  Patch6:         openscap-1.3.5-use-MALLOC_CHECK-in-tests-PR_1635.patch

  Patch7:         openscap-1.3.5-test-non-local-gpfs-PR_1653.patch

+ Patch8:         openscap-1.3.5-centos8-cpe-PR_1622.patch

  BuildRequires:  cmake >= 2.6

  BuildRequires:  swig libxml2-devel libxslt-devel perl-generators perl-XML-Parser

  BuildRequires:  rpm-devel

Without this, openscap doesn't really work on CentOS 8 at all.

Signed-off-by: Adam Williamson awilliam@redhat.com

I figured it was better not to bump revision and changelog in the PR in case you want to do anything else in a -6, but can do it if you want me to.

PRs aren't merged directly in git.centos.org. This patch has been passed on to the relevant subsystem team in this bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1907935 Your PR will be closed in favor of tracking status in the bugzilla.

Thank you for the contribution!