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

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