I have a script on server that runs every few min, and among other things checks if some malicious crontab entries have been injected. In order to do this I check crontabs of all users, which works all good, but my /var/log/cron
file gets filled up with entries of the all crontab listings, so everytime I run the script it would log all crontab lists like this:
Nov 30 17:16:02 myserv crontab[348610]: (root) LIST (root)
Nov 30 17:16:02 myserv crontab[348611]: (root) LIST (bin)
Nov 30 17:16:02 myserv crontab[348612]: (root) LIST (daemon)
Nov 30 17:16:02 myserv crontab[348613]: (root) LIST (adm)
Nov 30 17:16:02 myserv crontab[348614]: (root) LIST (lp)
Nov 30 17:16:02 myserv crontab[348615]: (root) LIST (sync)
Nov 30 17:16:02 myserv crontab[348616]: (root) LIST (shutdown)
Nov 30 17:16:02 myserv crontab[348617]: (root) LIST (halt)
Nov 30 17:16:02 myserv crontab[348618]: (root) LIST (mail)
Nov 30 17:16:02 myserv crontab[348619]: (root) LIST (operator)
Nov 30 17:16:02 myserv crontab[348620]: (root) LIST (games)
Nov 30 17:16:02 myserv crontab[348621]: (root) LIST (ftp)
Nov 30 17:16:02 myserv crontab[348622]: (root) LIST (smb)
Nov 30 17:16:02 myserv crontab[348623]: (root) LIST (named)
Nov 30 17:16:02 myserv crontab[348624]: (root) LIST (postgres)
Nov 30 17:16:02 myserv crontab[348625]: (root) LIST (mysql)
.....
so it fills up log file unnecessarily.
I played with different selectors but it seems when choosing cron.info
it shows all info, whereas cron.notice
it doesn't show when crontab has been edited nor executed, which again I like in my logs.
# Log cron stuff
cron.* /var/log/cron
cron.*
seems to be the same as cron.info
Any Ideas how to exclude "LIST" entries?
so /var/log/cron
would look like:
Nov 30 17:24:02 mysrv CROND[349831]: (root) CMDEND (/etc/cron.b/check nout >/dev/null 2>&1)
Nov 30 17:28:01 mysrv CROND[350781]: (root) CMD (/etc/cron.b/check nout >/dev/null 2>&1)