Welcome to mirror list, hosted at ThFree Co, Russian Federation.

tests_system_integrity « include - github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: befe09a0090069b5159aac08c005b293ebece579 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh

#################################################################################
#
#   Lynis
# ------------------
#
# Copyright 2007-2013, Michael Boelen
# Copyright 2007-2021, CISOfy
#
# 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}"
    Display --indent 2 --text "- Checking file integrity tools"
#
#################################################################################
#
    if [ -x ${ROOTDIR}/usr/bin/csrutil ]; then PREQS_MET="YES"; else PREQS_MET="NO"; SKIPREASON="No CSrutil binary found"; fi
    Register --test-no SINT-7010 --os MacOS --preqs-met ${PREQS_MET} --skip-reason "${SKIPREASON}" --weight H --network NO --category security --description "System Integrity Status"
    if [ ${SKIPTEST} -eq 0 ]; then
        if ${ROOTDIR}usr/bin/csrutil status | ${GREPBINARY} -sq enabled ; then
            Display --indent 2 --text "- System Integrity Protection (status)" --result "${STATUS_OK}" --color GREEN
            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
#
#================================================================================
# Lynis - Copyright 2007-2021 Michael Boelen, CISOfy - https://cisofy.com