mirror of https://github.com/CISOfy/lynis.git
60 lines
2.3 KiB
Bash
60 lines
2.3 KiB
Bash
#!/bin/sh
|
|
|
|
#################################################################################
|
|
#
|
|
# Lynis
|
|
# ------------------
|
|
#
|
|
# Copyright 2007-2015, Michael Boelen, CISOfy (michael.boelen@cisofy.com)
|
|
# Web site: https://cisofy.com
|
|
#
|
|
# 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.
|
|
#
|
|
#################################################################################
|
|
#
|
|
# Here you could insert your own custom checks
|
|
#
|
|
# Tips:
|
|
# - Make sure to use each test ID only once in Register function
|
|
# - Use big steps in numbering, so you can easily put tests in between
|
|
# - Want to improve Lynis? Share your checks!
|
|
#
|
|
#################################################################################
|
|
#
|
|
# This has already been inserted, but you might reuse it to split your tests
|
|
# InsertSection "Custom Checks"
|
|
#
|
|
#################################################################################
|
|
#
|
|
# Test : CUST-0010
|
|
# Description : Check for something interesting - template
|
|
# This test first checks if OpenSSL binary was found
|
|
if [ ! -z "${OPENSSLBINARY}" ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
|
|
Register --test-no CUST-0010 --preqs-met ${PREQS_MET} --weight L --network NO --description "My description"
|
|
# Or you could use this one without any dependencies
|
|
# Register --test-no CUST-0010 --weight L --network NO --description "My description"
|
|
if [ ${SKIPTEST} -eq 0 ]; then
|
|
FOUND=0
|
|
logtext "Test: checking something"
|
|
ReportWarning ${TEST_NO} "M" "Test warning"
|
|
if [ ${FOUND} -eq 0 ]; then
|
|
Display --indent 4 --text "- Performing custom test 1" --result OK --color GREEN
|
|
logtext "Result: the test looks great!"
|
|
else
|
|
Display --indent 4 --text "- Performing custom test 1" --result WARNING --color RED
|
|
logtext "Result: hmm bad result of this test :("
|
|
ReportSuggestion ${TEST_NO} "This could be better!"
|
|
fi
|
|
fi
|
|
#
|
|
#################################################################################
|
|
#
|
|
|
|
wait_for_keypress
|
|
|
|
#
|
|
#================================================================================
|
|
# Lynis - Copyright 2007-2015, Michael Boelen, CISOfy - https://cisofy.com
|