From e09fe98b893dc69ac5fad65829c8b0c52f232f98 Mon Sep 17 00:00:00 2001 From: Topi Miettinen Date: Mon, 23 Mar 2020 18:41:58 +0200 Subject: Enhance TOMOYO Linux check Count and log unconfined processes, which are not using policy profile 3. Signed-off-by: Topi Miettinen --- include/tests_mac_frameworks | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/tests_mac_frameworks') diff --git a/include/tests_mac_frameworks b/include/tests_mac_frameworks index 94f2065d..3f23c77e 100644 --- a/include/tests_mac_frameworks +++ b/include/tests_mac_frameworks @@ -206,6 +206,13 @@ LogText "Result: TOMOYO Linux is enabled" Display --indent 4 --text "- Checking TOMOYO Linux status" --result "${STATUS_ENABLED}" --color GREEN Report "tomoyo_enabled=1" + if [ ! -z ${TOMOYOPSTREEBINARY} ]; then + NUNCONFINED=$(${TOMOYOPSTREEBINARY} | ${GREPBINARY} -v '^ 3 ' | ${WCBINARY} --lines) + Display --indent 8 --text "Found ${NUNCONFINED} unconfined (not profile 3) processes" + for PROCESS in $(${TOMOYOPSTREEBINARY} | ${GREPBINARY} -v '^ 3 ' | ${SEDBINARY} -e 's/+-//g' -e 's/^ *//g' -e 's/ \+/:/g' | ${SORTBINARY}); do + LogText "Result: Unconfined process: ${PROCESS}" + done + fi AddHP 3 3 else LogText "Result: TOMOYO Linux is disabled" -- cgit v1.2.3