lynis/include/tests_system_integrity

55 lines
2.1 KiB
Plaintext
Raw Normal View History

2016-10-05 09:50:20 +02:00
#!/bin/sh
#################################################################################
#
# Lynis
# ------------------
#
# Copyright 2007-2013, Michael Boelen
2020-03-20 14:50:25 +01:00
# Copyright 2007-2020, 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
#
#################################################################################
#
2017-04-23 20:06:54 +02:00
InsertSection "Software: system integrity"
2016-10-05 09:50:20 +02:00
Display --indent 2 --text "- Checking file integrity tools"
#
#################################################################################
#
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
#
#================================================================================
2020-03-20 14:50:25 +01:00
# Lynis - Copyright 2007-2020 Michael Boelen, CISOfy - https://cisofy.com