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>2019-07-15 20:39:04 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2019-07-15 20:39:04 +0300
commit455fc26bf7dc243f7cf580107a34c7602671a886 (patch)
tree8241cbeb544eb4c4fcf7e60a1d83a4bd43388d21 /include/tests_file_integrity
parent2e7c6c781677d7dd017b64a9c44e51347429bb9c (diff)
Small code enhancements
Diffstat (limited to 'include/tests_file_integrity')
-rw-r--r--include/tests_file_integrity18
1 files changed, 8 insertions, 10 deletions
diff --git a/include/tests_file_integrity b/include/tests_file_integrity
index da578971..097cb138 100644
--- a/include/tests_file_integrity
+++ b/include/tests_file_integrity
@@ -35,7 +35,7 @@
Register --test-no FINT-4310 --weight L --network NO --category security --description "AFICK availability"
if [ ${SKIPTEST} -eq 0 ]; then
LogText "Test: Checking AFICK binary"
- if [ ! -z "${AFICKBINARY}" ]; then
+ if [ -n "${AFICKBINARY}" ]; then
LogText "Result: AFICK is installed (${AFICKBINARY})"
Report "file_integrity_tool[]=afick"
FILE_INT_TOOL="afick"
@@ -54,7 +54,7 @@
Register --test-no FINT-4314 --weight L --network NO --category security --description "AIDE availability"
if [ ${SKIPTEST} -eq 0 ]; then
LogText "Test: Checking AIDE binary"
- if [ ! -z "${AIDEBINARY}" ]; then
+ if [ -n "${AIDEBINARY}" ]; then
LogText "Result: AIDE is installed (${AIDEBINARY})"
Report "file_integrity_tool[]=aide"
FILE_INT_TOOL="aide"
@@ -73,10 +73,10 @@
if [ ! -z "${AIDEBINARY}" ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
Register --test-no FINT-4315 --preqs-met ${PREQS_MET} --weight L --network NO --category security --description "Check AIDE configuration file"
if [ ${SKIPTEST} -eq 0 ]; then
- AIDE_CONFIG_LOCS="/etc /etc/aide /usr/local/etc"
+ AIDE_CONFIG_LOCS="${ROOTDIR}etc ${ROOTDIR}etc/aide ${ROOTDIR}usr/local/etc"
LogText "Test: search for aide.conf in ${AIDE_CONFIG_LOCS}"
for I in ${AIDE_CONFIG_LOCS}; do
- if [ -f ${I}/aide.conf ]; then
+ if [ -f "${I}/aide.conf" ]; then
LogText "Result: found aide.conf in directory ${I}"
AIDECONFIG="${I}/aide.conf"
fi
@@ -181,7 +181,7 @@
Register --test-no FINT-4330 --weight L --network NO --category security --description "mtree availability"
if [ ${SKIPTEST} -eq 0 ]; then
LogText "Test: Checking mtree binary"
- if [ ! -z "${MTREEBINARY}" ]; then
+ if [ -n "${MTREEBINARY}" ]; then
LogText "Result: mtree is installed (${MTREEBINARY})"
Report "file_integrity_tool[]=mtree"
FILE_INT_TOOL="mtree"
@@ -201,8 +201,7 @@
Register --test-no FINT-4334 --preqs-met ${PREQS_MET} --weight L --network NO --category security --description "Check lfd daemon status"
if [ ${SKIPTEST} -eq 0 ]; then
Display --indent 4 --text "- lfd (CSF)" --result "${STATUS_FOUND}" --color GREEN
- IsRunning 'lfd '
- if [ ${RUNNING} -eq 1 ]; then
+ if IsRunning 'lfd '; then
LogText "Result: lfd daemon is running (CSF)"
Report "file_integrity_tool[]=csf-lfd"
Display --indent 6 --text "- LFD (CSF) daemon" --result "${STATUS_RUNNING}" --color GREEN
@@ -222,7 +221,7 @@
if [ ${SKIPTEST} -eq 0 ]; then
# LFD configuration parameters
ENABLED=$(${GREPBINARY} "^LF_DAEMON = \"1\"" ${CSF_CONFIG})
- if [ ! -z "${ENABLED}" ]; then
+ if [ -n "${ENABLED}" ]; then
LogText "Result: lfd service is configured to run"
Display --indent 6 --text "- Configuration status" --result "${STATUS_ENABLED}" --color GREEN
else
@@ -252,8 +251,7 @@
Register --test-no FINT-4338 --weight L --network NO --category security --description "osqueryd syscheck daemon running"
if [ ${SKIPTEST} -eq 0 ]; then
LogText "Test: Checking if osqueryd syscheck daemon is running"
- IsRunning osqueryd
- if [ ${RUNNING} -eq 1 ]; then
+ if IsRunning "osqueryd"; then
LogText "Result: syscheck (osquery) installed"
Report "file_integrity_tool[]=osquery"
FILE_INT_TOOL="osquery"