From f70d712e4f505f5c5b50ae17f4f023d20a667568 Mon Sep 17 00:00:00 2001 From: José Bollo Date: Wed, 24 Jan 2018 11:38:43 +0100 Subject: Integrate parts of meta-intel-iot-security MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the recipes of the sub layers - meta-security-framework - meta-security-smack Change-Id: I618608008a3b3d1d34adb6e38048110f13ac0643 Signed-off-by: José Bollo --- meta-security/lib/oeqa/runtime/__init__.py | 0 meta-security/lib/oeqa/runtime/files/notroot.py | 33 ++ .../oeqa/runtime/files/smack_test_file_access.sh | 54 ++ .../files/test_privileged_change_self_label.sh | 18 + .../lib/oeqa/runtime/files/test_smack_onlycap.sh | 27 + .../oeqa/runtime/files/test_smack_tcp_sockets.sh | 108 ++++ .../oeqa/runtime/files/test_smack_udp_sockets.sh | 107 ++++ meta-security/lib/oeqa/runtime/securitymanager.py | 108 ++++ meta-security/lib/oeqa/runtime/smack.py | 589 +++++++++++++++++++++ 9 files changed, 1044 insertions(+) create mode 100644 meta-security/lib/oeqa/runtime/__init__.py create mode 100644 meta-security/lib/oeqa/runtime/files/notroot.py create mode 100644 meta-security/lib/oeqa/runtime/files/smack_test_file_access.sh create mode 100644 meta-security/lib/oeqa/runtime/files/test_privileged_change_self_label.sh create mode 100644 meta-security/lib/oeqa/runtime/files/test_smack_onlycap.sh create mode 100644 meta-security/lib/oeqa/runtime/files/test_smack_tcp_sockets.sh create mode 100644 meta-security/lib/oeqa/runtime/files/test_smack_udp_sockets.sh create mode 100644 meta-security/lib/oeqa/runtime/securitymanager.py create mode 100644 meta-security/lib/oeqa/runtime/smack.py (limited to 'meta-security/lib/oeqa') diff --git a/meta-security/lib/oeqa/runtime/__init__.py b/meta-security/lib/oeqa/runtime/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/meta-security/lib/oeqa/runtime/files/notroot.py b/meta-security/lib/oeqa/runtime/files/notroot.py new file mode 100644 index 000000000..f0eb0b5b9 --- /dev/null +++ b/meta-security/lib/oeqa/runtime/files/notroot.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python +# +# Script used for running executables with custom labels, as well as custom uid/gid +# Process label is changed by writing to /proc/self/attr/curent +# +# Script expects user id and group id to exist, and be the same. +# +# From adduser manual: +# """By default, each user in Debian GNU/Linux is given a corresponding group +# with the same name. """ +# +# Usage: root@desk:~# python notroot.py