lynis/include/tests_system_integrity

57 lines
2.2 KiB
Plaintext
Raw Normal View History

2016-10-05 09:50:20 +02:00
#!/bin/sh
#################################################################################
#
# Lynis
# ------------------
#
# Copyright 2007-2013, Michael Boelen
2021-01-07 15:22:19 +01:00
# Copyright 2007-2021, CISOfy
2016-10-05 09:50:20 +02:00
#
# Website : https://cisofy.com
# Blog : http://linux-audit.com
# GitHub : https://github.com/CISOfy/lynis
#
# Lynis comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
# welcome to redistribute it under the terms of the GNU General Public License.
# See LICENSE file for usage of this software.
#
#################################################################################
#
AIDECONFIG=""
CSF_CONFIG="${ROOTDIR}etc/csf/csf.conf"
FILE_INT_TOOL=""
FILE_INT_TOOL_FOUND=0 # Boolean, file integrity tool found
#
#################################################################################
#
InsertSection "${SECTION_SYSTEM_INTEGRITY}"
2016-10-05 09:50:20 +02:00
Display --indent 2 --text "- Checking file integrity tools"
#
#################################################################################
#
# Test : SINT-7010
# Description : System Integrity Status
2017-04-23 20:06:54 +02:00
if [ -x ${ROOTDIR}/usr/bin/csrutil ]; then PREQS_MET="YES"; else PREQS_MET="NO"; SKIPREASON="No CSrutil binary found"; fi
2019-10-08 19:31:35 +02:00
Register --test-no SINT-7010 --os MacOS --preqs-met ${PREQS_MET} --skip-reason "${SKIPREASON}" --weight H --network NO --category security --description "System Integrity Status"
2016-10-05 09:50:20 +02:00
if [ ${SKIPTEST} -eq 0 ]; then
2017-04-23 20:06:54 +02:00
if ${ROOTDIR}usr/bin/csrutil status | ${GREPBINARY} -sq enabled ; then
Display --indent 2 --text "- System Integrity Protection (status)" --result "${STATUS_OK}" --color GREEN
2016-10-05 09:50:20 +02:00
Report "system_integrity_tool[]=mac-sip"
LogText "Result: SIP enabled, OK"
AddHP 3 3
else
Display --indent 2 --text "- System Integrity Protection (status)" --result "${STATUS_NO}" --color RED
LogText "Result: SIP disabled, BAD"
AddHP 0 3
fi
fi
#
#################################################################################
#
WaitForKeyPress
#
#================================================================================
2021-01-07 15:22:19 +01:00
# Lynis - Copyright 2007-2021 Michael Boelen, CISOfy - https://cisofy.com