mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-27 07:44:14 +02:00
Add test for world-writable cronjobs
This commit is contained in:
parent
7b33ead897
commit
e20404c60b
@ -72,17 +72,20 @@
|
|||||||
if [ ${CANREAD} -eq 1 ]; then
|
if [ ${CANREAD} -eq 1 ]; then
|
||||||
LogText "Result: found directory ${I}"
|
LogText "Result: found directory ${I}"
|
||||||
LogText "Test: searching files in ${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
|
if [ "${FIND}" = "" ]; then
|
||||||
LogText "Result: no files found in ${I}"
|
LogText "Result: no files found in ${I}"
|
||||||
else
|
else
|
||||||
LogText "Result: found one or more files in ${I}. Analyzing files.."
|
LogText "Result: found one or more files in ${I}. Analyzing files.."
|
||||||
for J in ${FIND}; do
|
for J in ${FIND}; do
|
||||||
|
if IsWorldWritable ${J}; then Report "insecure_fileperms_cronjob=${J}"; fi
|
||||||
FindCronJob ${J}
|
FindCronJob ${J}
|
||||||
|
if [ ! "${sCRONJOBS}" = "" ]; then
|
||||||
for K in ${sCRONJOBS}; do
|
for K in ${sCRONJOBS}; do
|
||||||
LogText "Result: Found cronjob (${I}): ${K}"
|
LogText "Result: Found cronjob (${J}): ${K}"
|
||||||
Report "cronjob[]=${J}"
|
Report "cronjob[]=${J}"
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
LogText "Result: done with analyzing files in ${I}"
|
LogText "Result: done with analyzing files in ${I}"
|
||||||
fi
|
fi
|
||||||
@ -106,6 +109,7 @@
|
|||||||
else
|
else
|
||||||
LogText "Result: found one or more files in ${I}. Analyzing files.."
|
LogText "Result: found one or more files in ${I}. Analyzing files.."
|
||||||
for J in ${FIND}; do
|
for J in ${FIND}; do
|
||||||
|
if IsWorldWritable ${J}; then Report "insecure_fileperms_cronjob=${J}"; fi
|
||||||
LogText "Result: Found cronjob (${I}): ${J}"
|
LogText "Result: Found cronjob (${I}): ${J}"
|
||||||
Report "cronjob[]=${J}"
|
Report "cronjob[]=${J}"
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user