summaryrefslogtreecommitdiff
path: root/meta-security/meta-security-compliance/recipes-openscap/oe-scap/files
diff options
context:
space:
mode:
authorDave Cobbley <david.j.cobbley@linux.intel.com>2018-08-14 20:05:37 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-08-23 04:26:31 +0300
commiteb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch)
treede291a73dc37168da6370e2cf16c347d1eba9df8 /meta-security/meta-security-compliance/recipes-openscap/oe-scap/files
parent9c3cf826d853102535ead04cebc2d6023eff3032 (diff)
downloadopenbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.xz
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-security/meta-security-compliance/recipes-openscap/oe-scap/files')
-rw-r--r--meta-security/meta-security-compliance/recipes-openscap/oe-scap/files/OpenEmbedded_nodistro_0.xccdf.xml14
-rw-r--r--meta-security/meta-security-compliance/recipes-openscap/oe-scap/files/OpenEmbedded_nodistro_0.xml83
-rw-r--r--meta-security/meta-security-compliance/recipes-openscap/oe-scap/files/oval-to-xccdf.xslt72
-rw-r--r--meta-security/meta-security-compliance/recipes-openscap/oe-scap/files/run_cve.sh7
-rw-r--r--meta-security/meta-security-compliance/recipes-openscap/oe-scap/files/run_test.sh5
5 files changed, 181 insertions, 0 deletions
diff --git a/meta-security/meta-security-compliance/recipes-openscap/oe-scap/files/OpenEmbedded_nodistro_0.xccdf.xml b/meta-security/meta-security-compliance/recipes-openscap/oe-scap/files/OpenEmbedded_nodistro_0.xccdf.xml
new file mode 100644
index 000000000..d3b2c9a32
--- /dev/null
+++ b/meta-security/meta-security-compliance/recipes-openscap/oe-scap/files/OpenEmbedded_nodistro_0.xccdf.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xccdf:Benchmark xmlns:xccdf="http://checklists.nist.gov/xccdf/1.1" xmlns:oval="http://oval.mitre.org/XMLSchema/oval-common-5" xmlns:oval-def="http://oval.mitre.org/XMLSchema/oval-definitions-5" id="generated-xccdf" resolved="1">
+ <xccdf:status>incomplete</xccdf:status>
+ <xccdf:title>Automatically generated XCCDF from OVAL file: OpenEmbedded_nodistro_0.xml</xccdf:title>
+ <xccdf:description>This file has been generated automatically from oval definitions file.</xccdf:description>
+ <xccdf:version time="2017-06-07T04:05:05">None, generated from OVAL file.</xccdf:version>
+ <xccdf:Rule selected="true" id="oval-com.redhat.rhsa-def-20171365">
+ <xccdf:title>CPE-2017:1365: nss security and bug fix update (Important)</xccdf:title>
+ <xccdf:ident system="http://cve.mitre.org">CVE-2017-7502</xccdf:ident>
+ <xccdf:check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
+ <xccdf:check-content-ref href="OpenEmbedded_nodistro_0.xml" name="oval:com.redhat.rhsa:def:20171365"/>
+ </xccdf:check>
+ </xccdf:Rule>
+</xccdf:Benchmark>
diff --git a/meta-security/meta-security-compliance/recipes-openscap/oe-scap/files/OpenEmbedded_nodistro_0.xml b/meta-security/meta-security-compliance/recipes-openscap/oe-scap/files/OpenEmbedded_nodistro_0.xml
new file mode 100644
index 000000000..a9bf2a051
--- /dev/null
+++ b/meta-security/meta-security-compliance/recipes-openscap/oe-scap/files/OpenEmbedded_nodistro_0.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+<oval_definitions xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5" xmlns:oval="http://oval.mitre.org/XMLSchema/oval-common-5" xmlns:oval-def="http://oval.mitre.org/XMLSchema/oval-definitions-5" xmlns:red-def="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux" xmlns:unix-def="http://oval.mitre.org/XMLSchema/oval-definitions-5#unix" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://oval.mitre.org/XMLSchema/oval-common-5 oval-common-schema.xsd http://oval.mitre.org/XMLSchema/oval-definitions-5 oval-definitions-schema.xsd http://oval.mitre.org/XMLSchema/oval-definitions-5#unix unix-definitions-schema.xsd http://oval.mitre.org/XMLSchema/oval-definitions-5#linux linux-definitions-schema.xsd">
+ <generator>
+ <oval:product_name>OpenEmbedded Errata Test System</oval:product_name>
+ <oval:schema_version>5.10.1</oval:schema_version>
+ <oval:timestamp>2017-06-07T04:05:05</oval:timestamp>
+ </generator>
+
+ <definitions>
+ <definition class="patch" id="oval:com.redhat.rhsa:def:20171365" version="604">
+ <metadata>
+ <title>CPE-2017:1365: nss security and bug fix update (Important)</title>
+ <affected family="unix">
+ <platform>OpenEmbedded Nodistro</platform>
+ </affected>
+ <reference ref_id="RHSA-2017:1365-03" ref_url="https://access.redhat.com/errata/RHSA-2017:1365" source="RHSA"/>
+ <reference ref_id="CVE-2017-7502" ref_url="https://access.redhat.com/security/cve/CVE-2017-7502" source="CVE"/>
+ <description>Network Security Services (NSS) is a set of libraries designed to support the cross-platform development of security-enabled client and server applications.
+
+Security Fix(es):
+
+* A null pointer dereference flaw was found in the way NSS handled empty SSLv2 messages. An attacker could use this flaw to crash a server application compiled against the NSS library. (CVE-2017-7502)
+
+Bug Fix(es):
+
+* The Network Security Services (NSS) code and Certificate Authority (CA) list have been updated to meet the recommendations as published with the latest Mozilla Firefox Extended Support Release (ESR). The updated CA list improves compatibility with the certificates that are used in the Internet Public Key Infrastructure (PKI). To avoid certificate validation refusals, Red Hat recommends installing the updated CA list on June 12, 2017. (BZ#1451421)</description>
+
+<!-- ~~~~~~~~~~~~~~~~~~~~ advisory details ~~~~~~~~~~~~~~~~~~~ -->
+
+<advisory from="example.com">
+ <severity>Important</severity>
+ <rights>NA</rights>
+ <issued date="2017-05-30"/>
+ <updated date="2017-05-30"/>
+ <cve cvss3="7.5/CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H" cwe="CWE-476" href="https://access.redhat.com/security/cve/CVE-2017-7502">CVE-2017-7502</cve>
+ <bugzilla href="https://bugzilla.redhat.com/1446631" id="1446631">CVE-2017-7502 nss: Null pointer dereference when handling empty SSLv2 messages</bugzilla>
+ <affected_cpe_list>
+ <cpe>cpe:/o:openembedded:nodistro:0</cpe>
+ </affected_cpe_list>
+</advisory>
+ </metadata>
+
+<criteria operator="AND">
+ <criterion comment="Red Hat Enterprise Linux 7 Client is installed" test_ref="oval:com.redhat.rhsa:tst:20171365001"/>
+ <criterion comment="nss is earlier than 0:3.28.4-r0" test_ref="oval:com.redhat.rhsa:tst:20171365007"/>
+</criteria>
+
+ </definition>
+ </definitions>
+ <tests>
+ <!-- ~~~~~~~~~~~~~~~~~~~~~ rpminfo tests ~~~~~~~~~~~~~~~~~~~~~ -->
+ <rpminfo_test check="at least one" comment="Red Hat Enterprise Linux 7 Client is installed" id="oval:com.redhat.rhsa:tst:20171365001" version="604" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">
+ <object object_ref="oval:com.redhat.rhsa:obj:20171365001"/>
+ <state state_ref="oval:com.redhat.rhsa:ste:20171365002"/>
+</rpminfo_test>
+<rpminfo_test check="at least one" comment="nss is earlier than 0:3.31.4-r0" id="oval:com.redhat.rhsa:tst:20171365007" version="604" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">
+ <object object_ref="oval:com.redhat.rhsa:obj:20171365006"/>
+ <state state_ref="oval:com.redhat.rhsa:ste:20171365003"/>
+</rpminfo_test>
+
+ </tests>
+
+ <objects>
+ <!-- ~~~~~~~~~~~~~~~~~~~~ rpminfo objects ~~~~~~~~~~~~~~~~~~~~ -->
+ <rpminfo_object id="oval:com.redhat.rhsa:obj:20171365006" version="604" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">
+ <name>nss</name>
+</rpminfo_object>
+<rpminfo_object id="oval:com.redhat.rhsa:obj:20171365001" version="604" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">
+ <name>openembedded-release</name>
+</rpminfo_object>
+
+ </objects>
+ <states>
+ <!-- ~~~~~~~~~~~~~~~~~~~~ rpminfo states ~~~~~~~~~~~~~~~~~~~~~ -->
+<rpminfo_state id="oval:com.redhat.rhsa:ste:20171365002" version="604" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">
+ <version operation="pattern match">^1[^\d]</version>
+</rpminfo_state>
+<rpminfo_state id="oval:com.redhat.rhsa:ste:20171365003" version="604" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">
+ <evr datatype="evr_string" operation="less than">0:3.31.4-r0</evr>
+</rpminfo_state>
+
+ </states>
+</oval_definitions>
diff --git a/meta-security/meta-security-compliance/recipes-openscap/oe-scap/files/oval-to-xccdf.xslt b/meta-security/meta-security-compliance/recipes-openscap/oe-scap/files/oval-to-xccdf.xslt
new file mode 100644
index 000000000..2243ac4bf
--- /dev/null
+++ b/meta-security/meta-security-compliance/recipes-openscap/oe-scap/files/oval-to-xccdf.xslt
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2012 Red Hat Inc., Durham, North Carolina. All Rights Reserved.
+
+This transformation is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License.
+
+This transformation is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+for more details.
+
+You should have received a copy of the GNU Lesser General Public License along
+with this library; if not, write to the Free Software Foundation, Inc., 59
+Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Authors:
+ Šimon Lukašík <slukasik@redhat.com>
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+ xmlns:xccdf="http://checklists.nist.gov/xccdf/1.1"
+ xmlns:oval="http://oval.mitre.org/XMLSchema/oval-common-5"
+ xmlns:oval-def="http://oval.mitre.org/XMLSchema/oval-definitions-5">
+ <xsl:output method="xml" encoding="UTF-8"/>
+
+ <xsl:template match="/">
+ <xccdf:Benchmark id="generated-xccdf" resolved="1">
+ <xccdf:status>incomplete</xccdf:status>
+ <xccdf:title>
+ <xsl:text>Automatically generated XCCDF from OVAL file: </xsl:text>
+ <xsl:value-of select="$ovalfile"/>
+ </xccdf:title>
+ <xccdf:description>This file has been generated automatically from oval definitions file.</xccdf:description>
+ <xccdf:version>
+ <xsl:attribute name="time">
+ <xsl:value-of select="normalize-space(oval-def:oval_definitions/oval-def:generator/oval:timestamp[1]/text())"/>
+ </xsl:attribute>
+ <xsl:text>None, generated from OVAL file.</xsl:text>
+ </xccdf:version>
+ <xsl:apply-templates select="oval-def:oval_definitions/oval-def:definitions/oval-def:definition"/>
+ </xccdf:Benchmark>
+ </xsl:template>
+
+ <xsl:template match="oval-def:definition">
+ <xccdf:Rule selected="true">
+ <xsl:attribute name="id">
+ <xsl:value-of select="translate(@id,':','-')"/>
+ </xsl:attribute>
+ <xccdf:title>
+ <xsl:copy-of select="oval-def:metadata/oval-def:title/text()"/>
+ </xccdf:title>
+ <xsl:apply-templates select="oval-def:metadata/oval-def:advisory/oval-def:cve"/>
+ <xccdf:check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
+ <xccdf:check-content-ref href="file">
+ <xsl:attribute name="name">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ <xsl:attribute name="href">
+ <xsl:value-of select="$ovalfile"/>
+ </xsl:attribute>
+ </xccdf:check-content-ref>
+ </xccdf:check>
+ </xccdf:Rule>
+ </xsl:template>
+
+ <xsl:template match="oval-def:cve">
+ <xccdf:ident system="http://cve.mitre.org">
+ <xsl:copy-of select="text()"/>
+ </xccdf:ident>
+ </xsl:template>
+</xsl:stylesheet>
+
diff --git a/meta-security/meta-security-compliance/recipes-openscap/oe-scap/files/run_cve.sh b/meta-security/meta-security-compliance/recipes-openscap/oe-scap/files/run_cve.sh
new file mode 100644
index 000000000..48a7485d8
--- /dev/null
+++ b/meta-security/meta-security-compliance/recipes-openscap/oe-scap/files/run_cve.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+oscap oval eval \
+--report oval.html \
+--verbose-log-file filedevel.log \
+--verbose DEVEL \
+/usr/share/xml/scap/ssg/content/ssg-openembedded-ds.xml
diff --git a/meta-security/meta-security-compliance/recipes-openscap/oe-scap/files/run_test.sh b/meta-security/meta-security-compliance/recipes-openscap/oe-scap/files/run_test.sh
new file mode 100644
index 000000000..70cd82c1b
--- /dev/null
+++ b/meta-security/meta-security-compliance/recipes-openscap/oe-scap/files/run_test.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+#oscap oval eval --result-file ./myresults.xml ./OpenEmbedded_nodistro_0.xml
+
+oscap xccdf eval --results results.xml --report report.html OpenEmbedded_nodistro_0.xccdf.xml