Blame SOURCES/scap-security-guide-0.1.58-add_rhel_minor_check-PR_7251.patch

362bfa
From b814fc94d0fb360ef53a6b735e9520df5b484589 Mon Sep 17 00:00:00 2001
362bfa
From: Matthew Burket <mburket@redhat.com>
362bfa
Date: Wed, 14 Jul 2021 12:52:13 -0500
362bfa
Subject: [PATCH 1/3] Add Jinja-based RHEL 8 minor check
362bfa
362bfa
---
362bfa
 shared/checks/oval/installed_OS_is_rhel8.xml | 29 ++++++++++++++++++++
362bfa
 1 file changed, 29 insertions(+)
362bfa
362bfa
diff --git a/shared/checks/oval/installed_OS_is_rhel8.xml b/shared/checks/oval/installed_OS_is_rhel8.xml
362bfa
index a9699411ce7..fdd3c870d43 100644
362bfa
--- a/shared/checks/oval/installed_OS_is_rhel8.xml
362bfa
+++ b/shared/checks/oval/installed_OS_is_rhel8.xml
362bfa
@@ -44,6 +44,35 @@
362bfa
     <linux:name>redhat-release</linux:name>
362bfa
   </linux:rpminfo_object>
362bfa
 
362bfa
+  {{% for minorversion in range(0, 9) %}}
362bfa
+  <definition class="inventory" id="installed_OS_is_rhel8_{{{ minorversion }}}" version="1">
362bfa
+    <metadata>
362bfa
+      <title>Red Hat Enterprise Linux 8.{{{ minorversion }}}</title>
362bfa
+      <affected family="unix">
362bfa
+        <platform>Red Hat Enterprise Linux 8.{{{ minorversion }}}</platform>
362bfa
+      </affected>
362bfa
+      <reference ref_id="cpe:/o:redhat:enterprise_linux:8.{{{ minorversion }}}" source="CPE" />
362bfa
+      <description>The operating system installed on the system is Red Hat Enterprise Linux 8.{{{  minorversion}}}</description>
362bfa
+    </metadata>
362bfa
+  </definition>
362bfa
+
362bfa
+  <criteria>
362bfa
+    <criterion comment="RHEL.{{{ minorversion }}} 8 is installed" test_ref="test_rhel8_{{{ minorversion }}}" />
362bfa
+  </criteria>
362bfa
+
362bfa
+  
362bfa
+   id="test_rhel8_{{{ minorversion }}}" version="1">
362bfa
+    <linux:object object_ref="obj_rhel8_{{{ minorversion }}}" />
362bfa
+    <linux:state state_ref="state_rhel8_{{{ minorversion }}}" />
362bfa
+  </linux:rpminfo_test>
362bfa
+  <linux:rpminfo_state id="state_rhel8_{{{ minorversion }}}" version="1">
362bfa
+    <linux:version operation="pattern match">^8.{{{ minorversion }}}*$</linux:version>
362bfa
+  </linux:rpminfo_state>
362bfa
+  <linux:rpminfo_object id="obj_rhel8_{{{ minorversion }}}" version="1">
362bfa
+    <linux:name>redhat-release</linux:name>
362bfa
+  </linux:rpminfo_object>
362bfa
+  {{% endfor %}}
362bfa
+
362bfa
   <ind:textfilecontent54_test check="all" comment="RHEVH base RHEL is version 8" id="test_rhevh_rhel8_version" version="1">
362bfa
     <ind:object object_ref="obj_rhevh_rhel8_version" />
362bfa
     <ind:state state_ref="state_rhevh_rhel8_version" />
362bfa
362bfa
From d37d303654be74758c19615ef027b3bafa2d7217 Mon Sep 17 00:00:00 2001
362bfa
From: Carlos Matos <cmatos@redhat.com>
362bfa
Date: Wed, 14 Jul 2021 15:30:02 -0400
362bfa
Subject: [PATCH 2/3] Adding cpe's to product.yml
362bfa
362bfa
---
362bfa
 products/rhel8/product.yml | 45 ++++++++++++++++++++++++++++++++++++++
362bfa
 1 file changed, 45 insertions(+)
362bfa
362bfa
diff --git a/products/rhel8/product.yml b/products/rhel8/product.yml
362bfa
index 3278207fcb4..14336bfddf1 100644
362bfa
--- a/products/rhel8/product.yml
362bfa
+++ b/products/rhel8/product.yml
362bfa
@@ -27,6 +27,51 @@ cpes:
362bfa
       title: "Red Hat Enterprise Linux 8"
362bfa
       check_id: installed_OS_is_rhel8
362bfa
 
362bfa
+  - rhel8.0:
362bfa
+      name: "cpe:/o:redhat:enterprise_linux:8.0"
362bfa
+      title: "Red Hat Enterprise Linux 8.0"
362bfa
+      check_id: installed_OS_is_rhel8_0
362bfa
+
362bfa
+  - rhel8.1:
362bfa
+      name: "cpe:/o:redhat:enterprise_linux:8.1"
362bfa
+      title: "Red Hat Enterprise Linux 8.1"
362bfa
+      check_id: installed_OS_is_rhel8_1
362bfa
+
362bfa
+  - rhel8.2:
362bfa
+      name: "cpe:/o:redhat:enterprise_linux:8.2"
362bfa
+      title: "Red Hat Enterprise Linux 8.2"
362bfa
+      check_id: installed_OS_is_rhel8_2
362bfa
+
362bfa
+  - rhel8.3:
362bfa
+      name: "cpe:/o:redhat:enterprise_linux:8.3"
362bfa
+      title: "Red Hat Enterprise Linux 8.3"
362bfa
+      check_id: installed_OS_is_rhel8_3
362bfa
+
362bfa
+  - rhel8.4:
362bfa
+      name: "cpe:/o:redhat:enterprise_linux:8.4"
362bfa
+      title: "Red Hat Enterprise Linux 8.4"
362bfa
+      check_id: installed_OS_is_rhel8_4
362bfa
+
362bfa
+  - rhel8.5:
362bfa
+      name: "cpe:/o:redhat:enterprise_linux:8.5"
362bfa
+      title: "Red Hat Enterprise Linux 8.5"
362bfa
+      check_id: installed_OS_is_rhel8_5
362bfa
+
362bfa
+  - rhel8.6:
362bfa
+      name: "cpe:/o:redhat:enterprise_linux:8.6"
362bfa
+      title: "Red Hat Enterprise Linux 8.6"
362bfa
+      check_id: installed_OS_is_rhel8_6
362bfa
+
362bfa
+  - rhel8.7:
362bfa
+      name: "cpe:/o:redhat:enterprise_linux:8.7"
362bfa
+      title: "Red Hat Enterprise Linux 8.7"
362bfa
+      check_id: installed_OS_is_rhel8_7
362bfa
+
362bfa
+  - rhel8.8:
362bfa
+      name: "cpe:/o:redhat:enterprise_linux:8.8"
362bfa
+      title: "Red Hat Enterprise Linux 8.8"
362bfa
+      check_id: installed_OS_is_rhel8_8
362bfa
+
362bfa
 # Mapping of CPE platform to package
362bfa
 platform_package_overrides:
362bfa
   login_defs: "shadow-utils"
362bfa
362bfa
From c4e4fd7b0449ba4655020fc0dc99ae3c4523b8cc Mon Sep 17 00:00:00 2001
362bfa
From: Matthew Burket <mburket@redhat.com>
362bfa
Date: Mon, 19 Jul 2021 08:12:34 -0500
362bfa
Subject: [PATCH 3/3] Add checks to go up to RHEL 8.10
362bfa
362bfa
This also makes the checks work.
362bfa
---
362bfa
 products/rhel8/product.yml                   | 10 ++++++++++
362bfa
 shared/checks/oval/installed_OS_is_rhel8.xml | 10 +++++-----
362bfa
 2 files changed, 15 insertions(+), 5 deletions(-)
362bfa
362bfa
diff --git a/products/rhel8/product.yml b/products/rhel8/product.yml
362bfa
index 14336bfddf1..78c987b2457 100644
362bfa
--- a/products/rhel8/product.yml
362bfa
+++ b/products/rhel8/product.yml
362bfa
@@ -72,6 +72,16 @@ cpes:
362bfa
       title: "Red Hat Enterprise Linux 8.8"
362bfa
       check_id: installed_OS_is_rhel8_8
362bfa
 
362bfa
+  - rhel8.9:
362bfa
+      name: "cpe:/o:redhat:enterprise_linux:8.9"
362bfa
+      title: "Red Hat Enterprise Linux 8.9"
362bfa
+      check_id: installed_OS_is_rhel8_9
362bfa
+
362bfa
+  - rhel8.10:
362bfa
+      name: "cpe:/o:redhat:enterprise_linux:8.10"
362bfa
+      title: "Red Hat Enterprise Linux 8.10"
362bfa
+      check_id: installed_OS_is_rhel8_10
362bfa
+
362bfa
 # Mapping of CPE platform to package
362bfa
 platform_package_overrides:
362bfa
   login_defs: "shadow-utils"
362bfa
diff --git a/shared/checks/oval/installed_OS_is_rhel8.xml b/shared/checks/oval/installed_OS_is_rhel8.xml
362bfa
index fdd3c870d43..feab963b941 100644
362bfa
--- a/shared/checks/oval/installed_OS_is_rhel8.xml
362bfa
+++ b/shared/checks/oval/installed_OS_is_rhel8.xml
362bfa
@@ -44,7 +44,7 @@
362bfa
     <linux:name>redhat-release</linux:name>
362bfa
   </linux:rpminfo_object>
362bfa
 
362bfa
-  {{% for minorversion in range(0, 9) %}}
362bfa
+  {{% for minorversion in range(0, 11) %}}
362bfa
   <definition class="inventory" id="installed_OS_is_rhel8_{{{ minorversion }}}" version="1">
362bfa
     <metadata>
362bfa
       <title>Red Hat Enterprise Linux 8.{{{ minorversion }}}</title>
362bfa
@@ -52,13 +52,13 @@
362bfa
         <platform>Red Hat Enterprise Linux 8.{{{ minorversion }}}</platform>
362bfa
       </affected>
362bfa
       <reference ref_id="cpe:/o:redhat:enterprise_linux:8.{{{ minorversion }}}" source="CPE" />
362bfa
-      <description>The operating system installed on the system is Red Hat Enterprise Linux 8.{{{  minorversion}}}</description>
362bfa
+      <description>The operating system installed on the system is Red Hat Enterprise Linux 8.{{{ minorversion }}}</description>
362bfa
     </metadata>
362bfa
+    <criteria>
362bfa
+      <criterion comment="RHEL 8.{{{ minorversion }}} is installed" test_ref="test_rhel8_{{{ minorversion }}}" />
362bfa
+    </criteria>
362bfa
   </definition>
362bfa
 
362bfa
-  <criteria>
362bfa
-    <criterion comment="RHEL.{{{ minorversion }}} 8 is installed" test_ref="test_rhel8_{{{ minorversion }}}" />
362bfa
-  </criteria>
362bfa
 
362bfa
   
362bfa
    id="test_rhel8_{{{ minorversion }}}" version="1">