Excellent, thank you!<div><br></div><div>Cheers,</div><div>peter<br><br><div class="gmail_quote">On Thu, Nov 17, 2011 at 2:23 PM, Eric Paris <span dir="ltr"><<a href="mailto:eparis@redhat.com">eparis@redhat.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">This is NOT full support for the new inode filter constructs I added to<br>
the policy, but is just enough to test some of it.  I'm hoping someone<br>
else will write real userspace patches.  One will need to apply the<br>
kernel patches and then install the new kernel headers (or<br>
update /usr/include/linux/audit.h by hand) Then apply this patch to<br>
audit and build a new audit (I found audit build sucks because it will<br>
build against the system libaudit rather than the one in tree, but you<br>
can fix this using make DESTDIR=[dir] install, and using the auditctl<br>
from [dir]/usr/local/sbin/)<br>
<br>
This patch supports two types of rules<br>
<br>
auditctl -a exit,always -F arch=b64 -S open -F obj_uid=500<br>
<br>
Which audits all opens for a uid=500 file.  (the kernel supports gid,<br>
but this patch doesn't, you can just copy the uid code to make gid work)<br>
<br>
This patch also supports<br>
<br>
auditctl -a exit,always -C<br>
<br>
Which will audit all cases where a process accesses a file in which the<br>
process uid != file uid.<br>
<br>
The kernel is a bit more flexible, it supports process_gid != file_gid.<br>
The kernel also supports == > <, etc.  This portion of the patch needs<br>
to do support a better construct for parsing the intent and passing that<br>
down.  But it seemed like a lot of work on a codebase I'm not familiar<br>
with and hoped someone familiar could write a text parse for this<br>
construct.<br>
<br>
We should be able to support something like:<br>
auditctl -a exit,always -F interfield!=uid<br>
<br>
I dunno what it should look like.  But like I said, I just slapped -C as<br>
a way to test process_uid != file_uid, so it should be pretty easy to<br>
look at that and see how other interactions should work.<br>
<font color="#888888"><br>
-Eric<br>
</font><br>--<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" target="_blank">https://www.redhat.com/mailman/listinfo/linux-audit</a><br></blockquote></div><br></div>