Bug 73432 - rkhunter cronjob script
Bug#: 73432 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: enhancement Priority: P2
Resolution: FIXED Assigned To: ka0ttic@gentoo.org Reported By: smouge@hotpop.com
Component: Ebuilds
URL: 
Summary: rkhunter cronjob script
Keywords:  
Status Whiteboard: 
Opened: 2004-12-05 04:08 0000
Description:   Opened: 2004-12-05 04:08 0000
Regarding created file /etc/cron.daily/rkhunter

A couple of very small requests:

Would be nice to add to the cronjob script a line to update the rkhunter database like:

# first update the database
/usr/bin/rkhunter --update &> /dev/null

In this way the database gets updated everyday. Else wise the database never gets updated?

Also would be nice to add the creation of a logfile to the cron job settings:

RKHUNTER_EXEC="/usr/bin/rkhunter"
RKHUNTER_OPTS="--checkall --cronjob --skip-keypress --createlogfile"


Reproducible: Always
Steps to Reproduce:
1.
2.
3.

------- Comment #1 From Aaron Walker (RETIRED) 2004-12-05 11:04:48 0000 -------
Why, that's a great idea ;)

Especially the logfile, because if a user doesn't have a MTA setup, he'll never know the output of rkhunter...

I'll take care of this either some time today or first thing in the morning.

------- Comment #2 From Aaron Walker (RETIRED) 2004-12-07 02:22:18 0000 -------
Ok, since I'm at least 10x more knowledgable wrt scripting than I was when I
first wrote that cron job, I decided to rewrite it ;p

In addition to the stuff you have requested, I decided to add a couple other
features (and even went as far as patching rkhunter's --createlogfile to accept
an optional filename argument for specifying an alternate log file location).

I also added a SAVE_OLD_LOGS config option, so that old logs dont get
overwritten every time rkhunter runs.  I've also added a LOGFILE_PERMS option,
in case the user would like different permissions (it's world readable by
default).

rkhunter-1.1.8-r1 is in CVS.  Please test (mainly the cron script) if you could
be so kind, and reopen this bug, if necessary.

Thanks for request; in addition to motivating me to provide a more enhanced
cron script, you also gave me something to do at work last night ;)

Cheers.

------- Comment #3 From smouge 2004-12-07 10:29:32 0000 -------
Worked like a charm.

Many thanks. I also liked that you have placed the output of the update routine in the report mail.