Hi,
Thanks for your help.
I added the following rule in local_rules.xml in order to receive by email this type of event. Since the rule is level 11 I have added "alert_by_email" directive but this is the only difference from the original rule.
<group name="ossec,">
<rule id="521" level="11" overwrite="yes">
<if_sid>510</if_sid>
<options>alert_by_email</options>
<match>Possible kernel level rootkit</match>
<description>Possible kernel level rootkit</description>
<mitre>
<id>T1014</id>
</mitre>
<group>rootcheck,</group>
</rule>
</group>
I also added the following directive in ossec.conf needed to get notifications by email for this rule:
<email_alerts>
<email_to>em...@domain.com</email_to>
<rule_id>521</rule_id>
<do_not_delay />
</email_alerts> This is a rootcheck rule so the "full_log" field is something like:
"Anomaly detected in file '/var/log/tallylog'. Hidden from stats, but showing up on readdir. Possible kernel level rootkit."
The rule triggers every 12 hours when rootchek runs. As I wrote in my first email, the two files that trigger the rule have the same nature.
1. Are data type:
root@rpi:~# file /var/log/tallylog
/var/log/tallylog: data
root@rpi:~# file /var/log/lastlog
/var/log/lastlog: data
2. They are occupying very huge amount of disk space
root@rpi:~# ls -lh /var/log/tallylog
-rw------- 1 root root 29G feb 1 2023 /var/log/tallylog
root@rpi:~# ls -lh /var/log/lastlog
-rw-rw-r-- 1 root utmp 129G sep 26 13:33 /var/log/lastlog
3. The actual size is only few KB's, if you check with the ls -s command (output of -s is in disk blocks).
root@rpi:~# ls -s /var/log/tallylog
28 /var/log/tallylog
root@rpi:~# ls -s /var/log/lastlog
44 /var/log/lastlog
Thanks for your help.