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_webservers | |
parent | 9c093f7a97fb0b9593a303ef7394c3bc5dea99b2 (diff) |
Replaced text strings to allow translations
Diffstat (limited to 'include/tests_webservers')
-rw-r--r-- | include/tests_webservers | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/include/tests_webservers b/include/tests_webservers index c824d0aa..0cbfb4a3 100644 --- a/include/tests_webservers +++ b/include/tests_webservers @@ -56,7 +56,7 @@ if [ ${SKIPTEST} -eq 0 ]; then if [ "${OS}" = "OpenBSD" -a "${HTTPDBINARY}" = "/usr/sbin/httpd" ]; then HTTPDBINARY=""; fi if [ "${HTTPDBINARY}" = "" ]; then - Display --indent 2 --text "- Checking Apache" --result "NOT FOUND" --color WHITE + Display --indent 2 --text "- Checking Apache" --result "${STATUS_NOT_FOUND}" --color WHITE else LogText "Test: Scanning for Apache binary" IS_APACHE=`${HTTPDBINARY} -v 2> /dev/null | egrep '[aA]pache'` @@ -64,7 +64,7 @@ LogText "Result: ${HTTPDBINARY} is not Apache" Display --indent 2 --text "- Checking Apache (binary ${HTTPDBINARY})" --result "NO MATCH" --color WHITE else - Display --indent 2 --text "- Checking Apache (binary ${HTTPDBINARY})" --result "FOUND" --color GREEN + Display --indent 2 --text "- Checking Apache (binary ${HTTPDBINARY})" --result "${STATUS_FOUND}" --color GREEN LogText "Result: ${HTTPDBINARY} seems to be Apache HTTP daemon" APACHE_INSTALLED=1 APACHE_VERSION=`${HTTPDBINARY} -v 2> /dev/null | grep "^Server version:" | awk '{ print $3 }' | awk -F/ '{ print $2 }'` @@ -205,7 +205,7 @@ # # Check if option ServerTokens is configured # SERVERTOKENSTEST=`grep ServerTokens ${APACHE_CONFIGFILE} | grep -v '^#'` # if [ ! "${SERVERTOKENSTEST}" = "" ]; then -# Display --indent 4 --text "- Checking option ServerTokens" --result FOUND --color WHITE +# Display --indent 4 --text "- Checking option ServerTokens" --result "${STATUS_FOUND}" --color WHITE # SERVERTOKENSTEST=`echo ${SERVERTOKENSTEST} | sed 's/ServerTokens//' | tr -d ' '` # LogText "Option ServerTokens found: ${SERVERTOKENSTEST}" # SERVERTOKENSEXPECTED=`grep 'apache' ${PROFILE} | grep 'ServerTokens' | cut -d ':' -f3` @@ -218,7 +218,7 @@ # LogText "Expected: ${SERVERTOKENSEXPECTED}" # fi # else -# Display --indent 4 --text "- Checking option ServerTokens" --result "NOT FOUND" --color WHITE +# Display --indent 4 --text "- Checking option ServerTokens" --result "${STATUS_NOT_FOUND}" --color WHITE # fi # # else @@ -229,9 +229,9 @@ # # # Display results from checks # if [ ${SERVERTOKENSFOUND} -eq 1 ]; then -# Display --indent 6 --text "- Value of ServerTokens" --result OK --color GREEN +# Display --indent 6 --text "- Value of ServerTokens" --result "${STATUS_OK}" --color GREEN # else -# Display --indent 6 --text "- Value of ServerTokens" --result WARNING --color RED +# Display --indent 6 --text "- Value of ServerTokens" --result "${STATUS_WARNING}" --color RED # ReportWarning ${TEST_NO} "M" "Value of 'ServerTokens' in Apache config is different than template" # fi # fi @@ -280,10 +280,10 @@ fi done if [ ${N} -eq 0 ]; then - Display --indent 4 --text "* Loadable modules" --result "NONE" --color WHITE + Display --indent 4 --text "* Loadable modules" --result "${STATUS_NONE}" --color WHITE ReportException "${TEST_NO}:1" "No loadable Apache modules found" else - Display --indent 4 --text "* Loadable modules" --result "FOUND" --color GREEN + Display --indent 4 --text "* Loadable modules" --result "${STATUS_FOUND}" --color GREEN Display --indent 8 --text "- Found ${N} loadable modules" fi fi @@ -298,10 +298,10 @@ # Check modules, module CheckItem "apache_module" "/mod_evasive([0-9][0-9])?.so" if [ ${ITEM_FOUND} -eq 1 ]; then - Display --indent 10 --text "mod_evasive: anti-DoS/brute force" --result FOUND --color GREEN + Display --indent 10 --text "mod_evasive: anti-DoS/brute force" --result "${STATUS_FOUND}" --color GREEN AddHP 3 3 else - Display --indent 10 --text "mod_evasive: anti-DoS/brute force" --result "NOT FOUND" --color WHITE + Display --indent 10 --text "mod_evasive: anti-DoS/brute force" --result "${STATUS_NOT_FOUND}" --color WHITE AddHP 2 3 ReportSuggestion ${TEST_NO} "Install Apache mod_evasive to guard webserver against DoS/brute force attempts" fi @@ -317,10 +317,10 @@ # Check modules, module CheckItem "apache_module" "/mod_qos.so" if [ ${ITEM_FOUND} -eq 1 ]; then - Display --indent 10 --text "mod_qos: anti-Slowloris" --result FOUND --color GREEN + Display --indent 10 --text "mod_qos: anti-Slowloris" --result "${STATUS_FOUND}" --color GREEN AddHP 3 3 else - Display --indent 10 --text "mod_qos: anti-Slowloris" --result "NOT FOUND" --color WHITE + Display --indent 10 --text "mod_qos: anti-Slowloris" --result "${STATUS_NOT_FOUND}" --color WHITE AddHP 2 3 ReportSuggestion ${TEST_NO} "Install Apache mod_qos to guard webserver against Slowloris attacks" fi @@ -337,10 +337,10 @@ # # Check modules, module # CheckItem "apache_module" "/mod_spamhaus.so" # if [ ${ITEM_FOUND} -eq 1 ]; then - # Display --indent 10 --text "mod_spamhaus: anti-spam (spamhaus)" --result FOUND --color GREEN + # Display --indent 10 --text "mod_spamhaus: anti-spam (spamhaus)" --result "${STATUS_FOUND}" --color GREEN # AddHP 3 3 # else - # Display --indent 10 --text "mod_spamhaus: anti-spam (spamhaus)" --result "NOT FOUND" --color WHITE + # Display --indent 10 --text "mod_spamhaus: anti-spam (spamhaus)" --result "${STATUS_NOT_FOUND}" --color WHITE # AddHP 2 3 # ReportSuggestion ${TEST_NO} "Install Apache mod_spamhaus to guard webserver against spammers" # fi @@ -356,10 +356,10 @@ # Check modules, module CheckItem "apache_module" "/mod_security2.so" if [ ${ITEM_FOUND} -eq 1 ]; then - Display --indent 10 --text "ModSecurity: web application firewall" --result FOUND --color GREEN + Display --indent 10 --text "ModSecurity: web application firewall" --result "${STATUS_FOUND}" --color GREEN AddHP 3 3 else - Display --indent 10 --text "ModSecurity: web application firewall" --result "NOT FOUND" --color WHITE + Display --indent 10 --text "ModSecurity: web application firewall" --result "${STATUS_NOT_FOUND}" --color WHITE AddHP 2 3 ReportSuggestion ${TEST_NO} "Install Apache modsecurity to guard webserver against web application attacks" fi @@ -381,11 +381,11 @@ FIND=`${PSBINARY} ax | grep "/nginx" | grep "master" | grep -v "grep"` if [ ! "${FIND}" = "" ]; then LogText "Result: found running nginx process(es)" - Display --indent 2 --text "- Checking nginx" --result FOUND --color GREEN + Display --indent 2 --text "- Checking nginx" --result "${STATUS_FOUND}" --color GREEN NGINX_RUNNING=1 else LogText "Result: no running nginx process found" - Display --indent 2 --text "- Checking nginx" --result "NOT FOUND" --color WHITE + Display --indent 2 --text "- Checking nginx" --result "${STATUS_NOT_FOUND}" --color WHITE fi fi # @@ -406,10 +406,10 @@ if [ ! "${NGINX_CONF_LOCATION}" = "" ]; then LogText "Result: found nginx configuration file" Report "nginx_main_conf_file=${NGINX_CONF_LOCATION}" - Display --indent 4 --text "- Searching nginx configuration file" --result FOUND --color GREEN + Display --indent 4 --text "- Searching nginx configuration file" --result "${STATUS_FOUND}" --color GREEN else LogText "Result: no nginx configuration file found" - Display --indent 2 --text "- Searching nginx configuration file" --result "NOT FOUND" --color WHITE + Display --indent 2 --text "- Searching nginx configuration file" --result "${STATUS_NOT_FOUND}" --color WHITE fi fi # @@ -486,39 +486,39 @@ NGINX_SSL_SUGGESTION=0 if [ ${NGINX_SSL_ON} -eq 1 ]; then LogText "Result: SSL is configured in nginx on one or more virtual hosts" - Display --indent 6 --text "- SSL configured" --result "YES" --color GREEN + Display --indent 6 --text "- SSL configured" --result "${STATUS_YES}" --color GREEN AddHP 5 5 # Cipher tests if [ ${NGINX_SSL_CIPHERS} -eq 1 ]; then - Display --indent 8 --text "- Ciphers configured" --result "YES" --color GREEN + Display --indent 8 --text "- Ciphers configured" --result "${STATUS_YES}" --color GREEN else - Display --indent 8 --text "- Ciphers configured" --result "NO" --color RED + Display --indent 8 --text "- Ciphers configured" --result "${STATUS_NO}" --color RED NGINX_SSL_SUGGESTION=1 fi if [ ${NGINX_SSL_PREFER_SERVER_CIPHERS} -eq 1 ]; then - Display --indent 8 --text "- Prefer server ciphers" --result "YES" --color GREEN + Display --indent 8 --text "- Prefer server ciphers" --result "${STATUS_YES}" --color GREEN else - Display --indent 8 --text "- Prefer server ciphers" --result "NO" --color RED + Display --indent 8 --text "- Prefer server ciphers" --result "${STATUS_NO}" --color RED NGINX_SSL_SUGGESTION=1 fi if [ ${NGINX_SSL_PROTOCOLS} -eq 1 ]; then - Display --indent 8 --text "- Protocols configured" --result "YES" --color GREEN + Display --indent 8 --text "- Protocols configured" --result "${STATUS_YES}" --color GREEN if [ ${NGINX_WEAK_SSL_PROTOCOL_FOUND} -eq 0 ]; then - Display --indent 10 --text "- Insecure protocols found" --result "NO" --color GREEN + Display --indent 10 --text "- Insecure protocols found" --result "${STATUS_NO}" --color GREEN else - Display --indent 10 --text "- Insecure protocols found" --result "YES" --color RED + Display --indent 10 --text "- Insecure protocols found" --result "${STATUS_YES}" --color RED ReportSuggestion "${TEST_NO}" "Disable weak protocol in nginx configuration" fi else - Display --indent 8 --text "- Protocols configured" --result "NO" --color RED + Display --indent 8 --text "- Protocols configured" --result "${STATUS_NO}" --color RED NGINX_SSL_SUGGESTION=1 fi else LogText "Result: No SSL configuration found" - Display --indent 6 --text "- SSL configured" --result "NO" --color RED + Display --indent 6 --text "- SSL configured" --result "${STATUS_NO}" --color RED NGINX_SSL_SUGGESTION=1 AddHP 1 5 fi @@ -542,19 +542,19 @@ # Check for missing access log if [ ${NGINX_ACCESS_LOG_MISSING} -eq 1 ]; then NGINX_LOG_SUGGESTION=1 - Display --indent 8 --text "- Missing log files (access_log)" --result "YES" --color RED + Display --indent 8 --text "- Missing log files (access_log)" --result "${STATUS_YES}" --color RED else - Display --indent 8 --text "- Missing log files (access_log)" --result "NO" --color GREEN + Display --indent 8 --text "- Missing log files (access_log)" --result "${STATUS_NO}" --color GREEN fi # Access log disabled if [ ${NGINX_ACCESS_LOG_DISABLED} -eq 1 ]; then NGINX_LOG_SUGGESTION=1 LogText "Result: found one or more virtual hosts which have their access log disabled" - Display --indent 8 --text "- Disabled access logging" --result "YES" --color RED + Display --indent 8 --text "- Disabled access logging" --result "${STATUS_YES}" --color RED AddHP 2 3 else LogText "Result: no virtual hosts found which have their access log disabled" - Display --indent 8 --text "- Disabled access logging" --result "NO" --color GREEN + Display --indent 8 --text "- Disabled access logging" --result "${STATUS_NO}" --color GREEN AddHP 3 3 fi # Report suggestion @@ -574,9 +574,9 @@ # Check for missing access log if [ ${NGINX_ERROR_LOG_MISSING} -eq 1 ]; then NGINX_LOG_SUGGESTION=1 - Display --indent 8 --text "- Missing log files (error_log)" --result "YES" --color RED + Display --indent 8 --text "- Missing log files (error_log)" --result "${STATUS_YES}" --color RED else - Display --indent 8 --text "- Missing log files (error_log)" --result "NO" --color GREEN + Display --indent 8 --text "- Missing log files (error_log)" --result "${STATUS_NO}" --color GREEN fi # Report suggestion if [ ${NGINX_LOG_SUGGESTION} -eq 1 ]; then @@ -596,11 +596,11 @@ if [ ${NGINX_ERROR_LOG_DEBUG} -eq 1 ]; then NGINX_LOG_SUGGESTION=1 LogText "Result: found one or more virtual hosts which have their error log in debug mode" - Display --indent 8 --text "- Debugging mode on error_log" --result "YES" --color RED + Display --indent 8 --text "- Debugging mode on error_log" --result "${STATUS_YES}" --color RED AddHP 2 3 else LogText "Result: no virtual hosts found which have their access log disabled" - Display --indent 8 --text "- Debugging mode on error_log" --result "NO" --color GREEN + Display --indent 8 --text "- Debugging mode on error_log" --result "${STATUS_NO}" --color GREEN AddHP 3 3 fi # Report suggestion @@ -626,7 +626,7 @@ # done # if [ ${N} -eq 0 ]; then # LogText "Result: no reverse proxying functionality found" -# Display --indent 4 --text "- Searching reverse proxy functionality" --result "NOT FOUND" --color WHITE +# Display --indent 4 --text "- Searching reverse proxy functionality" --result "${STATUS_NOT_FOUND}" --color WHITE # else # LogText "Result: found ${N} addresses for which nginx will be a reverse proxy" # Display --indent 4 --text "- Searching reverse proxy functionality" --result "${N} FOUND" --color GREEN @@ -652,7 +652,7 @@ # done # if [ ${N} -eq 0 ]; then # LogText "Result: no virtual hosts found" -# Display --indent 4 --text "- Searching virtual hosts" --result "NOT FOUND" --color WHITE +# Display --indent 4 --text "- Searching virtual hosts" --result "${STATUS_NOT_FOUND}" --color WHITE # else # LogText "Result: found ${N} virtual hosts" # Display --indent 4 --text "- Searching virtual hosts" --result "${N} FOUND" --color GREEN |