<div dir="ltr">This is very cool!  I didn't know you could pass data from ausearch into aureport.  Does the -f option simply expect stdin if a file is not specified then?<div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">--------------------------<br><font color="#000099" size="4">Warron French<br><font size="4"><font size="4"><font size="4"><br></font></font></font></font></div></div></div>
<br><div class="gmail_quote">On Mon, Jun 25, 2018 at 5:28 PM, Steve Grubb <span dir="ltr"><<a href="mailto:sgrubb@redhat.com" target="_blank">sgrubb@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Monday, June 25, 2018 4:59:59 PM EDT Skaggs, Nicholas C wrote:<br>
</span><span class="">> Hello<br>
> I noticed in the man page for auditctl, an example of how to monitor if<br>
> admins are accessing other user's files. I created a rule like the one in<br>
> the example. This is great that it is pulling the action and user calling<br>
> the action!<br>
> <br>
> The rule<br>
> -a always,exit -S all -F dir=/home/username/ -F uid=0 -C auid!=obj_uid<br>
> <br>
> I will pull a report on the findings with<br>
> aureport -f -i | grep /home/username/<br>
<br>
</span>One other thing to comment on. You might do the report part a little<br>
different. I'd let ausearch do the filtering before it goes to aureport. Its<br>
much more flexible. For example, if you added a key to the rule "admin-access".<br>
Then you can do this:<br>
<br>
summary of all accesses<br>
ausearch --start today -k admin-access --raw | aureport --summary -f<br>
<br>
summary for a specific dir<br>
ausearch --start today -k admin-access -f /home/username --raw | aureport --summary -f<br>
<br>
summary of who did it<br>
ausearch --start today -k admin-access --raw | aureport --summary -u -i<br>
<br>
summary for a sepcific admin<br>
ausearch --start today -k admin-access --loginuid admin-name --raw | aureport --summary -f<br>
<br>
If you don't use the key in the searches, then you may be getting<br>
unrelated events in the report.<br>
<span class="HOEnZb"><font color="#888888"><br>
-Steve<br>
</font></span><span class="im HOEnZb"><br>
> The report is heavier than anticipated so I tried to make an adjustment to<br>
> only capture what happens in the directory -a always,exit -S all -F<br>
> path=/home/username/ -F uid=0 -C auid!=obj_uid ... but that is returning<br>
> with  Error sending add rule data request (Invalid argument)<br>
> <br>
> I then tried the below rule; it does not return an error upon add, but when<br>
> I do an auditctl -l there are no rules listed -a always,exit -S all -F<br>
> path=/home/username/ -p=rwxa -F uid=0 -C auid!=obj_uid<br>
> <br>
> Is there a preferred  way to set the rule, maybe on the inode of the<br>
> directory, but does not lose the ability to see if an admin is doing it<br>
> and what action?  I have been adding these on the fly, instead of adding<br>
> to the /etc/audit/audit.rules file, for now.<br>
> <br>
> <br>
> Thanks!<br>
> Nick Skaggs<br>
<br>
<br>
<br>
<br>
</span><div class="HOEnZb"><div class="h5">--<br>
Linux-audit mailing list<br>
<a href="mailto:Linux-audit@redhat.com">Linux-audit@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/linux-audit" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/linux-audit</a><br>
</div></div></blockquote></div><br></div>