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.boelen@cisofy.com>2017-03-09 14:28:05 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2017-03-09 14:28:05 +0300
commitbb83598ff18f97068a4557dd68b8a6358ec93780 (patch)
tree96714532f91fc7d1e55a5b9d1fa1ada760fa400d /include/tests_databases
parent336dcb4811593deee4568da6ab66c953cebc888f (diff)
[DBS-1882] include redis.conf
Diffstat (limited to 'include/tests_databases')
-rw-r--r--include/tests_databases46
1 files changed, 24 insertions, 22 deletions
diff --git a/include/tests_databases b/include/tests_databases
index 2f37b3c8..bac849bd 100644
--- a/include/tests_databases
+++ b/include/tests_databases
@@ -41,7 +41,7 @@
if [ "${FIND}" = "" ]; then
if [ ${DEBUG} -eq 1 ]; then Display --indent 2 --text "- MySQL process status" --result "${STATUS_NOT_FOUND}" --color WHITE --debug; fi
LogText "Result: MySQL process not active"
- else
+ else
Display --indent 2 --text "- MySQL process status" --result "${STATUS_FOUND}" --color GREEN
LogText "Result: MySQL is active"
MYSQL_RUNNING=1
@@ -257,35 +257,37 @@
Register --test-no DBS-1882 --weight L --network NO --preqs-met "${PREQS_MET}" --skip-reason "${SKIPREASON}" --category security --description "Redis configuration file"
if [ ${SKIPTEST} -eq 0 ]; then
PATHS="${ROOTDIR}etc/redis ${ROOTDIR}usr/local/etc/redis"
+ ALLFILES=$(${LSBINARY} ${ROOTDIR}etc/redis.conf 2> /dev/null)
FOUND=0
for DIR in ${PATHS}; do
LogText "Action: scanning directory (${DIR}) for Redis configuration files"
FILES=$(${LSBINARY} ${DIR}/*.conf 2> /dev/null)
if [ ! -z "${FILES}" ]; then
- for CONFFILE in ${FILES}; do
- if FileIsReadable ${CONFFILE}; then
- LogText "Action: checking if ${CONFFILE} is a Sentinel configuration file"
- # Exclude Sentinel configuration file
- FIND=$(${GREPBINARY} "^sentinel " ${CONFFILE})
- if [ ! -z "${FIND}" ]; then
- LogText "Result: file is a Sentinel configuration file, skipping it"
- else
- LogText "Result: file is NOT a Sentinel configuration file. Now scanning if it is a Redis configuration file"
- FIND=$(${GREPBINARY} "Redis" ${CONFFILE})
- if [ ! -z "${FIND}" ]; then
- REDIS_CONFIGURATION_FILES="${REDIS_CONFIGURATION_FILES} ${CONFFILE}"
- REDIS_CONFIGURATION_FOUND=1
- LogText "Result: found a Redis configuration file (${CONFFILE})"
- else
- LogText "Result: this file does not look like a Redis file (${CONFFILE})"
- fi
- fi
+ ALLFILES="${ALLFILES} ${FILES}"
+ else
+ LogText "Result: no configuration files found in this directory"
+ fi
+ done
+ for CONFFILE in ${ALLFILES}; do
+ if FileIsReadable ${CONFFILE}; then
+ LogText "Action: checking if ${CONFFILE} is a Sentinel configuration file"
+ # Exclude Sentinel configuration file
+ FIND=$(${GREPBINARY} "^sentinel " ${CONFFILE})
+ if [ ! -z "${FIND}" ]; then
+ LogText "Result: file is a Sentinel configuration file, skipping it"
+ else
+ LogText "Result: file is NOT a Sentinel configuration file. Now scanning if it is a Redis configuration file"
+ FIND=$(${GREPBINARY} "Redis" ${CONFFILE})
+ if [ ! -z "${FIND}" ]; then
+ REDIS_CONFIGURATION_FILES="${REDIS_CONFIGURATION_FILES} ${CONFFILE}"
+ REDIS_CONFIGURATION_FOUND=1
+ LogText "Result: found a Redis configuration file (${CONFFILE})"
else
- LogText "Could not read this file, so skipping it"
+ LogText "Result: this file does not look like a Redis file (${CONFFILE})"
fi
- done
+ fi
else
- LogText "Result: no configuration files found in this directory"
+ LogText "Could not read this file, so skipping it"
fi
done
# Sort the list of discovered configuration files so we can make them unique