diff options
author | mboelen <michael@cisofy.com> | 2015-12-21 23:17:15 +0300 |
---|---|---|
committer | mboelen <michael@cisofy.com> | 2015-12-21 23:17:15 +0300 |
commit | d16b38eff83a8dca405e21e1c34205289f3d0832 (patch) | |
tree | d9db1eac3d4ead003f0e1b4fbfbabf0ddeb66c1e /include/tests_hardening | |
parent | 83a44827e03543146e39c37c33f14ebca6f40a29 (diff) |
Rename of logtext and report functions, upcoming year change
Diffstat (limited to 'include/tests_hardening')
-rw-r--r-- | include/tests_hardening | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/include/tests_hardening b/include/tests_hardening index 69cca70c..d764999c 100644 --- a/include/tests_hardening +++ b/include/tests_hardening @@ -5,7 +5,7 @@ # Lynis # ------------------ # -# Copyright 2007-2015, Michael Boelen, CISOfy (michael.boelen@cisofy.com) +# Copyright 2007-2016, Michael Boelen, CISOfy (michael.boelen@cisofy.com) # Web site: https://cisofy.com # # Lynis comes with ABSOLUTELY NO WARRANTY. This is free software, and you are @@ -26,13 +26,13 @@ # Notes : No suggestion for hardening compilers, as HRDN-7222 will take care of that Register --test-no HRDN-7220 --weight L --network NO --description "Check if one or more compilers are installed" if [ ${SKIPTEST} -eq 0 ]; then - logtext "Test: Check if one or more compilers can be found on the system" + LogText "Test: Check if one or more compilers can be found on the system" if [ ${COMPILER_INSTALLED} -eq 0 ]; then - logtext "Result: no compilers found" + LogText "Result: no compilers found" Display --indent 4 --text "- Installed compiler(s)" --result "NOT FOUND" --color GREEN AddHP 3 3 else - logtext "Result: found installed compiler. See top of logfile which compilers have been found or use grep to filter on 'compiler'" + LogText "Result: found installed compiler. See top of logfile which compilers have been found or use grep to filter on 'compiler'" Display --indent 4 --text "- Installed compiler(s)" --result "FOUND" --color RED AddHP 1 3 fi @@ -44,18 +44,17 @@ # Description : Check for permissions of installed compilers Register --test-no HRDN-7222 --weight L --network NO --description "Check compiler permissions" if [ ${SKIPTEST} -eq 0 ]; then - logtext "Test: Check if one or more compilers can be found on the system" + LogText "Test: Check if one or more compilers can be found on the system" HARDEN_COMPILERS_NEEDED=0 if [ ${COMPILER_INSTALLED} -eq 0 ]; then - logtext "Result: no compilers found" + LogText "Result: no compilers found" else # as if [ ! "${ASBINARY}" = "" ]; then - logtext "Test: Check file permissions for as (Assembler)" - IsWorldExecutable ${ASBINARY} - if [ $? -eq 1 ]; then - logtext "Binary: found ${ASBINARY} (world executable)" - report "compiler[]=${ASBINARY}" + LogText "Test: Check file permissions for as (Assembler)" + if IsWorldExecutable ${ASBINARY}; then + LogText "Binary: found ${ASBINARY} (world executable)" + Report "compiler[]=${ASBINARY}" AddHP 2 3 HARDEN_COMPILERS_NEEDED=1 else @@ -64,11 +63,10 @@ fi # gcc if [ ! "${GCCBINARY}" = "" ]; then - logtext "Test: Check file permissions for GCC compiler" - IsWorldExecutable ${GCCBINARY} - if [ $? -eq 1 ]; then - logtext "Binary: found ${GCCBINARY} (world executable)" - report "compiler[]=${GCCBINARY}" + LogText "Test: Check file permissions for GCC compiler" + if IsWorldExecutable ${GCCBINARY}; then + LogText "Binary: found ${GCCBINARY} (world executable)" + Report "compiler[]=${GCCBINARY}" AddHP 2 3 HARDEN_COMPILERS_NEEDED=1 else @@ -77,7 +75,7 @@ fi # Report suggestion is one or more compilers can be better hardened if [ ${HARDEN_COMPILERS_NEEDED} -eq 1 ]; then - logtext "Result: at least one compiler could be better hardened by restricting executable access to root or group only" + LogText "Result: at least one compiler could be better hardened by restricting executable access to root or group only" ReportSuggestion ${TEST_NO} "Harden compilers like restricting access to root user only" fi @@ -96,13 +94,13 @@ # Description : Check for installed malware scanners Register --test-no HRDN-7230 --weight L --network NO --description "Check for malware scanner" if [ ${SKIPTEST} -eq 0 ]; then - logtext "Test: Check if a malware scanner is installed" + LogText "Test: Check if a malware scanner is installed" if [ ${MALWARE_SCANNER_INSTALLED} -eq 1 ]; then - logtext "Result: found at least one malware scanner" + LogText "Result: found at least one malware scanner" Display --indent 4 --text "- Installed malware scanner" --result "FOUND" --color GREEN AddHP 3 3 else - logtext "Result: no malware scanner found" + LogText "Result: no malware scanner found" Display --indent 4 --text "- Installed malware scanner" --result "NOT FOUND" --color RED ReportSuggestion ${TEST_NO} "Harden the system by installing at least one malware scanner, to perform periodic file system scans" AddHP 1 3 @@ -111,21 +109,21 @@ # ################################################################################# # -# logtext "--------------------------------------------------------------------" -# logtext "| System part | Preferred value | Actual value | Points |" -# logtext "| [!] Compiler installed | 0 | [${COMPILER_INSTALLED}] | x |" -# logtext "| [V] Malware scanner installed | 1 | [x] | x |" -# logtext "| [V] Packet filter enabled | 1 | [x] | x |" -# logtext "--------------------------------------------------------------------" -# logtext "| [!]: Hardening possible, [V]: Hardening performed, [ ]: Unknown " -# logtext "--------------------------------------------------------------------" +# LogText "--------------------------------------------------------------------" +# LogText "| System part | Preferred value | Actual value | Points |" +# LogText "| [!] Compiler installed | 0 | [${COMPILER_INSTALLED}] | x |" +# LogText "| [V] Malware scanner installed | 1 | [x] | x |" +# LogText "| [V] Packet filter enabled | 1 | [x] | x |" +# LogText "--------------------------------------------------------------------" +# LogText "| [!]: Hardening possible, [V]: Hardening performed, [ ]: Unknown " +# LogText "--------------------------------------------------------------------" # ################################################################################# # -report "compiler_installed=${COMPILER_INSTALLED}" +Report "compiler_installed=${COMPILER_INSTALLED}" wait_for_keypress # #================================================================================ -# Lynis - Copyright 2007-2015, Michael Boelen, CISOfy - https://cisofy.com +# Lynis - Copyright 2007-2016, Michael Boelen, CISOfy - https://cisofy.com |