Auditing writes to all files in the /etc directory fills up root.

Auditing writes to all files in the /etc directory fills up root.  What can I do to avoid this (aside from mounting /audit as a file system as I don't have enough space available to do this).

“For stream mode, the log file is /audit/stream.out. I strongly suggest the directory /audit is mounted as a file system. It if isn’t you could be in danger of filling up the root file system.”

This is the script I'm using to do the audit:
## Shuts down auditing ##
/usr/sbin/audit shutdown
sleep 5
fuser -k /audit/stream.out
cp /dev/null /etc/security/audit/objects
## Saves audit log to a file named with the current day (days overwritten with new data weekly) ##
mv /audit/stream.out /audit/audit`date +%m%a`.log
## Puts every file in the specified directories into the objects file to be audited ##
find /etc -type f | awk '{printf("%s:\n\tw = FILE_Write\n\n",$1)}' > /etc/security/audit/objects
## Starts auditing ##
/usr/sbin/audit start

Who is Participating?
this warning is indeed justified. Streaming to the root filesystem can be dangerous.
The best way is actually creating a separate filesystem  for this.
But don't worry, if you can't afford a new FS you can always edit the file "/etc/security/audit/streamcmds"
to define a new stream destination. This file contains by default this line -
/usr/sbin/auditstream | auditpr > /audit/stream.out & 
Just change /audit/stream.out to a destination of your choice and restart auditing. Take care to change your reporting scripts (if any) to point to the new destination, and also the script you quoted in your question.
Of course you can also create a link, for example (stop auditing first!) -
cd /
tar -cvf /tmp/audit.tar ../audit
cd /var
tar -xvf /tmp/audit.tar
cd /
rm -r audit
ln -sf /var/audit audit  

Replace /var with a destination of your choice, outside the root FS.
murkytunaAuthor Commented:
Fantastic.  Thanks.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.