summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2017-09-26 14:01:46 -0700
committerArmin Kuster <akuster808@gmail.com>2017-09-30 11:47:20 -0700
commita633d83537db50d173eee8ce1594a7a818674d43 (patch)
tree8a11ccc9749cb22761c493652207b97a7e8f9b5d
parent922deffe046de0c79c8679cdefb7cce08cc1aa5f (diff)
downloadmeta-security-a633d83537db50d173eee8ce1594a7a818674d43.tar.gz
openscap: Add oe specific files
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-security-compliance/recipes-openscap/oe-scap/files/OpenEmbedded_nodistro_0.xccdf.xml14
-rw-r--r--meta-security-compliance/recipes-openscap/oe-scap/files/OpenEmbedded_nodistro_0.xml83
-rw-r--r--meta-security-compliance/recipes-openscap/oe-scap/files/oval-to-xccdf.xslt72
-rw-r--r--meta-security-compliance/recipes-openscap/oe-scap/files/run_cve.sh7
-rw-r--r--meta-security-compliance/recipes-openscap/oe-scap/files/run_test.sh5
-rw-r--r--meta-security-compliance/recipes-openscap/oe-scap/oe-scap_1.0.bb34
6 files changed, 215 insertions, 0 deletions
diff --git a/meta-security-compliance/recipes-openscap/oe-scap/files/OpenEmbedded_nodistro_0.xccdf.xml b/meta-security-compliance/recipes-openscap/oe-scap/files/OpenEmbedded_nodistro_0.xccdf.xml
new file mode 100644
index 0000000..d3b2c9a
--- /dev/null
+++ b/meta-security-compliance/recipes-openscap/oe-scap/files/OpenEmbedded_nodistro_0.xccdf.xml
@@ -0,0 +1,14 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<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">
3 <xccdf:status>incomplete</xccdf:status>
4 <xccdf:title>Automatically generated XCCDF from OVAL file: OpenEmbedded_nodistro_0.xml</xccdf:title>
5 <xccdf:description>This file has been generated automatically from oval definitions file.</xccdf:description>
6 <xccdf:version time="2017-06-07T04:05:05">None, generated from OVAL file.</xccdf:version>
7 <xccdf:Rule selected="true" id="oval-com.redhat.rhsa-def-20171365">
8 <xccdf:title>CPE-2017:1365: nss security and bug fix update (Important)</xccdf:title>
9 <xccdf:ident system="http://cve.mitre.org">CVE-2017-7502</xccdf:ident>
10 <xccdf:check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
11 <xccdf:check-content-ref href="OpenEmbedded_nodistro_0.xml" name="oval:com.redhat.rhsa:def:20171365"/>
12 </xccdf:check>
13 </xccdf:Rule>
14</xccdf:Benchmark>
diff --git a/meta-security-compliance/recipes-openscap/oe-scap/files/OpenEmbedded_nodistro_0.xml b/meta-security-compliance/recipes-openscap/oe-scap/files/OpenEmbedded_nodistro_0.xml
new file mode 100644
index 0000000..a9bf2a0
--- /dev/null
+++ b/meta-security-compliance/recipes-openscap/oe-scap/files/OpenEmbedded_nodistro_0.xml
@@ -0,0 +1,83 @@
1<?xml version="1.0" encoding="utf-8"?>
2<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">
3 <generator>
4 <oval:product_name>OpenEmbedded Errata Test System</oval:product_name>
5 <oval:schema_version>5.10.1</oval:schema_version>
6 <oval:timestamp>2017-06-07T04:05:05</oval:timestamp>
7 </generator>
8
9 <definitions>
10 <definition class="patch" id="oval:com.redhat.rhsa:def:20171365" version="604">
11 <metadata>
12 <title>CPE-2017:1365: nss security and bug fix update (Important)</title>
13 <affected family="unix">
14 <platform>OpenEmbedded Nodistro</platform>
15 </affected>
16 <reference ref_id="RHSA-2017:1365-03" ref_url="https://access.redhat.com/errata/RHSA-2017:1365" source="RHSA"/>
17 <reference ref_id="CVE-2017-7502" ref_url="https://access.redhat.com/security/cve/CVE-2017-7502" source="CVE"/>
18 <description>Network Security Services (NSS) is a set of libraries designed to support the cross-platform development of security-enabled client and server applications.
19
20Security Fix(es):
21
22* 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)
23
24Bug Fix(es):
25
26* 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>
27
28<!-- ~~~~~~~~~~~~~~~~~~~~ advisory details ~~~~~~~~~~~~~~~~~~~ -->
29
30<advisory from="example.com">
31 <severity>Important</severity>
32 <rights>NA</rights>
33 <issued date="2017-05-30"/>
34 <updated date="2017-05-30"/>
35 <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>
36 <bugzilla href="https://bugzilla.redhat.com/1446631" id="1446631">CVE-2017-7502 nss: Null pointer dereference when handling empty SSLv2 messages</bugzilla>
37 <affected_cpe_list>
38 <cpe>cpe:/o:openembedded:nodistro:0</cpe>
39 </affected_cpe_list>
40</advisory>
41 </metadata>
42
43<criteria operator="AND">
44 <criterion comment="Red Hat Enterprise Linux 7 Client is installed" test_ref="oval:com.redhat.rhsa:tst:20171365001"/>
45 <criterion comment="nss is earlier than 0:3.28.4-r0" test_ref="oval:com.redhat.rhsa:tst:20171365007"/>
46</criteria>
47
48 </definition>
49 </definitions>
50 <tests>
51 <!-- ~~~~~~~~~~~~~~~~~~~~~ rpminfo tests ~~~~~~~~~~~~~~~~~~~~~ -->
52 <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">
53 <object object_ref="oval:com.redhat.rhsa:obj:20171365001"/>
54 <state state_ref="oval:com.redhat.rhsa:ste:20171365002"/>
55</rpminfo_test>
56<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">
57 <object object_ref="oval:com.redhat.rhsa:obj:20171365006"/>
58 <state state_ref="oval:com.redhat.rhsa:ste:20171365003"/>
59</rpminfo_test>
60
61 </tests>
62
63 <objects>
64 <!-- ~~~~~~~~~~~~~~~~~~~~ rpminfo objects ~~~~~~~~~~~~~~~~~~~~ -->
65 <rpminfo_object id="oval:com.redhat.rhsa:obj:20171365006" version="604" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">
66 <name>nss</name>
67</rpminfo_object>
68<rpminfo_object id="oval:com.redhat.rhsa:obj:20171365001" version="604" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">
69 <name>openembedded-release</name>
70</rpminfo_object>
71
72 </objects>
73 <states>
74 <!-- ~~~~~~~~~~~~~~~~~~~~ rpminfo states ~~~~~~~~~~~~~~~~~~~~~ -->
75<rpminfo_state id="oval:com.redhat.rhsa:ste:20171365002" version="604" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">
76 <version operation="pattern match">^1[^\d]</version>
77</rpminfo_state>
78<rpminfo_state id="oval:com.redhat.rhsa:ste:20171365003" version="604" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux">
79 <evr datatype="evr_string" operation="less than">0:3.31.4-r0</evr>
80</rpminfo_state>
81
82 </states>
83</oval_definitions>
diff --git a/meta-security-compliance/recipes-openscap/oe-scap/files/oval-to-xccdf.xslt b/meta-security-compliance/recipes-openscap/oe-scap/files/oval-to-xccdf.xslt
new file mode 100644
index 0000000..2243ac4
--- /dev/null
+++ b/meta-security-compliance/recipes-openscap/oe-scap/files/oval-to-xccdf.xslt
@@ -0,0 +1,72 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- Copyright 2012 Red Hat Inc., Durham, North Carolina. All Rights Reserved.
3
4This transformation is free software; you can redistribute it and/or modify
5it under the terms of the GNU Lesser General Public License as published by
6the Free Software Foundation; either version 2.1 of the License.
7
8This transformation is distributed in the hope that it will be useful, but
9WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11for more details.
12
13You should have received a copy of the GNU Lesser General Public License along
14with this library; if not, write to the Free Software Foundation, Inc., 59
15Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
17Authors:
18 Šimon Lukašík <slukasik@redhat.com>
19-->
20<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
21 xmlns:xccdf="http://checklists.nist.gov/xccdf/1.1"
22 xmlns:oval="http://oval.mitre.org/XMLSchema/oval-common-5"
23 xmlns:oval-def="http://oval.mitre.org/XMLSchema/oval-definitions-5">
24 <xsl:output method="xml" encoding="UTF-8"/>
25
26 <xsl:template match="/">
27 <xccdf:Benchmark id="generated-xccdf" resolved="1">
28 <xccdf:status>incomplete</xccdf:status>
29 <xccdf:title>
30 <xsl:text>Automatically generated XCCDF from OVAL file: </xsl:text>
31 <xsl:value-of select="$ovalfile"/>
32 </xccdf:title>
33 <xccdf:description>This file has been generated automatically from oval definitions file.</xccdf:description>
34 <xccdf:version>
35 <xsl:attribute name="time">
36 <xsl:value-of select="normalize-space(oval-def:oval_definitions/oval-def:generator/oval:timestamp[1]/text())"/>
37 </xsl:attribute>
38 <xsl:text>None, generated from OVAL file.</xsl:text>
39 </xccdf:version>
40 <xsl:apply-templates select="oval-def:oval_definitions/oval-def:definitions/oval-def:definition"/>
41 </xccdf:Benchmark>
42 </xsl:template>
43
44 <xsl:template match="oval-def:definition">
45 <xccdf:Rule selected="true">
46 <xsl:attribute name="id">
47 <xsl:value-of select="translate(@id,':','-')"/>
48 </xsl:attribute>
49 <xccdf:title>
50 <xsl:copy-of select="oval-def:metadata/oval-def:title/text()"/>
51 </xccdf:title>
52 <xsl:apply-templates select="oval-def:metadata/oval-def:advisory/oval-def:cve"/>
53 <xccdf:check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
54 <xccdf:check-content-ref href="file">
55 <xsl:attribute name="name">
56 <xsl:value-of select="@id"/>
57 </xsl:attribute>
58 <xsl:attribute name="href">
59 <xsl:value-of select="$ovalfile"/>
60 </xsl:attribute>
61 </xccdf:check-content-ref>
62 </xccdf:check>
63 </xccdf:Rule>
64 </xsl:template>
65
66 <xsl:template match="oval-def:cve">
67 <xccdf:ident system="http://cve.mitre.org">
68 <xsl:copy-of select="text()"/>
69 </xccdf:ident>
70 </xsl:template>
71</xsl:stylesheet>
72
diff --git a/meta-security-compliance/recipes-openscap/oe-scap/files/run_cve.sh b/meta-security-compliance/recipes-openscap/oe-scap/files/run_cve.sh
new file mode 100644
index 0000000..48a7485
--- /dev/null
+++ b/meta-security-compliance/recipes-openscap/oe-scap/files/run_cve.sh
@@ -0,0 +1,7 @@
1#!/bin/sh
2
3oscap oval eval \
4--report oval.html \
5--verbose-log-file filedevel.log \
6--verbose DEVEL \
7/usr/share/xml/scap/ssg/content/ssg-openembedded-ds.xml
diff --git a/meta-security-compliance/recipes-openscap/oe-scap/files/run_test.sh b/meta-security-compliance/recipes-openscap/oe-scap/files/run_test.sh
new file mode 100644
index 0000000..70cd82c
--- /dev/null
+++ b/meta-security-compliance/recipes-openscap/oe-scap/files/run_test.sh
@@ -0,0 +1,5 @@
1#!/bin/sh
2
3#oscap oval eval --result-file ./myresults.xml ./OpenEmbedded_nodistro_0.xml
4
5oscap xccdf eval --results results.xml --report report.html OpenEmbedded_nodistro_0.xccdf.xml
diff --git a/meta-security-compliance/recipes-openscap/oe-scap/oe-scap_1.0.bb b/meta-security-compliance/recipes-openscap/oe-scap/oe-scap_1.0.bb
new file mode 100644
index 0000000..5b61375
--- /dev/null
+++ b/meta-security-compliance/recipes-openscap/oe-scap/oe-scap_1.0.bb
@@ -0,0 +1,34 @@
1# Copyright (C) 2017 Armin Kuster <akuster808@gmail.com>
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4SUMARRY = "OE SCAP files"
5LIC_FILES_CHKSUM = "file://README.md;md5=46dec9f167b6e05986cb4023df6d92f4"
6LICENSE = "MIT"
7
8SRCREV = "7147871d7f37d408c0dd7720ef0fd3ec1b54ad98"
9SRC_URI = "git://github.com/akuster/oe-scap.git"
10SRC_URI += " \
11 file://run_cve.sh \
12 file://run_test.sh \
13 file://OpenEmbedded_nodistro_0.xml \
14 file://OpenEmbedded_nodistro_0.xccdf.xml \
15"
16
17
18S = "${WORKDIR}/git"
19
20do_configure[noexec] = "1"
21do_compile[noexec] = "1"
22
23do_install () {
24 install -d ${D}/${datadir}/oe-scap
25 install ${WORKDIR}/run_cve.sh ${D}/${datadir}/oe-scap/.
26 install ${WORKDIR}/run_test.sh ${D}/${datadir}/oe-scap/.
27 install ${WORKDIR}/OpenEmbedded_nodistro_0.xml ${D}/${datadir}/oe-scap/.
28 install ${WORKDIR}/OpenEmbedded_nodistro_0.xccdf.xml ${D}/${datadir}/oe-scap/.
29 cp ${S}/* ${D}/${datadir}/oe-scap/.
30}
31
32FILES_${PN} += "${datadir}/oe-scap"
33
34RDEPENDS_${PN} = "openscap"