<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">warron.french <span dir="ltr"><<a target="_blank" href="mailto:warron.french@gmail.com">warron.french@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div></div>Anyway, my organization has a goal to audit several things; of which I know how to manage most, for examples:<br>...<br></div></div></div></div></blockquote><div><br></div><div>Hi Warron. Have you looked at the various *.rules files that are shipped with the audit package? In RHEL/CentOS, you'll see:<br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">~]# ls -1 /usr/share/doc/audit-2.4.1/*<wbr>rules<br>/usr/share/doc/audit-2.4.1/<wbr>capp.rules<br>/usr/share/doc/audit-2.4.1/<wbr>lspp.rules<br>/usr/share/doc/audit-2.4.1/<wbr>nispom.rules<br>/usr/share/doc/audit-2.4.1/<wbr>stig.rules<br></blockquote><br></div><div>These files already have example rules to do probably everything you're trying to do.<br><br></div><div>In newer versions, e.g., in Fedora, it gets even fancier:<br></div><div><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">~]# ls /usr/share/doc/audit/rules/<br>10-base-config.rules    32-power-abuse.rules<br>10-no-audit.rules       40-local.rules<br>11-loginuid.rules       41-containers.rules<br>12-cont-fail.rules      42-injection.rules<br>12-ignore-error.rules   43-module-load.rules<br>20-dont-audit.rules     70-einval.rules<br>21-no32bit.rules        71-networking.rules<br>22-ignore-chrony.rules  99-finalize.rules<br>30-nispom.rules         Makefile<br>30-pci-dss-v31.rules    Makefile.am<br>30-stig.rules           Makefile.in<br>31-privileged.rules     README-rules<br></blockquote><br></div><div>These are also all well-documented examples. I think if you look through those, you'll find everything you're looking for.<br></div><div><br><br></div><div>warron.french <span dir="ltr"><<a target="_blank" href="mailto:warron.french@gmail.com">warron.french@gmail.com</a>></span> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div></div>For these I would have used a watch (<i><b>-w</b></i>) rule and set the -p flags to <b>r, w</b> or <b>a</b> as shown above.  From what I understand though, correct me if I am wrong Steve, we should be getting away from the watch rules and move towards Syscalls and using <b>-F path=/path/to/file</b>, or<br><b>-F path=/path/to/several_files/</b>   -- is this correct, both for RHEL6 and RHEL7?<br></div></div></div></blockquote><div><br></div><div>No. The simple -w syntax isn't going anywhere. My understanding: there's no performance hit for adding additional simple -w rules; whereas, you DO take a performance hit for each additional syscall-auditing rule line. Use watches if you can get away with the restrictive simplicity they offer; use syscall-rules when you need to.<br></div><div> <br><br><div>warron.french <span dir="ltr"><<a target="_blank" href="mailto:warron.french@gmail.com">warron.french@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div></div>Also, I need to audit  (Success/Failure) for the following sort of things:<br></div><div><b><font color="#ff0000">Authentications<br></font></b></div><div><span style="color:rgb(0,0,255)">Logons<br></span></div><div><font color="#ff0000"><span style="color:rgb(0,0,255)">Logoffs</span><br></font></div></div></blockquote><div><br></div><div>You can see examples of how to handle that in the rules the audit package ships with, e.g., from nispom:<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">## Audit 1, 1(b) Successful and unsuccessful logons and logoffs.<br>## This is covered by patches to login, gdm, and openssh<br>## Might also want to watch these files if needing extra information<br>#-w /var/log/tallylog -p wa -k logins<br>#-w /var/run/faillock/ -p wa -k logins<br>#-w /var/log/lastlog -p wa -k logins<br>#-w /var/log/btmp -p wa -k logins<br>#-w /var/run/utmp -p wa -k logins<br></blockquote><br></div><div>Or from stig:<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">## (GEN002720-GEN002840: CAT II) (Previously – G100-G106) The SA will<br>## configure the auditing system to audit the following events for all<br>## users and root:<br>##<br>## - Logon (unsuccessful and successful) and logout (successful)<br>##<br>## Handled by pam, sshd, login, and gdm<br>## Might also want to watch these files if needing extra information<br>#-w /var/log/tallylog -p wa -k logins<br>#-w /var/run/faillock/ -p wa -k logins<br>#-w /var/log/lastlog -p wa -k logins<br><br>##- Process and session initiation (unsuccessful and successful)<br>##<br>## The session initiation is audited by pam without any rules needed.<br>## Might also want to watch this file if needing extra information<br>#-w /var/run/utmp -p wa -k session<br>#-w /var/log/btmp -p wa -k session<br>#-w /var/log/wtmp -p wa -k session<br></blockquote></div><br><div><br></div><div>warron.french <span dir="ltr"><<a target="_blank" href="mailto:warron.french@gmail.com">warron.french@gmail.com</a>></span> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><font color="#ff0000"></font></div><div><font color="#ff0000"><b>Writes/downloads to external devices/media<br></b></font></div><div><font color="#ff0000"><b>Uploads from external devices/media </b>(<i>such as DvD, thumbdrive, etc)<br></i></font></div></div></blockquote><div><br></div><div>You can audit mount syscalls, but that's not exactly fun on a modern system. In any case, in stig rules:<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">##- Export to media (successful)<br>## You have to mount media before using it. You must disable all automounting<br>## so that its done manually in order to get the correct user requesting the<br>## export<br>-a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -F key=export<br>-a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -F key=export<br></blockquote><br>That said, the above example is assuming root login is disabled (requiring people login as their own user and su/sudo to root) ... but it's something. There was some discussion back in April cross-posted between the linux-audit, linux-usb, and linux-kernel mailing lists (subj: "[RFC] Create an audit record of USB specific details"). I think the usual approach is to just disable stuff from BIOS. I could imagine (as a band-aid) adding udev rules that generate audit events as well but I've never done it.<br></div><div><br><br>warron.french <span dir="ltr"><<a target="_blank" href="mailto:warron.french@gmail.com">warron.french@gmail.com</a>></span> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><font color="#ff0000"><b>User & Group</b> <b>events</b><br></font></div><div><div><div><div><div><div><div><span style="color:rgb(0,0,255)">User:  Creation, deletion, Modification, suspending/locking<br></span></div><div><span style="color:rgb(0,0,255)">Group/Role:  Creation, deletion, modification<br></span><br><span style="color:rgb(0,0,255)"><b><font color="#ff0000">Use of Privileged/Special Rights events</font></b><font color="#ff0000"> (<i>such as sudo, su, etc..)</i></font></span></div></div></div></div></div></div></div></div></blockquote><div><br></div><div>Yep you'll find that in stig, nispom, etc.<br><br><br>warron.french <span dir="ltr"><<a target="_blank" href="mailto:warron.french@gmail.com">warron.french@gmail.com</a>></span> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><span style="color:rgb(0,0,255)"><font color="#ff0000"><i></i></font></span></div><div><span style="color:rgb(0,0,255)"><font color="#ff0000"><b>Printing to a print-device<br></b></font></span></div><div><span style="color:rgb(0,0,255)"><font color="#ff0000"><b>Printing to a file</b></font></span><br></div></div></div></div></div></div></div></div></blockquote></div><br>I would just completely remove CUPS ... or log use of lp/lpr commands.<br><br></div><div class="gmail_extra">Hope this helps get you on the right track.<br></div></div>