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:
authormboelen <michael@cisofy.com>2016-04-26 15:06:27 +0300
committermboelen <michael@cisofy.com>2016-04-26 15:06:27 +0300
commite20404c60b508a3d23fedf469771747246e0ded1 (patch)
tree073fc6f80586756c3918e67e9286a9569f04f4b6 /include/tests_scheduling
parent7b33ead897f51269e9cdfa664f152963f701e373 (diff)
Add test for world-writable cronjobs
Diffstat (limited to 'include/tests_scheduling')
-rw-r--r--include/tests_scheduling14
1 files changed, 9 insertions, 5 deletions
diff --git a/include/tests_scheduling b/include/tests_scheduling
index fae2236c..5491cd9f 100644
--- a/include/tests_scheduling
+++ b/include/tests_scheduling
@@ -72,17 +72,20 @@
if [ ${CANREAD} -eq 1 ]; then
LogText "Result: found directory ${I}"
LogText "Test: searching files in ${I}"
- FIND=`find ${I} -type f -print`
+ FIND=`find ${I} -type f -print | grep -v ".placeholder"`
if [ "${FIND}" = "" ]; then
LogText "Result: no files found in ${I}"
else
LogText "Result: found one or more files in ${I}. Analyzing files.."
for J in ${FIND}; do
+ if IsWorldWritable ${J}; then Report "insecure_fileperms_cronjob=${J}"; fi
FindCronJob ${J}
- for K in ${sCRONJOBS}; do
- LogText "Result: Found cronjob (${I}): ${K}"
- Report "cronjob[]=${J}"
- done
+ if [ ! "${sCRONJOBS}" = "" ]; then
+ for K in ${sCRONJOBS}; do
+ LogText "Result: Found cronjob (${J}): ${K}"
+ Report "cronjob[]=${J}"
+ done
+ fi
done
LogText "Result: done with analyzing files in ${I}"
fi
@@ -106,6 +109,7 @@
else
LogText "Result: found one or more files in ${I}. Analyzing files.."
for J in ${FIND}; do
+ if IsWorldWritable ${J}; then Report "insecure_fileperms_cronjob=${J}"; fi
LogText "Result: Found cronjob (${I}): ${J}"
Report "cronjob[]=${J}"
done