From 6cf282e0921163ab42fa85062fee48f44134d28a Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 31 Jan 2022 14:23:32 -0800 Subject: [PATCH] OCP4 adds OVN,SDN networkType CPE We want to add OVN and SDN network type CPE so that OVN/SDN rules can be run on the correct platform This PR is also to address: https://bugzilla.redhat.com/show_bug.cgi?id=1994609 --- products/ocp4/product.yml | 21 ++++++++ shared/checks/oval/installed_app_is_ocp4.xml | 48 +++++++++++++++++++ .../oval/installed_app_is_ocp4_node.xml | 48 +++++++++++++++++++ 3 files changed, 117 insertions(+) diff --git a/products/ocp4/product.yml b/products/ocp4/product.yml index 86a884876cf2..3260259d85d2 100644 --- a/products/ocp4/product.yml +++ b/products/ocp4/product.yml @@ -26,6 +26,16 @@ cpes: title: "Red Hat OpenShift Container Platform 4 Node" check_id: installed_app_is_ocp4_node + - ocp4-node-on-ovn: + name: "cpe:/a:redhat:openshift_container_platform_node_on_ovn:4" + title: "Red Hat OpenShift Container Platform 4 on OVN" + check_id: installed_app_is_ocp4_node_on_openshift-ovn + + - ocp4-node-on-sdn: + name: "cpe:/a:redhat:openshift_container_platform_node_on_sdn:4" + title: "Red Hat OpenShift Container Platform 4 on SDN" + check_id: installed_app_is_ocp4_node_on_openshift-sdn + - ocp4.6: name: "cpe:/a:redhat:openshift_container_platform:4.6" title: "Red Hat OpenShift Container Platform 4.6" @@ -106,5 +116,16 @@ cpes: title: "Red Hat OpenShift Container Platform 4 on GCP" check_id: installed_app_is_ocp4_on_gcp + - ocp4-on-ovn: + name: "cpe:/a:redhat:openshift_container_platform_on_ovn:4" + title: "Red Hat OpenShift Container Platform 4 on OVN" + check_id: installed_app_is_ocp4_on_openshiftovn + + - ocp4-on-sdn: + name: "cpe:/a:redhat:openshift_container_platform_on_sdn:4" + title: "Red Hat OpenShift Container Platform 4 on SDN" + check_id: installed_app_is_ocp4_on_openshiftsdn + + # Requirement string, see: https://setuptools.readthedocs.io/en/latest/pkg_resources.html#requirements-parsing # requires: "openscap>=1.3.4" diff --git a/shared/checks/oval/installed_app_is_ocp4.xml b/shared/checks/oval/installed_app_is_ocp4.xml index 52d9e8197d63..07b75290bc52 100644 --- a/shared/checks/oval/installed_app_is_ocp4.xml +++ b/shared/checks/oval/installed_app_is_ocp4.xml @@ -120,5 +120,53 @@ +{{% endfor %}} + + + + /kubernetes-api-resources/apis/config.openshift.io/v1/networks + + + + + + + + + + + + + .status.networkType + + + +{{% for network in ["OpenShiftSDN", "OpenShiftOVN"] %}} + + + Red Hat OpenShift Container network 4 on {{{ network }}} + + Red Hat OpenShift Container network 4 on {{{ network }}} + + + The application installed installed on the system is OpenShift version 4 on {{{ network }}}. + + + + + + + + + + + + + + + ^{{{ network }}}$ + + {{% endfor %}} + diff --git a/shared/checks/oval/installed_app_is_ocp4_node.xml b/shared/checks/oval/installed_app_is_ocp4_node.xml index 0d4cb325e4f3..edbcca07ae23 100644 --- a/shared/checks/oval/installed_app_is_ocp4_node.xml +++ b/shared/checks/oval/installed_app_is_ocp4_node.xml @@ -21,4 +21,52 @@ /etc/kubernetes/kubelet.conf + + + /etc/kubernetes/cni/net.d/00-multus.conf + + + + + + + + + + + + + .delegates[0].type + + + +{{% for network in ["OpenShift-SDN", "OpenShift-OVN"] %}} + + + Red Hat OpenShift Container network 4 on {{{ network }}} + + Red Hat OpenShift Container network 4 on {{{ network }}} + + + The application installed installed on the system is OpenShift version 4 on {{{ network }}}. + + + + + + + + + + + + + + + ^{{{ network|lower }}}$ + + +{{% endfor %}} + +