Skip to contentSkip to conversation

Qusetion on logging file deletions with auditd

DISCUSSION Walt Powell 2 participants 2 messages Jan 31, 2007 – Feb 5, 2007

lore
Share & tools
lore
#0 lore raw

What would the appropriate syscall be in the audit.rules file to log file deletions with auditd? I'm thinking the syntax would be something akin to -w entry, always -S delete, but that doesn't seem to work...

Thanks to all...

#1 lore raw
Quoted 2 lines · Walt Powell

What would the appropriate syscall be in the audit.rules file to log file deletions with auditd?

Assuming current upstream kernel...In terms of watches, I think deletion is considered a write. But if you audit writes like this:

auditctl -w /var/log/messages -p w -k delete-logs

you will likely get more than you asked for. So, you could do it this way:

auditctl -a exit,always -S unlink -F path=/var/log/messages -F key=delete-logs

and then find them with:

ausearch --start today -k delete-logs

-Steve