Linux Logcheck
Configurations
Configure the “/usr/bin/logcheck.sh” script file
Since we are using an alternate path for the files (i.e NOT /usr/local/etc), we need to change the path entries for “logcheck.hacking”, “logcheck.violations”, “logcheck.ignore”, “logcheck.violations.ignore”, and “logtail” in the main logcheck.sh script. The script file for Logcheck 7usr/bin/logcheck.sh” allows you to set these options that modify the path entries and operation of the program. It is well commented and very basic.
Stepi Edit the logcheck.sh file (vi /usr/bin/logcheck.sh) and change the following:
LOGTAIL=/usr/local/bin/logtail To read: LOGTAIL=/usr/bin/logtail
TMPDIR=/usr/local/etc/tmp To read: TMPDIR=/etc/logcheck/tmp
HACKING_FILE=/usr/local/etc/logcheck.hacking To read: HACKING_FILE=/etc/logcheck/logcheck.hacking
VIOLATIONS_FILE=/usr/local/etc/logcheck. violations To read: VIOLATIONS_FILE=/etc/logcheck/logcheck.violations
VIOLATIONS_IGNORE_FILE=/usr/local/etc/logcheck.violations.ignore To read: VIOLATIONS_IGNORE_FILE=/etc/logcheck/logcheck.violations.ignore
IGNORE_FILE=/usr/local/etc/logcheck.ignore To read: IGNORE_FILE=/etc/logcheck/logcheck.ignore
Step 2
Place an entry into root’s crontabs to make Logcheck run as a cronjob:
After installing Logcheck, you should edit your local crontab file for root and set Logcheck to run once per hour (recommended, although you can do it more frequently, or less frequently). To add
Logcheck in your cronjob you must edit the crontab and add the following line:
• To edit the crontab, use the command (as root): [root@deep /]# crontab -e
# Hourly check Log files for security violations and unusual activity. 00 * * * * /usr/bin/logcheck.sh
NOTE: Remember, Logcheck does not report anything via email if it has nothing useful to say.
Installed files
> /etc/logcheck > /usr/bin/logcheck.sh
> /etc/logcheck/tmp
> /etc/logcheck/logcheck.hacking
> /etc/logcheck/logcheck.violations
> /etc/logcheck/logcheck.violations.ignore
> /etc/logcheck/logcheck.ignore
> /usr/bin/logtail
> /var/log/messages.offset
> /var/log/secure.offset
> /var/log/maillog.offset