summaryrefslogtreecommitdiffstats
path: root/meta-security/meta-security-compliance
diff options
context:
space:
mode:
authorDave Cobbley <david.j.cobbley@linux.intel.com>2018-08-14 10:05:37 -0700
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-08-22 21:26:31 -0400
commiteb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch)
treede291a73dc37168da6370e2cf16c347d1eba9df8 /meta-security/meta-security-compliance
parent9c3cf826d853102535ead04cebc2d6023eff3032 (diff)
downloadtalos-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.gz
talos-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.zip
[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')
-rw-r--r--meta-security/meta-security-compliance/README41
-rw-r--r--meta-security/meta-security-compliance/conf/layer.conf15
-rw-r--r--meta-security/meta-security-compliance/recipes-auditors/lynis/lynis_2.5.1.bb41
-rw-r--r--meta-security/meta-security-compliance/recipes-core/openembedded-release/openembedded-release_1.0.bb32
-rw-r--r--meta-security/meta-security-compliance/recipes-core/os-release/os-release.bbappend4
-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
-rw-r--r--meta-security/meta-security-compliance/recipes-openscap/oe-scap/oe-scap_1.0.bb34
-rw-r--r--meta-security/meta-security-compliance/recipes-openscap/openscap-daemon/openscap-daemon_0.1.6.bb20
-rw-r--r--meta-security/meta-security-compliance/recipes-openscap/openscap/files/crypto_pkgconfig.patch36
-rw-r--r--meta-security/meta-security-compliance/recipes-openscap/openscap/files/probe_dir_fixup.patch17
-rw-r--r--meta-security/meta-security-compliance/recipes-openscap/openscap/files/run-ptest3
-rw-r--r--meta-security/meta-security-compliance/recipes-openscap/openscap/openscap.inc2
-rw-r--r--meta-security/meta-security-compliance/recipes-openscap/openscap/openscap_1.2.15.bb86
-rw-r--r--meta-security/meta-security-compliance/recipes-openscap/scap-security-guide/scap-security-guide_0.1.33.bb57
18 files changed, 569 insertions, 0 deletions
diff --git a/meta-security/meta-security-compliance/README b/meta-security/meta-security-compliance/README
new file mode 100644
index 000000000..b29c143b7
--- /dev/null
+++ b/meta-security/meta-security-compliance/README
@@ -0,0 +1,41 @@
+# Meta-security-compliance
+
+This layer is meant to contain programs to help in security compliance and auditing
+
+
+Dependencies
+============
+
+This layer depends on:
+
+ URI: git://git.openembedded.org/bitbake
+ branch: master
+
+ URI: git://git.openembedded.org/openembedded-core
+ layers: meta
+ branch: master
+
+or
+
+ URI: git://git.yoctoproject.org/poky
+ branch: master
+
+
+
+Maintenance
+-----------
+
+Send pull requests, patches, comments or questions to yocto@yoctoproject.org
+
+When sending single patches, please using something like:
+'git send-email -1 --to yocto@yoctoproject.org --subject-prefix=meta-security][PATCH'
+
+Layer Maintainer: Armin Kuster <akuster@mvista.com>
+
+
+License
+=======
+
+All metadata is MIT licensed unless otherwise stated. Source code included
+in tree for individual recipes is under the LICENSE stated in each recipe
+(.bb file) unless otherwise stated.
diff --git a/meta-security/meta-security-compliance/conf/layer.conf b/meta-security/meta-security-compliance/conf/layer.conf
new file mode 100644
index 000000000..31716d6e7
--- /dev/null
+++ b/meta-security/meta-security-compliance/conf/layer.conf
@@ -0,0 +1,15 @@
+# We have a conf and classes directory, add to BBPATH
+BBPATH .= ":${LAYERDIR}"
+
+# We have a recipes directory, add to BBFILES
+BBFILES += "${LAYERDIR}/recipes*/*/*.bb ${LAYERDIR}/recipes*/*/*.bbappend"
+
+BBFILE_COLLECTIONS += "scanners-layer"
+BBFILE_PATTERN_scanners-layer = "^${LAYERDIR}/"
+BBFILE_PRIORITY_scanners-layer = "6"
+
+LAYERSERIES_COMPAT_scanners-layer = "sumo"
+
+LAYERDEPENDS_scanners-layer = " \
+ core \
+"
diff --git a/meta-security/meta-security-compliance/recipes-auditors/lynis/lynis_2.5.1.bb b/meta-security/meta-security-compliance/recipes-auditors/lynis/lynis_2.5.1.bb
new file mode 100644
index 000000000..c25b804de
--- /dev/null
+++ b/meta-security/meta-security-compliance/recipes-auditors/lynis/lynis_2.5.1.bb
@@ -0,0 +1,41 @@
+# Copyright (C) 2017 Armin Kuster <akuster808@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Lynis is a free and open source security and auditing tool."
+HOMEDIR = "https://cisofy.com/"
+LICENSE = "GPL-3.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3edd6782854304fd11da4975ab9799c1"
+
+SRC_URI = "https://cisofy.com/files/${BPN}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "5b9da89c616344bbc73cbc5688a4a0bd"
+SRC_URI[sha256sum] = "7a09c6fc71c65d572ca702df7b4394d71f9037484062ef71b76f59a2c498b029"
+
+S = "${WORKDIR}/${BPN}"
+
+inherit autotools-brokensep
+
+do_compile[noexec] = "1"
+do_configure[noexec] = "1"
+
+do_install () {
+ install -d ${D}/${bindir}
+ install -d ${D}/${sysconfdir}/lynis
+ install -m 555 ${S}/lynis ${D}/${bindir}
+
+ install -d ${D}/${datadir}/lynis/db
+ install -d ${D}/${datadir}/lynis/plugins
+ install -d ${D}/${datadir}/lynis/include
+ install -d ${D}/${datadir}/lynis/extras
+
+ cp -r ${S}/db/* ${D}/${datadir}/lynis/db/.
+ cp -r ${S}/plugins/* ${D}/${datadir}/lynis/plugins/.
+ cp -r ${S}/include/* ${D}/${datadir}/lynis/include/.
+ cp -r ${S}/extras/* ${D}/${datadir}/lynis/extras/.
+ cp ${S}/*.prf ${D}/${sysconfdir}/lynis
+}
+
+FILES_${PN} += "${sysconfdir}/developer.prf ${sysconfdir}/default.prf"
+FILES_${PN}-doc += "lynis.8 FAQ README CHANGELOG.md CONTRIBUTIONS.md CONTRIBUTORS.md"
+
+RDEPENDS_${PN} += "procps"
diff --git a/meta-security/meta-security-compliance/recipes-core/openembedded-release/openembedded-release_1.0.bb b/meta-security/meta-security-compliance/recipes-core/openembedded-release/openembedded-release_1.0.bb
new file mode 100644
index 000000000..0ad427dff
--- /dev/null
+++ b/meta-security/meta-security-compliance/recipes-core/openembedded-release/openembedded-release_1.0.bb
@@ -0,0 +1,32 @@
+inherit allarch
+
+SUMMARY = "Operating release identification"
+DESCRIPTION = "The /etc/openembedded-release file contains operating system identification data."
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+INHIBIT_DEFAULT_DEPS = "1"
+
+do_fetch[noexec] = "1"
+do_unpack[noexec] = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+
+VERSION = "0"
+RELEASE_NAME = "${DISTRO_NAME} ${DISTRO} ${VERSION}"
+
+def sanitise_version(ver):
+ ret = ver.replace('+', '-').replace(' ','_')
+ return ret.lower()
+
+python do_compile () {
+ import shutil
+ release_name = d.getVar('RELEASE_NAME')
+ with open(d.expand('${B}/openemebedded-release'), 'w') as f:
+ f.write('%s\n' % release_name)
+}
+do_compile[vardeps] += "${RELEASE_NAME}"
+
+do_install () {
+ install -d ${D}${sysconfdir}
+ install -m 0644 openemebedded-release ${D}${sysconfdir}/
+}
diff --git a/meta-security/meta-security-compliance/recipes-core/os-release/os-release.bbappend b/meta-security/meta-security-compliance/recipes-core/os-release/os-release.bbappend
new file mode 100644
index 000000000..e9fd44ade
--- /dev/null
+++ b/meta-security/meta-security-compliance/recipes-core/os-release/os-release.bbappend
@@ -0,0 +1,4 @@
+OS_RELEASE_FIELDS += "CPE_NAME"
+
+CPE_NAME="cpe:/o:openembedded:nodistro:0"
+
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
diff --git a/meta-security/meta-security-compliance/recipes-openscap/oe-scap/oe-scap_1.0.bb b/meta-security/meta-security-compliance/recipes-openscap/oe-scap/oe-scap_1.0.bb
new file mode 100644
index 000000000..5b6137569
--- /dev/null
+++ b/meta-security/meta-security-compliance/recipes-openscap/oe-scap/oe-scap_1.0.bb
@@ -0,0 +1,34 @@
+# Copyright (C) 2017 Armin Kuster <akuster808@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMARRY = "OE SCAP files"
+LIC_FILES_CHKSUM = "file://README.md;md5=46dec9f167b6e05986cb4023df6d92f4"
+LICENSE = "MIT"
+
+SRCREV = "7147871d7f37d408c0dd7720ef0fd3ec1b54ad98"
+SRC_URI = "git://github.com/akuster/oe-scap.git"
+SRC_URI += " \
+ file://run_cve.sh \
+ file://run_test.sh \
+ file://OpenEmbedded_nodistro_0.xml \
+ file://OpenEmbedded_nodistro_0.xccdf.xml \
+"
+
+
+S = "${WORKDIR}/git"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install () {
+ install -d ${D}/${datadir}/oe-scap
+ install ${WORKDIR}/run_cve.sh ${D}/${datadir}/oe-scap/.
+ install ${WORKDIR}/run_test.sh ${D}/${datadir}/oe-scap/.
+ install ${WORKDIR}/OpenEmbedded_nodistro_0.xml ${D}/${datadir}/oe-scap/.
+ install ${WORKDIR}/OpenEmbedded_nodistro_0.xccdf.xml ${D}/${datadir}/oe-scap/.
+ cp ${S}/* ${D}/${datadir}/oe-scap/.
+}
+
+FILES_${PN} += "${datadir}/oe-scap"
+
+RDEPENDS_${PN} = "openscap"
diff --git a/meta-security/meta-security-compliance/recipes-openscap/openscap-daemon/openscap-daemon_0.1.6.bb b/meta-security/meta-security-compliance/recipes-openscap/openscap-daemon/openscap-daemon_0.1.6.bb
new file mode 100644
index 000000000..fb01a1134
--- /dev/null
+++ b/meta-security/meta-security-compliance/recipes-openscap/openscap-daemon/openscap-daemon_0.1.6.bb
@@ -0,0 +1,20 @@
+# Copyright (C) 2017 Armin Kuster <akuster808@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMARRY = "The OpenSCAP Daemon is a service that runs in the background."
+HOME_URL = "https://www.open-scap.org/tools/openscap-daemon/"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=40d2542b8c43a3ec2b7f5da31a697b88"
+LICENSE = "LGPL-2.1"
+
+DEPENDS = "python3-dbus"
+
+SRCREV = "3fd5c75a08223de35a865d026d2a6980ec9c1d74"
+SRC_URI = "git://github.com/OpenSCAP/openscap-daemon.git"
+
+PV = "0.1.6+git${SRCPV}"
+
+inherit setuptools3
+
+S = "${WORKDIR}/git"
+
+RDEPENDS_${PN} = "python"
diff --git a/meta-security/meta-security-compliance/recipes-openscap/openscap/files/crypto_pkgconfig.patch b/meta-security/meta-security-compliance/recipes-openscap/openscap/files/crypto_pkgconfig.patch
new file mode 100644
index 000000000..2d70855ab
--- /dev/null
+++ b/meta-security/meta-security-compliance/recipes-openscap/openscap/files/crypto_pkgconfig.patch
@@ -0,0 +1,36 @@
+Index: git/configure.ac
+===================================================================
+--- git.orig/configure.ac
++++ git/configure.ac
+@@ -360,25 +360,13 @@ case "${with_crypto}" in
+ AC_DEFINE([HAVE_NSS3], [1], [Define to 1 if you have 'NSS' library.])
+ ;;
+ gcrypt)
+- SAVE_LIBS=$LIBS
+- AC_CHECK_LIB([gcrypt], [gcry_check_version],
+- [crapi_CFLAGS=`libgcrypt-config --cflags`;
+- crapi_LIBS=`libgcrypt-config --libs`;
+- crapi_libname="GCrypt";],
+- [AC_MSG_ERROR([library 'gcrypt' is required for GCrypt.])],
+- [])
+- AC_DEFINE([HAVE_GCRYPT], [1], [Define to 1 if you have 'gcrypt' library.])
+- AC_CACHE_CHECK([for GCRYCTL_SET_ENFORCED_FIPS_FLAG],
+- [ac_cv_gcryctl_set_enforced_fips_flag],
+- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include<gcrypt.h>],
+- [return GCRYCTL_SET_ENFORCED_FIPS_FLAG;])],
+- [ac_cv_gcryctl_set_enforced_fips_flag=yes],
+- [ac_cv_gcryctl_set_enforced_fips_flag=no])])
++ PKG_CHECK_MODULES([libgcrypt], [libgcrypt >= 1.7.9],[],
++ AC_MSG_FAILURE([libgcrypt devel support is missing]))
+
+- if test "${ac_cv_gcryctl_set_enforced_fips_flag}" == "yes"; then
+- AC_DEFINE([HAVE_GCRYCTL_SET_ENFORCED_FIPS_FLAG], [1], [Define to 1 if you have 'gcrypt' library with GCRYCTL_SET_ENFORCED_FIPS_FLAG.])
+- fi
+- LIBS=$SAVE_LIBS
++ crapi_libname="libgcrypt"
++ crapi_CFLAGS=$libgcrypt_CFLAGS
++ crapi_LIBS=$libgcrypt_LIBS
++ AC_DEFINE([HAVE_GCRYPT], [1], [Define to 1 if you have 'libgcrypt' library.])
+ ;;
+ *)
+ AC_MSG_ERROR([unknown crypto backend])
diff --git a/meta-security/meta-security-compliance/recipes-openscap/openscap/files/probe_dir_fixup.patch b/meta-security/meta-security-compliance/recipes-openscap/openscap/files/probe_dir_fixup.patch
new file mode 100644
index 000000000..ecbe6026f
--- /dev/null
+++ b/meta-security/meta-security-compliance/recipes-openscap/openscap/files/probe_dir_fixup.patch
@@ -0,0 +1,17 @@
+Index: git/configure.ac
+===================================================================
+--- git.orig/configure.ac
++++ git/configure.ac
+@@ -1109,11 +1109,7 @@ AC_ARG_WITH([crypto],
+ [],
+ [crypto=gcrypt])
+
+-if test "x${libexecdir}" = xNONE; then
+- probe_dir="/usr/local/libexec/openscap"
+-else
+- EXPAND_DIR(probe_dir,"${libexecdir}/openscap")
+-fi
++probe_dir="/usr/local/libexec/openscap"
+
+ AC_SUBST(probe_dir)
+
diff --git a/meta-security/meta-security-compliance/recipes-openscap/openscap/files/run-ptest b/meta-security/meta-security-compliance/recipes-openscap/openscap/files/run-ptest
new file mode 100644
index 000000000..454a6a3c9
--- /dev/null
+++ b/meta-security/meta-security-compliance/recipes-openscap/openscap/files/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+cd tests
+make -k check
diff --git a/meta-security/meta-security-compliance/recipes-openscap/openscap/openscap.inc b/meta-security/meta-security-compliance/recipes-openscap/openscap/openscap.inc
new file mode 100644
index 000000000..e9589b6bd
--- /dev/null
+++ b/meta-security/meta-security-compliance/recipes-openscap/openscap/openscap.inc
@@ -0,0 +1,2 @@
+STAGING_OSCAP_DIR = "${TMPDIR}/work-shared/${MACHINE}/oscap-source"
+STAGING_OSCAP_BUILDDIR = "${TMPDIR}/work-shared/openscap/oscap-build-artifacts"
diff --git a/meta-security/meta-security-compliance/recipes-openscap/openscap/openscap_1.2.15.bb b/meta-security/meta-security-compliance/recipes-openscap/openscap/openscap_1.2.15.bb
new file mode 100644
index 000000000..7cbb1e2ec
--- /dev/null
+++ b/meta-security/meta-security-compliance/recipes-openscap/openscap/openscap_1.2.15.bb
@@ -0,0 +1,86 @@
+# Copyright (C) 2017 Armin Kuster <akuster808@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMARRY = "NIST Certified SCAP 1.2 toolkit"
+HOME_URL = "https://www.open-scap.org/tools/openscap-base/"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
+LICENSE = "LGPL-2.1"
+
+DEPENDS = "autoconf-archive pkgconfig gconf procps curl libxml2 rpm \
+ libxslt libcap swig swig-native"
+
+DEPENDS_class-native = "autoconf-archive-native pkgconfig-native swig-native curl-native libxml2-native libxslt-native dpkg-native libgcrypt-native nss-native"
+
+SRCREV = "240930d42611983c65ecae16dbca3248ce130921"
+SRC_URI = "git://github.com/akuster/openscap.git;branch=oe \
+ file://crypto_pkgconfig.patch \
+ file://run-ptest \
+"
+
+inherit autotools-brokensep pkgconfig python3native perlnative ptest
+
+S = "${WORKDIR}/git"
+
+PACKAGECONFIG ?= "nss3 pcre rpm"
+PACKAGECONFIG[pcre] = ",--enable-regex-posix, libpcre"
+PACKAGECONFIG[gcrypt] = "--with-crypto=gcrypt,, libgcrypt "
+PACKAGECONFIG[nss3] = "--with-crypto=nss3,, nss"
+PACKAGECONFIG[python] = "--enable-python, --disable-python, python, python"
+PACKAGECONFIG[python3] = "--enable-python3, --disable-python3, python3, python3"
+PACKAGECONFIG[perl] = "--enable-perl, --disable-perl, perl, perl"
+PACKAGECONFIG[rpm] = " --enable-util-scap-as-rpm, --disable-util-scap-as-rpm, rpm, rpm"
+
+export LDFLAGS += " -ldl"
+
+EXTRA_OECONF += "--enable-probes-independent --enable-probes-linux \
+ --enable-probes-solaris --enable-probes-unix --disable-util-oscap-docker\
+ --enable-util-oscap-ssh --enable-util-oscap --enable-ssp --enable-sce \
+"
+
+EXTRA_OECONF_class-native += "--disable-probes-independent --enable-probes-linux \
+ --disable-probes-solaris --disable-probes-unix \
+ --enable-util-oscap \
+"
+
+do_configure_prepend () {
+ sed -i 's:-I/usr/include:-I${STAGING_INCDIR}:' ${S}/swig/perl/Makefile.am
+ sed -i 's:-I/usr/include:-I${STAGING_INCDIR}:' ${S}/swig/python3/Makefile.am
+ sed -i 's:-I/usr/include:-I${STAGING_INCDIR}:' ${S}/swig/python2/Makefile.am
+}
+
+
+include openscap.inc
+
+do_configure_append_class-native () {
+ sed -i 's:OSCAP_DEFAULT_CPE_PATH.*$:OSCAP_DEFAULT_CPE_PATH "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/cpe":' ${S}/config.h
+ sed -i 's:OSCAP_DEFAULT_SCHEMA_PATH.*$:OSCAP_DEFAULT_SCHEMA_PATH "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/schemas":' ${S}/config.h
+ sed -i 's:OSCAP_DEFAULT_XSLT_PATH.*$:OSCAP_DEFAULT_XSLT_PATH "${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/xsl":' ${S}/config.h
+}
+
+do_clean[cleandirs] += " ${STAGING_OSCAP_BUILDDIR}"
+
+do_install_append_class-native () {
+ oscapdir=${STAGING_OSCAP_BUILDDIR}/${datadir_native}
+ install -d $oscapdir
+ cp -a ${D}/${STAGING_DATADIR_NATIVE}/openscap $oscapdir
+}
+
+TESTDIR = "tests"
+
+do_compile_ptest() {
+ sed -i 's:python2:python:' ${S}/${TESTDIR}/nist/test_worker.py
+ echo 'buildtest-TESTS: $(check)' >> ${TESTDIR}/Makefile
+ oe_runmake -C ${TESTDIR} buildtest-TESTS
+}
+
+do_install_ptest() {
+ # install the tests
+ cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH}
+}
+
+FILES_${PN} += "${PYTHON_SITEPACKAGES_DIR}"
+
+RDEPENDS_${PN} += "libxml2 python libgcc"
+RDEPENDS_${PN}-ptest = "bash perl python"
+
+BBCLASSEXTEND = "native"
diff --git a/meta-security/meta-security-compliance/recipes-openscap/scap-security-guide/scap-security-guide_0.1.33.bb b/meta-security/meta-security-compliance/recipes-openscap/scap-security-guide/scap-security-guide_0.1.33.bb
new file mode 100644
index 000000000..7fa417de4
--- /dev/null
+++ b/meta-security/meta-security-compliance/recipes-openscap/scap-security-guide/scap-security-guide_0.1.33.bb
@@ -0,0 +1,57 @@
+# Copyright (C) 2017 Armin Kuster <akuster808@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMARRY = "SCAP content for various platforms"
+HOME_URL = "https://www.open-scap.org/security-policies/scap-security-guide/"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=236e81befc8154d18c93c848185d7e52"
+LICENSE = "LGPL-2.1"
+
+DEPENDS = "openscap-native"
+
+SRCREV = "423d9f40021a03abd018bef7818a3a9fe91a083c"
+SRC_URI = "git://github.com/akuster/scap-security-guide.git;branch=oe;"
+
+inherit cmake
+
+PARALLEL_MAKE = ""
+
+S = "${WORKDIR}/git"
+
+STAGING_OSCAP_BUILDDIR = "${TMPDIR}/work-shared/openscap/oscap-build-artifacts"
+
+EXTRA_OECMAKE += "-DSSG_PRODUCT_CHROMIUM:BOOL=OFF"
+EXTRA_OECMAKE += "-DSSG_PRODUCT_DEBIAN8:BOOL=OFF"
+EXTRA_OECMAKE += "-DSSG_PRODUCT_FEDORA:BOOL=OFF"
+EXTRA_OECMAKE += "-DSSG_PRODUCT_FIREFOX:BOOL=OFF"
+EXTRA_OECMAKE += "-DSSG_PRODUCT_JBOSS_EAP5:BOOL=OFF"
+EXTRA_OECMAKE += "-DSSG_PRODUCT_JBOSS_FUSE6:BOOL=OFF"
+EXTRA_OECMAKE += "-DSSG_PRODUCT_JRE:BOOL=OFF"
+EXTRA_OECMAKE += "-DSSG_PRODUCT_OPENSUSE:BOOL=OFF"
+EXTRA_OECMAKE += "-DSSG_PRODUCT_OSP7:BOOL=OFF"
+EXTRA_OECMAKE += "-DSSG_PRODUCT_RHEL5:BOOL=OFF"
+EXTRA_OECMAKE += "-DSSG_PRODUCT_RHEL6:BOOL=OFF"
+EXTRA_OECMAKE += "-DSSG_PRODUCT_RHEL7:BOOL=OFF"
+EXTRA_OECMAKE += "-DSSG_PRODUCT_RHEV3:BOOL=OFF"
+EXTRA_OECMAKE += "-DSSG_PRODUCT_SUSE11:BOOL=OFF"
+EXTRA_OECMAKE += "-DSSG_PRODUCT_SUSE12:BOOL=OFF"
+EXTRA_OECMAKE += "-DSSG_PRODUCT_UBUNTU1404:BOOL=OFF"
+EXTRA_OECMAKE += "-DSSG_PRODUCT_UBUNTU1604:BOOL=OFF"
+EXTRA_OECMAKE += "-DSSG_PRODUCT_WRLINUX:BOOL=OFF"
+EXTRA_OECMAKE += "-DSSG_PRODUCT_WEBMIN:BOOL=OFF"
+
+do_configure_prepend () {
+ sed -i -e 's:NAMES\ sed:NAMES\ ${HOSTTOOLS_DIR}/sed:g' ${S}/CMakeLists.txt
+ sed -i 's:/usr/share/openscap/:${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/:g' ${S}/cmake/SSGCommon.cmake
+}
+
+do_compile () {
+ cd ${B}
+ make openembedded
+}
+
+do_install () {
+ cd ${B}
+ make DESTDIR=${D} install
+}
+FILES_${PN} += "${datadir}/xml"
+RDEPNEDS_${PN} = "openscap"
OpenPOWER on IntegriCloud