mirror of https://github.com/CISOfy/lynis.git
Added support for /boot/config.gz file
This commit is contained in:
parent
1267f89e5b
commit
e12b95ba88
|
@ -25,6 +25,8 @@
|
||||||
CORE_DUMPS_DISABLED=0
|
CORE_DUMPS_DISABLED=0
|
||||||
CPU_PAE=0
|
CPU_PAE=0
|
||||||
CPU_NX=0
|
CPU_NX=0
|
||||||
|
LINUXCONFIGFILE=""
|
||||||
|
LINUXCONFIGFILE_ZIPPED=0
|
||||||
#
|
#
|
||||||
#################################################################################
|
#################################################################################
|
||||||
#
|
#
|
||||||
|
@ -227,14 +229,23 @@
|
||||||
# Description : Checking for available Linux kernel configuration file in /boot
|
# Description : Checking for available Linux kernel configuration file in /boot
|
||||||
Register --test-no KRNL-5728 --os Linux --weight L --network NO --description "Checking Linux kernel config"
|
Register --test-no KRNL-5728 --os Linux --weight L --network NO --description "Checking Linux kernel config"
|
||||||
if [ ${SKIPTEST} -eq 0 ]; then
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
LINUXCONFIGFILE="/boot/config-`uname -r`"
|
CHECKFILE="/boot/config-`uname -r`"
|
||||||
if [ -f ${LINUXCONFIGFILE} ]; then
|
if [ -f ${CHECKFILE} ]; then
|
||||||
|
LINUXCONFIGFILE="${CHECKFILE}"
|
||||||
logtext "Result: found config (${LINUXCONFIGFILE})"
|
logtext "Result: found config (${LINUXCONFIGFILE})"
|
||||||
Display --indent 2 --text "- Checking Linux kernel configuration file" --result FOUND --color GREEN
|
Display --indent 2 --text "- Checking Linux kernel configuration file" --result FOUND --color GREEN
|
||||||
|
elif [ -f /boot/config.gz ]; then
|
||||||
|
LINUXCONFIGFILE="${CHECKFILE}"
|
||||||
|
LINUXCONFIGFILE_ZIPPED=1
|
||||||
|
logtext "Result: found config: /boot/config.gz (compressed)"
|
||||||
|
Display --indent 2 --text "- Checking Linux kernel configuration file" --result FOUND --color GREEN
|
||||||
else
|
else
|
||||||
logtext "Result: no Linux kernel configuration file found in /boot"
|
logtext "Result: no Linux kernel configuration file found in /boot"
|
||||||
Display --indent 2 --text "- Checking Linux kernel configuration file" --result "NOT FOUND" --color WHITE
|
Display --indent 2 --text "- Checking Linux kernel configuration file" --result "NOT FOUND" --color WHITE
|
||||||
fi
|
fi
|
||||||
|
if [ ! "${LINUXCONFIGFILE}" = "" ]; then
|
||||||
|
report "linux_config_file=${LINUXCONFIGFILE}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
#################################################################################
|
#################################################################################
|
||||||
|
@ -247,8 +258,10 @@
|
||||||
fi
|
fi
|
||||||
Register --test-no KRNL-5730 --os Linux --preqs-met ${PREQS_MET} --weight L --network NO --description "Checking disk I/O kernel scheduler"
|
Register --test-no KRNL-5730 --os Linux --preqs-met ${PREQS_MET} --weight L --network NO --description "Checking disk I/O kernel scheduler"
|
||||||
if [ ${SKIPTEST} -eq 0 ]; then
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
|
if [ ${LINUXCONFIGFILE_ZIPPED} -eq 1 ]; then GREPTOOL="${ZGREPBINARY}"; else GREPTOOL="${GREPBINARY}"; fi
|
||||||
|
if [ ! "${GREPTOOL}" = "" ]; then
|
||||||
logtext "Test: Checking the default I/O kernel scheduler"
|
logtext "Test: Checking the default I/O kernel scheduler"
|
||||||
LINUX_KERNEL_IOSCHED=`${GREPBINARY} "CONFIG_DEFAULT_IOSCHED" ${LINUXCONFIGFILE} | awk -F= '{ print $2 }' | sed s/\"//g`
|
LINUX_KERNEL_IOSCHED=`${GREPTOOL} "CONFIG_DEFAULT_IOSCHED" ${LINUXCONFIGFILE} | awk -F= '{ print $2 }' | sed s/\"//g`
|
||||||
if [ ! "${LINUX_KERNEL_IOSCHED}" = "" ]; then
|
if [ ! "${LINUX_KERNEL_IOSCHED}" = "" ]; then
|
||||||
logtext "Result: found IO scheduler '${LINUX_KERNEL_IOSCHED}'"
|
logtext "Result: found IO scheduler '${LINUX_KERNEL_IOSCHED}'"
|
||||||
Display --indent 2 --text "- Checking default I/O kernel scheduler" --result FOUND --color GREEN
|
Display --indent 2 --text "- Checking default I/O kernel scheduler" --result FOUND --color GREEN
|
||||||
|
@ -257,6 +270,9 @@
|
||||||
logtext "Result: no default i/o kernel scheduler found"
|
logtext "Result: no default i/o kernel scheduler found"
|
||||||
Display --indent 2 --text "- Checking default I/O kernel scheduler" --result "NOT FOUND" --color WHITE
|
Display --indent 2 --text "- Checking default I/O kernel scheduler" --result "NOT FOUND" --color WHITE
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
ReportException "${TEST_NO}" "No valid grep tool found to search kernel settings"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
#################################################################################
|
#################################################################################
|
||||||
|
|
Loading…
Reference in New Issue