Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Boelen <michael@cisofy.com>2015-09-07 22:06:08 +0300
committerMichael Boelen <michael@cisofy.com>2015-09-07 22:06:08 +0300
commit59390f17178ce82fe6abc3746937d79695000a3f (patch)
tree1686e8d2d74fd65a3250a1f6da844c9b6afef823 /include/tests_webservers
parent48fd39c57032fa15b87281693b62725caef80481 (diff)
parentb83c3fbb10600964963b96c4099867822b56fcb0 (diff)
Merge pull request #73 from laurentquillerou/nginx-conf
Include main nginx.conf file in parsing.
Diffstat (limited to 'include/tests_webservers')
-rw-r--r--include/tests_webservers11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/tests_webservers b/include/tests_webservers
index 8c457f0d..cfe6dcce 100644
--- a/include/tests_webservers
+++ b/include/tests_webservers
@@ -198,9 +198,9 @@
# # Configuration specific tests
# SERVERTOKENSFOUND=0
# APACHE_CONFIGFILES="${APACHE_CONFIGFILE} /usr/local/etc/apache22/extra/httpd-default.conf /etc/apache2/sysconfig.d/global.conf"
-#
+#
# for APACHE_CONFIGFILE in ${APACHE_CONFIGFILES}; do
-# if [ -f ${APACHE_CONFIGFILE} ]; then
+# if [ -f ${APACHE_CONFIGFILE} ]; then
# # Check if option ServerTokens is configured
# SERVERTOKENSTEST=`cat ${APACHE_CONFIGFILE} | grep ServerTokens | grep -v '^#'`
# if [ ! "${SERVERTOKENSTEST}" = "" ]; then
@@ -219,17 +219,17 @@
# else
# Display --indent 4 --text "- Checking option ServerTokens" --result "NOT FOUND" --color WHITE
# fi
-#
+#
# else
# # File does not exist, skipping
# logtext "File ${APACHE_CONFIGFILE} does not exist, so skipping tests on this file"
# fi
# done
-#
+#
# # Display results from checks
# if [ ${SERVERTOKENSFOUND} -eq 1 ]; then
# Display --indent 6 --text "- Value of ServerTokens" --result OK --color GREEN
-# else
+# else
# Display --indent 6 --text "- Value of ServerTokens" --result WARNING --color RED
# ReportWarning ${TEST_NO} "M" "Value of 'ServerTokens' in Apache config is different than template"
# fi
@@ -422,6 +422,7 @@
# Remove temp file
if [ ! "${TMPFILE}" = "" ]; then if [ -f ${TMPFILE} ]; then rm -f ${TMPFILE}; fi; fi
N=0
+ cat ${NGINX_CONF_LOCATION} | sed -e 's/^[ \t]*//' | grep -v "^#" | grep -v "^$" | sed 's/[\t]/ /g' | sed 's/ / /g' | sed 's/ / /g' >> ${TMPFILE}
# Search for included configuration files (may include directories and wild cards)
FIND=`grep "include" ${NGINX_CONF_LOCATION} | ${AWKBINARY} '{ if ($1=="include") { print $2 }}' | sed 's/;$//g'`
for I in ${FIND}; do