[FILE-6398] test disabled

This commit is contained in:
Michael Boelen 2024-10-15 17:26:19 +00:00
parent b1e1f61975
commit f6275f6397
No known key found for this signature in database
GPG Key ID: 26141F77A09D7F04
2 changed files with 44 additions and 43 deletions

View File

@ -8,7 +8,7 @@
### Changed
- BOOT-5264 - Changed output of systemd-analyze test and added link
- FILE-6398 - Only perform test if we know if Linux kernel is monolithic/modular
- FILE-6398 - Test temporarily disabled as on modern kernels JDB support is built-in
- FIRE-4508 - Several changes to expand the test, make it more generic, resolve minor issues
- KRNL-5622 - Test if systemctl binary is set
- Update of translations: Italian, Russian

View File

@ -734,48 +734,49 @@
#
# Test : FILE-6398
# Description : Check if JBD (Journal Block Device) driver is loaded
Register --test-no FILE-6398 --os Linux --weight L --network NO --category security --description "Checking if JBD (Journal Block Device) driver is loaded"
if [ ${SKIPTEST} -eq 0 ]; then
LogText "Test: Checking if JBD (Journal Block Device) driver is loaded"
NOTINUSE=0
# Only perform testing if we know that KRNL-5723 performed tests
if [ ${MONOLITHIC_KERNEL_TESTED} -eq 1 ]; then
# Cannot check if driver is loaded/present if kernel is monolithic
if [ ${MONOLITHIC_KERNEL} -eq 0 ]; then
JBD=$(${LSMODBINARY} | ${GREPBINARY} ^jbd)
if [ -n "${JBD}" ]; then
LogText "Result: JBD driver is loaded"
INUSE=$(echo ${JBD} | ${AWKBINARY} '{if ($3 -ne 0) {print $4}}')
if [ -n "${INUSE}" ]; then
LogText "Result: JBD driver is in use by drivers: ${INUSE}"
Report "JBD driver is in use by drivers: ${INUSE}"
Display --indent 2 --text "- JBD driver loaded and in use" --result "${STATUS_OK}" --color GREEN
else
NOTINUSE=1
LogText "Result: JBD driver loaded, but not in use"
Report "JBD driver is loaded, but not in use."
Display --indent 2 --text "- JBD driver loaded, but not in use" --result "${STATUS_SUGGESTION}" --color YELLOW
fi
else
NOTINUSE=2
LogText "Result: JBD driver not loaded"
Report "JBD driver not loaded."
Display --indent 2 --text "- JBD driver is not loaded" --result "${STATUS_CHECK_NEEDED}" --color YELLOW
fi
if [ ${NOTINUSE} -eq 1 ]; then
ReportSuggestion "${TEST_NO}" "The JBD (Journal Block Device) driver is loaded but not in use." "You are currently not using any filesystems with journaling, i.e. you have greater risk of data corruption in case of system crash."
elif [ ${NOTINUSE} -eq 2 ]; then
ReportSuggestion "${TEST_NO}" "The JBD (Journal Block Device) driver is not loaded." "Since boot-time, you have not been using any filesystems with journaling. Alternatively, reason could be driver is blacklisted."
fi
else
Display --indent 2 --text "- JBD driver: unable to check" --result "${STATUS_UNKNOWN}" --color YELLOW
LogText "Kernel is monolithic - cannot check if JBD driver is part of compiled kernel."
fi
else
Display --indent 2 --text "- JBD driver: test skipped" --result "${STATUS_UNKNOWN}" --color YELLOW
LogText "Test skipped as the kernel type (monolithic/modular) is unknown"
fi
fi
# Notes : Test is temporarily disabled, as JBD might be in a kernel (built-in) - https://github.com/CISOfy/lynis/issues/1508
# Register --test-no FILE-6398 --os Linux --weight L --network NO --category security --description "Checking if JBD (Journal Block Device) driver is loaded"
# if [ ${SKIPTEST} -eq 0 ]; then
# LogText "Test: Checking if JBD (Journal Block Device) driver is loaded"
# NOTINUSE=0
# # Only perform testing if we know that KRNL-5723 performed tests
# if [ ${MONOLITHIC_KERNEL_TESTED} -eq 1 ]; then
# # Cannot check if driver is loaded/present if kernel is monolithic
# if [ ${MONOLITHIC_KERNEL} -eq 0 ]; then
# JBD=$(${LSMODBINARY} | ${GREPBINARY} ^jbd)
# if [ -n "${JBD}" ]; then
# LogText "Result: JBD driver is loaded"
# INUSE=$(echo ${JBD} | ${AWKBINARY} '{if ($3 -ne 0) {print $4}}')
# if [ -n "${INUSE}" ]; then
# LogText "Result: JBD driver is in use by drivers: ${INUSE}"
# Report "JBD driver is in use by drivers: ${INUSE}"
# Display --indent 2 --text "- JBD driver loaded and in use" --result "${STATUS_OK}" --color GREEN
# else
# NOTINUSE=1
# LogText "Result: JBD driver loaded, but not in use"
# Report "JBD driver is loaded, but not in use."
# Display --indent 2 --text "- JBD driver loaded, but not in use" --result "${STATUS_SUGGESTION}" --color YELLOW
# fi
# else
# NOTINUSE=2
# LogText "Result: JBD driver not loaded"
# Report "JBD driver not loaded."
# Display --indent 2 --text "- JBD driver is not loaded" --result "${STATUS_CHECK_NEEDED}" --color YELLOW
# fi
# if [ ${NOTINUSE} -eq 1 ]; then
# ReportSuggestion "${TEST_NO}" "The JBD (Journal Block Device) driver is loaded but not in use." "You are currently not using any filesystems with journaling, i.e. you have greater risk of data corruption in case of system crash."
# elif [ ${NOTINUSE} -eq 2 ]; then
# ReportSuggestion "${TEST_NO}" "The JBD (Journal Block Device) driver is not loaded." "Since boot-time, you have not been using any filesystems with journaling. Alternatively, reason could be driver is blacklisted."
# fi
# else
# Display --indent 2 --text "- JBD driver: unable to check" --result "${STATUS_UNKNOWN}" --color YELLOW
# LogText "Kernel is monolithic - cannot check if JBD driver is part of compiled kernel."
# fi
# else
# Display --indent 2 --text "- JBD driver: test skipped" --result "${STATUS_UNKNOWN}" --color YELLOW
# LogText "Test skipped as the kernel type (monolithic/modular) is unknown"
# fi
# fi
#
#################################################################################
#