mirror of https://github.com/CISOfy/lynis.git
Include examples and clarify usage
This commit is contained in:
parent
8f9a616854
commit
17c44ced52
|
@ -33,22 +33,27 @@
|
||||||
# Description : Check for something interesting - template
|
# Description : Check for something interesting - template
|
||||||
# Notes : This test first checks if OpenSSL binary was found
|
# Notes : This test first checks if OpenSSL binary was found
|
||||||
|
|
||||||
# * Prerequisites check
|
# * Prerequisites Check
|
||||||
|
# -----------------------
|
||||||
#
|
#
|
||||||
# We check first if a variable is defined (OPENSSLBINARY).
|
# Check first if any dependency. If it doesn't meet, the test will be skipped after registration (SKIPTEST == 1)
|
||||||
# Other good options to check for:
|
#
|
||||||
# -f /etc/file
|
# Examples:
|
||||||
# -d /var/run/mydirectory
|
# -f /etc/file = Test if file exists
|
||||||
# ${MYVARIABLE} -eq 1
|
# -d /var/run/mydirectory = Test if directory exists
|
||||||
if [ ! -z "${OPENSSLBINARY}" ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
|
# ${MYVARIABLE} -eq 1 = Test if variable is set to 1
|
||||||
|
# "${MYVARIABLE}" = "Value" = Test if variable is equal to specific value
|
||||||
|
|
||||||
# * Test registration
|
if [ -f /etc/myfile ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
|
||||||
|
|
||||||
|
# * Registration of Test
|
||||||
|
# ------------------------
|
||||||
#
|
#
|
||||||
# Register the test, with custom ID CUST-0010, and only execute it when the prerequisites were met
|
# Register the test, with custom ID CUST-0010, and only execute it when the prerequisites were met
|
||||||
Register --test-no CUST-0010 --preqs-met ${PREQS_MET} --weight L --network NO --description "My description of what this test does"
|
Register --test-no CUST-0010 --preqs-met ${PREQS_MET} --weight L --network NO --description "Description of what this test does"
|
||||||
|
|
||||||
# Or you could use this one without any dependencies
|
# Or we could use this test without any dependencies
|
||||||
# Register --test-no CUST-0010 --weight L --network NO --description "My description"
|
# Register --test-no CUST-0010 --weight L --network NO --description "Description of what this test does"
|
||||||
|
|
||||||
# If everything is fine, perform test
|
# If everything is fine, perform test
|
||||||
if [ ${SKIPTEST} -eq 0 ]; then
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
|
|
Loading…
Reference in New Issue