mirror of https://github.com/CISOfy/lynis.git
Checking debsums default file to make sure cron jobs are enabled
This commit is contained in:
parent
59a3c4b536
commit
d26a98ca19
|
@ -671,9 +671,20 @@
|
||||||
# Check in /etc/cron.hourly, daily, weekly, monthly etc
|
# Check in /etc/cron.hourly, daily, weekly, monthly etc
|
||||||
COUNT=$(find /etc/cron* -name debsums | wc -l)
|
COUNT=$(find /etc/cron* -name debsums | wc -l)
|
||||||
if [ ${COUNT} -gt 0 ]; then
|
if [ ${COUNT} -gt 0 ]; then
|
||||||
LogText "Result: Cron job is configured for debsums utility."
|
CRON_CHECK=""
|
||||||
Display --indent 6 --text "- Cron job for debsums" --result "${STATUS_FOUND}" --color GREEN
|
if [ -f ${ROOTDIR}etc/default/debsums ]; then
|
||||||
AddHP 3 3
|
CRON_CHECK=$(${GREPBINARY} CRON_CHECK /etc/default/debsums|${AWKBINARY} -F "=" '{print $2}')
|
||||||
|
fi
|
||||||
|
if [ "${CRON_CHECK}" = "daily" ] || [ "${CRON_CHECK}" = "weekly" ] || [ "${CRON_CHECK}" = "monthly" ]; then
|
||||||
|
LogText "Result: Cron job is configured for debsums utility."
|
||||||
|
Display --indent 6 --text "- Cron job for debsums" --result "${STATUS_FOUND}" --color GREEN
|
||||||
|
AddHP 3 3
|
||||||
|
else
|
||||||
|
LogText "Result: Cron job is not configured for debsums utility."
|
||||||
|
Display --indent 6 --text "- Cron job for debsums" --result "${STATUS_NOT_FOUND}" --color YELLOW
|
||||||
|
AddHP 1 3
|
||||||
|
ReportSuggestion "${TEST_NO}" "Check debsums configuration and enable checking regularly via a cron job (CRON_CHECK in default file)."
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
LogText "Result: Cron job is not configured for debsums utility."
|
LogText "Result: Cron job is not configured for debsums utility."
|
||||||
Display --indent 6 --text "- Cron job for debsums" --result "${STATUS_NOT_FOUND}" --color YELLOW
|
Display --indent 6 --text "- Cron job for debsums" --result "${STATUS_NOT_FOUND}" --color YELLOW
|
||||||
|
|
Loading…
Reference in New Issue