Skip to contentSkip to conversation

meta-security-isafw: import layer from Intel

PATCH New akuster 1 participant 4 messages Feb 22, 2020

lore
Share & tools
lore

akuster

author
#0 lore raw

PATCH 1/4 meta-security-isafw: import layer from Intel

take over layer

---
 meta-security-isafw/.gitignore                |   2 +
 meta-security-isafw/COPYING.MIT               |  17 +
 meta-security-isafw/README.md                 |  82 ++++
 meta-security-isafw/classes/isafw.bbclass     | 318 ++++++++++++++
 meta-security-isafw/conf/layer.conf           |  17 +
 meta-security-isafw/lib/isafw/__init__.py     |  40 ++
 meta-security-isafw/lib/isafw/isafw.py        | 158 +++++++
 .../lib/isafw/isaplugins/ISA_cfa_plugin.py    | 392 ++++++++++++++++++
 .../lib/isafw/isaplugins/ISA_cve_plugin.py    | 217 ++++++++++
 .../lib/isafw/isaplugins/ISA_fsa_plugin.py    | 185 +++++++++
 .../lib/isafw/isaplugins/ISA_kca_plugin.py    | 323 +++++++++++++++
 .../lib/isafw/isaplugins/ISA_la_plugin.py     | 273 ++++++++++++
 .../lib/isafw/isaplugins/__init__.py          |  42 ++
 .../lib/isafw/isaplugins/configs/__init__.py  |   0
 .../isafw/isaplugins/configs/kca/__init__.py  |   0
 .../lib/isafw/isaplugins/configs/kca/arm.py   |  24 ++
 .../isafw/isaplugins/configs/kca/common.py    | 242 +++++++++++
 .../lib/isafw/isaplugins/configs/kca/x86.py   |  38 ++
 .../isaplugins/configs/la/approved-non-osi    |  43 ++
 .../isafw/isaplugins/configs/la/exceptions    |   0
 .../lib/isafw/isaplugins/configs/la/licenses  | 105 +++++
 .../isafw/isaplugins/configs/la/violations    |   7 +
 .../checksec/checksec_1.5-1.bb                |  25 ++
 23 files changed, 2550 insertions(+)
 create mode 100644 meta-security-isafw/.gitignore
 create mode 100644 meta-security-isafw/COPYING.MIT
 create mode 100644 meta-security-isafw/README.md
 create mode 100644 meta-security-isafw/classes/isafw.bbclass
 create mode 100644 meta-security-isafw/conf/layer.conf
 create mode 100644 meta-security-isafw/lib/isafw/__init__.py
 create mode 100644 meta-security-isafw/lib/isafw/isafw.py
 create mode 100644 meta-security-isafw/lib/isafw/isaplugins/ISA_cfa_plugin.py
 create mode 100644 meta-security-isafw/lib/isafw/isaplugins/ISA_cve_plugin.py
 create mode 100644 meta-security-isafw/lib/isafw/isaplugins/ISA_fsa_plugin.py
 create mode 100644 meta-security-isafw/lib/isafw/isaplugins/ISA_kca_plugin.py
 create mode 100644 meta-security-isafw/lib/isafw/isaplugins/ISA_la_plugin.py
 create mode 100644 meta-security-isafw/lib/isafw/isaplugins/__init__.py
 create mode 100644 meta-security-isafw/lib/isafw/isaplugins/configs/__init__.py
 create mode 100644 meta-security-isafw/lib/isafw/isaplugins/configs/kca/__init__.py
 create mode 100644 meta-security-isafw/lib/isafw/isaplugins/configs/kca/arm.py
 create mode 100644 meta-security-isafw/lib/isafw/isaplugins/configs/kca/common.py
 create mode 100644 meta-security-isafw/lib/isafw/isaplugins/configs/kca/x86.py
 create mode 100644 meta-security-isafw/lib/isafw/isaplugins/configs/la/approved-non-osi
 create mode 100644 meta-security-isafw/lib/isafw/isaplugins/configs/la/exceptions
 create mode 100644 meta-security-isafw/lib/isafw/isaplugins/configs/la/licenses
 create mode 100644 meta-security-isafw/lib/isafw/isaplugins/configs/la/violations
 create mode 100644 meta-security-isafw/recipes-devtools/checksec/checksec_1.5-1.bb
meta-security-isafw/.gitignore new file +2 -0
new file mode 100644
index 0000000..2f836aa
@@ -0,0 +1,2 @@
+*~
+*.pyc
meta-security-isafw/COPYING.MIT new file +17 -0
new file mode 100644
index 0000000..fb950dc
@@ -0,0 +1,17 @@
+Permission is hereby granted, free of charge, to any person obtaining a copy 
+of this software and associated documentation files (the "Software"), to deal 
+in the Software without restriction, including without limitation the rights 
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
+copies of the Software, and to permit persons to whom the Software is 
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in 
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
+THE SOFTWARE.
meta-security-isafw/README.md new file +82 -0

82 lines not on this page · raw message

meta-security-isafw/classes/isafw.bbclass new file +318 -0

318 lines not on this page · raw message

meta-security-isafw/conf/layer.conf new file +17 -0
new file mode 100644
index 0000000..5936139
@@ -0,0 +1,17 @@
+# We have a conf and classes directory, add to BBPATH
+BBPATH .= ":${LAYERDIR}"
+
+# We have recipes-* directories, add to BBFILES
+BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"
+
+BBFILE_COLLECTIONS += "security-isafw"
+BBFILE_PATTERN_security-isafw = "^${LAYERDIR}/"
+BBFILE_PRIORITY_security-isafw = "6"
+
+# This should only be incremented on significant changes that will
+# cause compatibility issues with other layers
+LAYERVERSION_security-isafw = "1"
+
+LAYERDEPENDS_security-isafw = "core"
+
+LAYERSERIES_COMPAT_security-isafw = "sumo thud"
meta-security-isafw/lib/isafw/__init__.py new file +40 -0
new file mode 100644
index 0000000..50527fb
@@ -0,0 +1,40 @@
+#
+# __init__.py - part of ISA FW
+#
+# Copyright (c) 2015 - 2016, Intel Corporation
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+#    * Redistributions of source code must retain the above copyright notice,
+#      this list of conditions and the following disclaimer.
+#    * Redistributions in binary form must reproduce the above copyright
+#      notice, this list of conditions and the following disclaimer in the
+#      documentation and/or other materials provided with the distribution.
+#    * Neither the name of Intel Corporation nor the names of its contributors
+#      may be used to endorse or promote products derived from this software
+#      without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""isafw
+
+Current Contents:
+
+* isafw.py - main class
+* plugins - ISA plugins
+* plugins/configs - configuration data for the plugins
+"""
+
+__all__ = [
+    'isafw',
+]
meta-security-isafw/lib/isafw/isafw.py new file +158 -0

158 lines not on this page · raw message

meta-security-isafw/lib/isafw/isaplugins/ISA_cfa_plugin.py new file +392 -0

392 lines not on this page · raw message

meta-security-isafw/lib/isafw/isaplugins/ISA_cve_plugin.py new file +217 -0

217 lines not on this page · raw message

meta-security-isafw/lib/isafw/isaplugins/ISA_fsa_plugin.py new file +185 -0

185 lines not on this page · raw message

meta-security-isafw/lib/isafw/isaplugins/ISA_kca_plugin.py new file +323 -0

323 lines not on this page · raw message

meta-security-isafw/lib/isafw/isaplugins/ISA_la_plugin.py new file +273 -0

273 lines not on this page · raw message

meta-security-isafw/lib/isafw/isaplugins/__init__.py new file +42 -0

42 lines not on this page · raw message

meta-security-isafw/lib/isafw/isaplugins/configs/__init__.py new file +0 -0
new file mode 100644
index 0000000..e69de29
meta-security-isafw/lib/isafw/isaplugins/configs/kca/__init__.py new file +0 -0
new file mode 100644
index 0000000..e69de29
meta-security-isafw/lib/isafw/isaplugins/configs/kca/arm.py new file +24 -0
new file mode 100644
index 0000000..d47ba9f
@@ -0,0 +1,24 @@
+############################################################################################
+# Kernel Hardening Configurations
+############################################################################################
+hardening_kco = {'CONFIG_DEFAULT_MMAP_MIN_ADDR': 'not set',}
+hardening_kco_ref = {'CONFIG_DEFAULT_MMAP_MIN_ADDR': '32768',}
+############################################################################################
+# Keys Kernel Configuration
+############################################################################################
+keys_kco = {}
+keys_kco_ref = {}
+############################################################################################
+# Security Kernel Configuration
+############################################################################################
+security_kco = {'CONFIG_LSM_MMAP_MIN_ADDR': 'not set',}
+security_kco_ref = {'CONFIG_LSM_MMAP_MIN_ADDR': '32768',}
+############################################################################################
+# Integrity Kernel Configuration
+############################################################################################
+integrity_kco = {}
+integrity_kco_ref = {}
+############################################################################################
+# Comments
+############################################################################################
+comments = {'CONFIG_DEFAULT_MMAP_MIN_ADDR': 'Defines the portion of low virtual memory that should be protected from userspace allocation. Keeping a user from writing to low pages can help reduce the impact of kernel NULL pointer bugs.'}
meta-security-isafw/lib/isafw/isaplugins/configs/kca/common.py new file +242 -0

242 lines not on this page · raw message

meta-security-isafw/lib/isafw/isaplugins/configs/kca/x86.py new file +38 -0
new file mode 100644
index 0000000..cbaddf8
@@ -0,0 +1,38 @@
+############################################################################################
+# Kernel Hardening Configurations
+############################################################################################
+hardening_kco = {'CONFIG_DEFAULT_MMAP_MIN_ADDR': 'not set',
+                 'CONFIG_RANDOMIZE_BASE_MAX_OFFSET': 'not set',
+                 'CONFIG_X86_INTEL_MPX': 'not set',
+                 'CONFIG_X86_MSR': 'not set'
+                 }
+hardening_kco_ref = {'CONFIG_DEFAULT_MMAP_MIN_ADDR': '65536',  # x86 specific
+                     'CONFIG_RANDOMIZE_BASE_MAX_OFFSET': '0x20000000,0x40000000',  # x86 specific
+                     'CONFIG_X86_INTEL_MPX': 'y',  # x86 and certain HW variants specific
+                     'CONFIG_X86_MSR': 'not set'
+                     }
+############################################################################################
+# Keys Kernel Configuration
+############################################################################################
+keys_kco = {}
+keys_kco_ref = {}
+############################################################################################
+# Security Kernel Configuration
+############################################################################################
+security_kco = {'CONFIG_LSM_MMAP_MIN_ADDR': 'not set',
+                'CONFIG_INTEL_TXT': 'not set'}
+security_kco_ref = {'CONFIG_LSM_MMAP_MIN_ADDR': '65536',  # x86 specific
+                    'CONFIG_INTEL_TXT': 'y'}
+############################################################################################
+# Integrity Kernel Configuration
+############################################################################################
+integrity_kco = {}
+integrity_kco_ref = {}
+############################################################################################
+# Comments
+############################################################################################
+comments = {'CONFIG_DEFAULT_MMAP_MIN_ADDR': 'Defines the portion of low virtual memory that should be protected from userspace allocation. Keeping a user from writing to low pages can help reduce the impact of kernel NULL pointer bugs.',
+            'CONFIG_RANDOMIZE_BASE_MAX_OFFSET': 'Defines the maximal offset in bytes that will be applied to the kernel when kernel Address Space Layout Randomization (kASLR) is active.',
+            'CONFIG_X86_INTEL_MPX': 'Enables MPX hardware features that can be used with compiler-instrumented code to check memory references. It is designed to detect buffer overflow or underflow bugs.',
+            'CONFIG_X86_MSR': 'Enables privileged processes access to the x86 Model-Specific Registers (MSRs). MSR accesses are directed to a specific CPU on multi-processor systems. This alone does not provide security.'
+            }
meta-security-isafw/lib/isafw/isaplugins/configs/la/approved-non-osi new file +43 -0

43 lines not on this page · raw message

meta-security-isafw/lib/isafw/isaplugins/configs/la/exceptions new file +0 -0
new file mode 100644
index 0000000..e69de29
meta-security-isafw/lib/isafw/isaplugins/configs/la/licenses new file +105 -0

105 lines not on this page · raw message

meta-security-isafw/lib/isafw/isaplugins/configs/la/violations new file +7 -0
new file mode 100644
index 0000000..5da203b
@@ -0,0 +1,7 @@
+GPL-3.0
+GPL-3.0+
+GPL-3.0-with-autoconf-exception
+GPL-3.0-with-GCC-exception
+LGPL-3.0
+LGPL-3.0+
+
meta-security-isafw/recipes-devtools/checksec/checksec_1.5-1.bb new file +25 -0
new file mode 100644
index 0000000..247ec76
@@ -0,0 +1,25 @@
+SUMMARY = "Checksec tool"
+DESCRIPTION = "The checksec.sh script is designed to test what standard Linux OS and PaX security features are being used."
+SECTION = "security"
+LICENSE = "BSD-3-Clause"
+HOMEPAGE="http://www.trapkit.de/tools/checksec.html"
+
+LIC_FILES_CHKSUM = "file://checksec-${PV}.sh;beginline=3;endline=34;md5=6dab14470bfdf12634b866dbdd7a04b0"
+
+SRC_URI = "http://www.trapkit.de/tools/checksec.sh;downloadfilename=checksec-${PV}.sh"
+
+SRC_URI[md5sum] = "57cc3fbbbe48e8ebd4672c569954374d"
+SRC_URI[sha256sum] = "05822cd8668589038d20650faa0e56f740911d8ad06f7005b3d12a5c76591b90"
+
+
+S = "${WORKDIR}"
+
+do_install() {
+    install -d ${D}${bindir}
+    install -m 0755 ${WORKDIR}/checksec-${PV}.sh    ${D}${bindir}/checksec.sh
+    sed -i 's/\r//' ${D}${bindir}/checksec.sh
+}
+
+RDEPENDS_${PN} = "bash binutils"
+
+BBCLASSEXTEND = "native"
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 2/4 isafw: fix to work against master

---
 .../classes/isafw.bbclass                                 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
 rename {meta-security-isafw => meta-security-isfafw}/classes/isafw.bbclass (97%)
meta-security-isfafw/classes/isafw.bbclass renamed from meta-security-isafw/classes/isafw.bbclass +4 -4
similarity index 97%
rename from meta-security-isafw/classes/isafw.bbclass
rename to meta-security-isfafw/classes/isafw.bbclass
index bec8d88..146acdf 100644
@@ -105,8 +105,8 @@ python process_reports_handler() {
     os.environ["PATH"] = savedenv["PATH"]
 }
 
-do_build[depends] += "cve-check-tool-native:do_populate_sysroot ca-certificates-native:do_populate_sysroot"
-do_build[depends] += "python-lxml-native:do_populate_sysroot"
+do_build[depends] += "cve-update-db-native:do_populate_cve_db ca-certificates-native:do_populate_sysroot"
+do_build[depends] += "python3-lxml-native:do_populate_sysroot"
 
 # These tasks are intended to be called directly by the user (e.g. bitbake -c)
 
@@ -180,14 +180,14 @@ fakeroot python do_analyse_image() {
 
 do_rootfs[depends] += "checksec-native:do_populate_sysroot ca-certificates-native:do_populate_sysroot"
 do_rootfs[depends] += "prelink-native:do_populate_sysroot"
-do_rootfs[depends] += "python-lxml-native:do_populate_sysroot"
+do_rootfs[depends] += "python3-lxml-native:do_populate_sysroot"
 
 isafw_init[vardepsexclude] = "DATETIME"
 def isafw_init(isafw, d):
     import re, errno
 
     isafw_config = isafw.ISA_config()
-    # Override the builtin default in curl-native (used by cve-check-tool-native)
+    # Override the builtin default in curl-native (used by cve-update-db-nativ)
     # because that default is a path that may not be valid: when curl-native gets
     # installed from sstate, we end up with the sysroot path as it was on the
     # original build host, which is not necessarily the same path used now
Signature · 1 line
2.17.1
author
#2 lore raw

PATCH 3/4 layer.conf: add zeus

In reply to akuster
---
 meta-security-isafw/conf/layer.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-security-isafw/conf/layer.conf +1 -1
index 5936139..241c461 100644
@@ -14,4 +14,4 @@ LAYERVERSION_security-isafw = "1"
 
 LAYERDEPENDS_security-isafw = "core"
 
-LAYERSERIES_COMPAT_security-isafw = "sumo thud"
+LAYERSERIES_COMPAT_security-isafw = "zeus"
Signature · 1 line
2.17.1
author
#3 lore raw

PATCH 4/4 README.md: update to new maintainer

In reply to akuster
---
 meta-security-isafw/README.md | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
meta-security-isafw/README.md +13 -3
index 16b2eb9..16041cb 100644
@@ -42,7 +42,7 @@ any other layers needed. e.g.:
 ```python
 BBLAYERS ?= " \
   /OE/oe-core/meta \
-  /OE/meta-security-isafw \
+  /OE/meta-security/meta-security-isafw \
   "
 ```
  
@@ -75,8 +75,18 @@ please define ISAFW_REPORTDIR variable in your local.conf file.
 
 Patches
 -------
+end pull requests, patches, comments or questions to [email protected]
 
-Please submit any patches via Github pull requests.
+When sending single patches, please using something like:
+'git send-email -1 --to [email protected] --subject-prefix=meta-security-isafw][PATCH'
 
-Maintainer: Elena Reshetova [email protected]
+These values can be set as defaults for this repository:
 
+$ git config sendemail.to [email protected]
+$ git config format.subjectPrefix meta-security-isafw][PATCH
+
+Now you can just do 'git send-email origin/master' to send all local patches.
+
+For pull requests, please use create-pull-request and send-pull-request.
+
+Maintainers:    Armin Kuster <[email protected]>
Signature · 1 line
2.17.1