mirror of https://github.com/CISOfy/lynis.git
Added /proc/modules as dependency to KRNL-5723 and KRNL-5726
This commit is contained in:
parent
bba133afbb
commit
fb53e586fe
|
@ -175,7 +175,7 @@
|
|||
# Description : Check if Linux is build as a monolithic kernel or not
|
||||
Register --test-no KRNL-5723 --os Linux --weight L --network NO --description "Determining if Linux kernel is monolithic"
|
||||
if [ ${SKIPTEST} -eq 0 ]; then
|
||||
if [ ! "${LSMODBINARY}" = "" ]; then
|
||||
if [ ! "${LSMODBINARY}" = "" -a -f /proc/modules ]; then
|
||||
logtext "Test: checking if kernel is monolithic or modular"
|
||||
# Checking if any modules are loaded
|
||||
FIND=`${LSMODBINARY} | grep -v "^Module" | wc -l | tr -s ' ' | tr -d ' '`
|
||||
|
@ -190,8 +190,7 @@
|
|||
MONOLITHIC_KERNEL=0
|
||||
fi
|
||||
else
|
||||
logtext "Test skipped, no lsmod binary found"
|
||||
# Exception?
|
||||
logtext "Test skipped, lsmod binary not found or /proc/modules can not be opened"
|
||||
fi
|
||||
fi
|
||||
#
|
||||
|
@ -201,7 +200,7 @@
|
|||
# Description : Checking Linux loaded kernel modules
|
||||
Register --test-no KRNL-5726 --os Linux --weight L --network NO --description "Checking Linux loaded kernel modules"
|
||||
if [ ${SKIPTEST} -eq 0 ]; then
|
||||
if [ ! "${LSMODBINARY}" = "" ]; then
|
||||
if [ ! "${LSMODBINARY}" = "" -a -f /proc/modules ]; then
|
||||
FIND=`lsmod | awk '{ if ($1!="Module") print $1 }' | sort`
|
||||
Display --indent 2 --text "- Checking loaded kernel modules" --result DONE --color GREEN
|
||||
if [ ! "${FIND}" = "" ]; then
|
||||
|
@ -218,8 +217,7 @@
|
|||
logtext "Notice: No loaded kernel modules could indicate a broken/malformed lsmod, or a (custom) monolithic kernel"
|
||||
fi
|
||||
else
|
||||
logtext "Test skipped, no lsmod binary found"
|
||||
# Exception?
|
||||
logtext "Test skipped, lsmod binary not found or /proc/modules can not be opened"
|
||||
fi
|
||||
fi
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue