diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2016-06-18 12:14:01 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2016-06-18 12:14:01 +0300 |
commit | 983e293eb157131ca5e085e4927ea5fc220edc73 (patch) | |
tree | cc5e8bea4af5cfa53f57a73d2c61357f47165857 /include/tests_boot_services | |
parent | 9c093f7a97fb0b9593a303ef7394c3bc5dea99b2 (diff) |
Replaced text strings to allow translations
Diffstat (limited to 'include/tests_boot_services')
-rw-r--r-- | include/tests_boot_services | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/include/tests_boot_services b/include/tests_boot_services index 015f5c8b..3b858d14 100644 --- a/include/tests_boot_services +++ b/include/tests_boot_services @@ -45,12 +45,12 @@ FIND=`/usr/sbin/bootinfo -b` if [ ! "${FIND}" = "" ]; then LogText "Result: found boot device ${FIND}" - Display --indent 2 --text "- Checking boot device (bootinfo)" --result FOUND --color GREEN + Display --indent 2 --text "- Checking boot device (bootinfo)" --result "${STATUS_FOUND}" --color GREEN BOOT_LOADER="ROS" BOOT_LOADER_FOUND=1 else LogText "Result: no data received from bootinfo, most likely boot device not found" - #Display --indent 4 --text "- Checking boot device (bootinfo)" --result "NOT FOUND" --color YELLOW + #Display --indent 4 --text "- Checking boot device (bootinfo)" --result "${STATUS_NOT_FOUND}" --color YELLOW #ReportSuggestion ${TEST_NO} "Only use root (not sudo account) to query properly boot device" fi fi @@ -126,7 +126,7 @@ esac LogText "Result: service manager found = ${SERVICE_MANAGER}" if [ "${SERVICE_MANAGER}" = "" -o "${SERVICE_MANAGER}" = "unknown" ]; then - Display --indent 2 --text "- Service Manager" --result "UNKNOWN" --color YELLOW + Display --indent 2 --text "- Service Manager" --result "${STATUS_UNKNOWN}" --color YELLOW else Display --indent 2 --text "- Service Manager" --result "${SERVICE_MANAGER}" --color GREEN fi @@ -193,15 +193,15 @@ ;; esac if [ ${UEFI_BOOTED} -eq 1 ]; then - Display --indent 2 --text "- Checking UEFI boot" --result ENABLED --color GREEN + Display --indent 2 --text "- Checking UEFI boot" --result "${STATUS_ENABLED}" --color GREEN if [ ${UEFI_BOOTED_SECURE} -eq 1 ]; then - Display --indent 2 --text "- Checking Secure Boot" --result ENABLED --color GREEN + Display --indent 2 --text "- Checking Secure Boot" --result "${STATUS_ENABLED}" --color GREEN else - Display --indent 2 --text "- Checking Secure Boot" --result DISABLED --color YELLOW + Display --indent 2 --text "- Checking Secure Boot" --result "${STATUS_DISABLED}" --color YELLOW fi else if [ ${UEFI_TESTS_PERFORMED} -eq 1 ]; then - Display --indent 2 --text "- Checking UEFI boot" --result DISABLED --color WHITE + Display --indent 2 --text "- Checking UEFI boot" --result "${STATUS_DISABLED}" --color WHITE fi fi fi @@ -220,7 +220,7 @@ BOOT_LOADER="GRUB" BOOT_LOADER_FOUND=1 GRUB_VERSION=1 - Display --indent 2 --text "- Checking presence GRUB" --result "OK" --color GREEN + Display --indent 2 --text "- Checking presence GRUB" --result "${STATUS_OK}" --color GREEN if [ -f /boot/grub/grub.conf ]; then GRUBCONFFILE="/boot/grub/grub.conf"; else GRUBCONFFILE="/boot/grub/menu.lst"; fi fi @@ -230,7 +230,7 @@ BOOT_LOADER="GRUB2" BOOT_LOADER_FOUND=1 GRUB_VERSION=2 - Display --indent 2 --text "- Checking presence GRUB2" --result FOUND --color GREEN + Display --indent 2 --text "- Checking presence GRUB2" --result "${STATUS_FOUND}" --color GREEN if [ -f /boot/grub/grub.cfg ]; then GRUBCONFFILE="/boot/grub/grub.cfg" elif [ -f /boot/grub2/grub.cfg ]; then @@ -277,11 +277,11 @@ FOUND=1 fi if [ ${FOUND} -eq 1 ]; then - Display --indent 4 --text "- Checking for password protection" --result OK --color GREEN + Display --indent 4 --text "- Checking for password protection" --result "${STATUS_OK}" --color GREEN LogText "Result: GRUB has password protection." AddHP 4 4 else - Display --indent 4 --text "- Checking for password protection" --result WARNING --color RED + Display --indent 4 --text "- Checking for password protection" --result "${STATUS_WARNING}" --color RED LogText "Result: Didn't find hashed password line in GRUB boot file!" ReportSuggestion ${TEST_NO} "Set a password on GRUB bootloader to prevent altering boot configuration (e.g. boot in single user mode without password)" AddHP 0 2 @@ -300,7 +300,7 @@ BOOT_LOADER_SEARCHED=1 if [ -f /boot/boot1 -a -f /boot/boot2 -a -f /boot/loader ]; then LogText "Result: found boot1, boot2 and loader files in /boot" - Display --indent 2 --text "- Checking presence FreeBSD loader" --result FOUND --color GREEN + Display --indent 2 --text "- Checking presence FreeBSD loader" --result "${STATUS_FOUND}" --color GREEN BOOT_LOADER="FreeBSD" BOOT_LOADER_FOUND=1 else @@ -317,7 +317,7 @@ BOOT_LOADER_SEARCHED=1 if [ -f /boot.${HARDWARE} -o -f /boot -o -f /ofwboot ]; then LogText "Result: found NetBSD secondary bootstrap" - Display --indent 2 --text "- Checking presence NetBSD loader" --result FOUND --color GREEN + Display --indent 2 --text "- Checking presence NetBSD loader" --result "${STATUS_FOUND}" --color GREEN BOOT_LOADER="NetBSD" BOOT_LOADER_FOUND=1 else @@ -341,18 +341,18 @@ if [ ${CANREAD} -eq 1 ]; then BOOT_LOADER="LILO" BOOT_LOADER_FOUND=1 - Display --indent 2 --text "- Checking presence LILO" --result "OK" --color GREEN + Display --indent 2 --text "- Checking presence LILO" --result "${STATUS_OK}" --color GREEN LogText "Checking password option LILO" FIND=`${EGREPBINARY} 'password[[:space:]]?=' ${LILOCONFFILE} | grep -v "^#"` if [ "${FIND}" = "" ]; then - Display --indent 4 --text "- Password option presence " --result "WARNING" --color RED + Display --indent 4 --text "- Password option presence " --result "${STATUS_WARNING}" --color RED LogText "Result: no password set for LILO. Bootloader is unprotected to" LogText "dropping to single user mode or unauthorized access to devices/data." ReportSuggestion ${TEST_NO} "Add a password to LILO, by adding a line to the lilo.conf file, above the first line saying 'image=<name>': password=<password>" ReportWarning ${TEST_NO} "M" "No password set on LILO bootloader" AddHP 0 2 else - Display --indent 4 --text "- Password option presence " --result "OK" --color GREEN + Display --indent 4 --text "- Password option presence " --result "${STATUS_OK}" --color GREEN LogText "Result: LILO password option set" AddHP 4 4 fi @@ -373,7 +373,7 @@ BOOT_LOADER_SEARCHED=1 if [ -f /etc/silo.conf ]; then LogText "Result: Found SILO configuration file (/etc/silo.conf)" - Display --indent 2 --text "- Checking boot loader SILO" --result FOUND --color GREEN + Display --indent 2 --text "- Checking boot loader SILO" --result "${STATUS_FOUND}" --color GREEN BOOT_LOADER="SILO" BOOT_LOADER_FOUND=1 else @@ -392,11 +392,11 @@ # FIND=`/sbin/silo | grep "appears to be valid"` # if [ ! "${FIND}" = "" ]; then # LogText "Result: Found SILO configuration file (/etc/silo.conf)" -# Display --indent 6 --text "- Checking SILO consistency" --result OK --color GREEN +# Display --indent 6 --text "- Checking SILO consistency" --result "${STATUS_OK}" --color GREEN # else # LogText "Result: no positive result received from silo binary" # ReportWarning ${TEST_NO} "Possible issue with boot loader (SILO)" -# Display --indent 6 --text "- Checking SILO consistency" --result WARNING --color RED +# Display --indent 6 --text "- Checking SILO consistency" --result "${STATUS_WARNING}" --color RED # fi # fi # fi @@ -411,7 +411,7 @@ LogText "Test: Check for /etc/yaboot.conf" if [ -f /etc/yaboot.conf ]; then LogText "Result: Found YABOOT configuration file (/etc/yaboot.conf)" - Display --indent 4 --text "- Checking boot loader YABOOT" --result FOUND --color GREEN + Display --indent 4 --text "- Checking boot loader YABOOT" --result "${STATUS_FOUND}" --color GREEN BOOT_LOADER="YABOOT" BOOT_LOADER_FOUND=1 else @@ -437,18 +437,18 @@ # Configuration file if [ -f /etc/boot.conf ]; then FOUND=1 - Display --indent 2 --text "- Checking /etc/boot.conf" --result "FOUND" --color GREEN + Display --indent 2 --text "- Checking /etc/boot.conf" --result "${STATUS_FOUND}" --color GREEN FIND=`grep '^boot' /etc/boot.conf` if [ "${FIND}" = "" ]; then - Display --indent 4 --text "- Checking boot option" --result WARNING --color RED + Display --indent 4 --text "- Checking boot option" --result "${STATUS_WARNING}" --color RED #ReportSuggestion ${TEST_NO} "Add 'boot' to the /etc/boot.conf file to disable the default 5 seconds waiting time, to disallow booting into single user mode." ReportWarning ${TEST_NO} "M" "System can be booted into single user mode without password" else - Display --indent 4 --text "- Checking boot option" --result OK --color GREEN + Display --indent 4 --text "- Checking boot option" --result "${STATUS_OK}" --color GREEN LogText "Ok, boot option is enabled." fi else - Display --indent 2 --text "- Checking /etc/boot.conf" --result "NOT FOUND" --color YELLOW + Display --indent 2 --text "- Checking /etc/boot.conf" --result "${STATUS_NOT_FOUND}" --color YELLOW LogText "Result: no /etc/boot.conf found. When using the default boot loader, physical" LogText "access to the server can be used to possibly enter single user mode." ReportSuggestion ${TEST_NO} "Add 'boot' to the /etc/boot.conf file to disable the default 5 seconds waiting time." @@ -491,7 +491,7 @@ Report "boottask[]=${I}" N=$((N + 1)) done - Display --indent 2 --text "- Checking services at startup (service/rc.conf)" --result "DONE" --color GREEN + Display --indent 2 --text "- Checking services at startup (service/rc.conf)" --result "${STATUS_DONE}" --color GREEN Display --indent 6 --text "Result: found $N services/options set" LogText "Found $N services/options to run at startup" fi @@ -519,7 +519,7 @@ N=$((N + 1)) done LogText "Note: Run systemctl --full --type=service to see all services" - Display --indent 2 --text "- Check running services (systemctl)" --result "DONE" --color GREEN + Display --indent 2 --text "- Check running services (systemctl)" --result "${STATUS_DONE}" --color GREEN Display --indent 8 --text "Result: found $N running services" LogText "Result: Found $N enabled services" @@ -534,7 +534,7 @@ N=$((N + 1)) done LogText "Note: Run systemctl list-unit-files --type=service to see all services" - Display --indent 2 --text "- Check enabled services at boot (systemctl)" --result "DONE" --color GREEN + Display --indent 2 --text "- Check enabled services at boot (systemctl)" --result "${STATUS_DONE}" --color GREEN Display --indent 8 --text "Result: found $N enabled services" LogText "Result: Found $N running services" @@ -552,7 +552,7 @@ N=$((N + 1)) done LogText "Hint: Run chkconfig --list to see all services and disable unneeded services" - Display --indent 2 --text "- Check services at startup (chkconfig)" --result "DONE" --color GREEN + Display --indent 2 --text "- Check services at startup (chkconfig)" --result "${STATUS_DONE}" --color GREEN Display --indent 8 --text "Result: found $N services" LogText "Result: Found $N services at startup" else @@ -581,7 +581,7 @@ LogText "Found service (at boot, runlevel 2): ${I}" N=$((N + 1)) done - Display --indent 2 --text "- Check services at startup (rc2.d)" --result "DONE" --color WHITE + Display --indent 2 --text "- Check services at startup (rc2.d)" --result "${STATUS_DONE}" --color WHITE Display --indent 4 --text "Result: found $N services" LogText "Result: found $N services" fi @@ -667,12 +667,12 @@ # Check results if [ ${FOUND} -eq 1 ]; then - Display --indent 2 --text "- Check startup files (permissions)" --result "WARNING" --color RED + Display --indent 2 --text "- Check startup files (permissions)" --result "${STATUS_WARNING}" --color RED ReportWarning ${TEST_NO} "Found world writable startup scripts" "-" "-" LogText "Result: found one or more scripts which are possibly writable by other users" AddHP 0 3 else - Display --indent 2 --text "- Check startup files (permissions)" --result "OK" --color GREEN + Display --indent 2 --text "- Check startup files (permissions)" --result "${STATUS_OK}" --color GREEN AddHP 3 3 fi fi @@ -691,7 +691,7 @@ if [ -f /proc/uptime ]; then FIND=`cat /proc/uptime | cut -d ' ' -f1 | cut -d '.' -f1` else - Display --indent 2 --text "- Checking uptime" --result SKIPPED --color YELLOW + Display --indent 2 --text "- Checking uptime" --result "${STATUS_SKIPPED}" --color YELLOW ReportException "${TEST_NO}:1" "No uptime test available for this operating system (/proc/uptime missing)" fi ;; @@ -700,7 +700,7 @@ if [ ! "${SYSCTLBINARY}" = "" ]; then FIND=`${SYSCTLBINARY} kern.boottime | awk '{ print $5 }' | sed -e 's/,//' | grep "[0-9]"` else - Display --indent 2 --text "- Checking uptime" --result SKIPPED --color YELLOW + Display --indent 2 --text "- Checking uptime" --result "${STATUS_SKIPPED}" --color YELLOW ReportException "${TEST_NO}:4" "No uptime test available for this operating system (sysctl missing)" fi ;; @@ -717,7 +717,7 @@ ReportException "${TEST_NO}:5" "Most likely kern.boottime empty, unable to determine uptime" fi else - Display --indent 2 --text "- Checking uptime" --result SKIPPED --color YELLOW + Display --indent 2 --text "- Checking uptime" --result "${STATUS_SKIPPED}" --color YELLOW ReportException "${TEST_NO}:4" "No uptime test available for this operating system (sysctl missing)" fi ;; @@ -726,13 +726,13 @@ if [ ! "${KSTATBINARY}" = "" ]; then FIND=`${KSTATBINARY} -p unix:0:system_misc:snaptime | grep "^unix" | awk '{print $2}' | cut -d "." -f1` else - Display --indent 2 --text "- Checking uptime" --result SKIPPED --color YELLOW + Display --indent 2 --text "- Checking uptime" --result "${STATUS_SKIPPED}" --color YELLOW ReportException "${TEST_NO}:2" "No uptime test available for this operating system (kstat missing)" fi ;; *) - Display --indent 2 --text "- Checking uptime" --result SKIPPED --color YELLOW + Display --indent 2 --text "- Checking uptime" --result "${STATUS_SKIPPED}" --color YELLOW # Want to help improving Lynis? Share your operating system and a way to determine the uptime (in seconds) ReportException "${TEST_NO}:3" "No uptime test available yet for this operating system" @@ -769,7 +769,7 @@ else LogText "Result: did not find sulogin in rescue.service" AddHP 1 3 - Display --indent 2 --text "- Checking sulogin in rescue.service" --result "NOT FOUND" --color YELLOW + Display --indent 2 --text "- Checking sulogin in rescue.service" --result "${STATUS_NOT_FOUND}" --color YELLOW ReportSuggestion "${TEST_NO}" "Protect rescue.service by using sulogin" fi else |