mirror of https://github.com/CISOfy/lynis.git
BOOT-5117 adds systemd-boot bootloader detection (#634)
Adds a test to detect systemd-boot. The 'bootctl' binary is also added as this is the utility used to inspect the systemd-boot configuration. This test is only executed if systemd is installed, the bootctl utility exists and the system is booted in UEFI mode.
This commit is contained in:
parent
fb567465c9
commit
341612418f
|
@ -108,6 +108,7 @@
|
||||||
autolog) AUTOLOGBINARY="${BINARY}"; IDLE_SESSION_KILLER_INSTALLED=1; LogText " Found known binary: autolog (idle session killer) - ${BINARY}" ;;
|
autolog) AUTOLOGBINARY="${BINARY}"; IDLE_SESSION_KILLER_INSTALLED=1; LogText " Found known binary: autolog (idle session killer) - ${BINARY}" ;;
|
||||||
base64) BASE64BINARY="${BINARY}"; LogText " Found known binary: base64 (encoding tool) - ${BINARY}" ;;
|
base64) BASE64BINARY="${BINARY}"; LogText " Found known binary: base64 (encoding tool) - ${BINARY}" ;;
|
||||||
blkid) BLKDBINARY="${BINARY}"; LogText " Found known binary: blkid (information about block devices) - ${BINARY}" ;;
|
blkid) BLKDBINARY="${BINARY}"; LogText " Found known binary: blkid (information about block devices) - ${BINARY}" ;;
|
||||||
|
bootctl) BOOTCTLBINARY="${BINARY}"; LogText " Found known binary: bootctl (systemd-boot manager utility) - ${BINARY}" ;;
|
||||||
cat) CAT_BINARY="${BINARY}"; LogText " Found known binary: cat (generic file handling) - ${BINARY}" ;;
|
cat) CAT_BINARY="${BINARY}"; LogText " Found known binary: cat (generic file handling) - ${BINARY}" ;;
|
||||||
cc) CCBINARY="${BINARY}"; COMPILER_INSTALLED=1; LogText " Found known binary: cc (compiler) - ${BINARY}" ;;
|
cc) CCBINARY="${BINARY}"; COMPILER_INSTALLED=1; LogText " Found known binary: cc (compiler) - ${BINARY}" ;;
|
||||||
chkconfig) CHKCONFIGBINARY=${BINARY}; LogText " Found known binary: chkconfig (administration tool) - ${BINARY}" ;;
|
chkconfig) CHKCONFIGBINARY=${BINARY}; LogText " Found known binary: chkconfig (administration tool) - ${BINARY}" ;;
|
||||||
|
|
|
@ -239,6 +239,23 @@
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
#################################################################################
|
#################################################################################
|
||||||
|
#
|
||||||
|
# Test : BOOT-5117
|
||||||
|
# Description : Check for systemd-boot boot loader
|
||||||
|
if [ ! "${BOOTCTLBINARY}" = "" -a ${HAS_SYSTEMD} -eq 1 -a ${UEFI_BOOTED} -eq 1 ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
|
||||||
|
Register --test-no BOOT-5117 --preqs-met ${PREQS_MET} --os "Linux" --weight L --network NO --category security --description "Check for systemd-boot bootloader presence"
|
||||||
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
|
BOOT_LOADER_SEARCHED=1
|
||||||
|
CURRENT_BOOT_LOADER=$(${BOOTCTLBINARY} status --no-pager 2>/dev/null | ${AWKBINARY} '/Current Boot Loader/{ getline; print $2 }')
|
||||||
|
if [ "${CURRENT_BOOT_LOADER}" = "systemd-boot" ]; then
|
||||||
|
Display --indent 2 --text "- Checking systemd-boot presence" --result "${STATUS_FOUND}" --color GREEN
|
||||||
|
LogText "Result: found systemd-boot"
|
||||||
|
BOOT_LOADER="systemd-boot"
|
||||||
|
BOOT_LOADER_FOUND=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
#
|
||||||
|
#################################################################################
|
||||||
#
|
#
|
||||||
# Test : BOOT-5121
|
# Test : BOOT-5121
|
||||||
# Description : Check for GRUB boot loader
|
# Description : Check for GRUB boot loader
|
||||||
|
|
Loading…
Reference in New Issue