<div dir="ltr">Okay thank you both. I'll look into dbus as a possible solution.<div><br></div><div>By the way this is a CentOS 6.9 box running kernel 2.6.32-696.1.1.el6.i686</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><p style="margin-top:8px;margin-bottom:8px;font-family:Helvetica,Verdana,Arial,sans-serif;font-size:0.85em;color:rgb(51,51,51);line-height:1.4"><span style="font-size:0.85em;line-height:1.4">___</span><br></p><p style="margin-top:8px;margin-bottom:8px;font-family:Helvetica,Verdana,Arial,sans-serif;font-size:1.1em;color:rgb(51,51,51);line-height:1.4">John Petrini</p><p style="margin-top:8px;margin-bottom:8px;font-family:Helvetica,Verdana,Arial,sans-serif;font-size:0.85em;color:rgb(51,51,51);line-height:1.6">NOC Systems Administrator   //   <strong>CoreDial, LLC</strong>   //   <a href="http://coredial.com/" title="CoreDial" style="color:rgb(35,104,179);text-decoration:none" target="_blank">coredial.com</a>   //   <a href="https://twitter.com/coredial" target="_blank"><img src="http://cdn2.hubspot.net/hub/210539/file-2353637622-gif/email/twitter-1.gif" alt="Twitter" style="vertical-align:text-bottom"></a>   <a href="http://www.linkedin.com/company/99631" target="_blank"><img src="http://cdn2.hubspot.net/hub/210539/file-2351103565-gif/email/linkedin-1.gif" alt="LinkedIn" style="vertical-align:text-bottom"></a>   <a href="https://plus.google.com/104062177220750809525/posts" target="_blank"><img src="http://cdn2.hubspot.net/hub/210539/file-2353637617-gif/email/googleplus-1.gif" alt="Google Plus" style="vertical-align:text-bottom"></a>   <a href="http://success.coredial.com/blog" target="_blank"><img src="http://cdn2.hubspot.net/hub/210539/file-2351103560-gif/email/rss-1.gif" alt="Blog" style="vertical-align:text-bottom"></a> <br>Hillcrest I, 751 Arbor Way, Suite 150, Blue Bell PA, 19422 <br><strong>P: </strong><a style="color:rgb(35,104,179)">215.297.4400</a> x232   //   <strong>F: </strong><a style="color:rgb(35,104,179)">215.297.4401</a>   //   <strong>E: </strong><a href="mailto:jpetrini@coredial.com" style="color:rgb(35,104,179);text-decoration:none" target="_blank">jpetrini@coredial.com</a></p><p><img src="http://success.coredial.com/hubfs/images/CD16-PC17-Email-Signature-Final-Mar-v2-1.gif"><br></p><p style="margin-top:10px;margin-bottom:8px;font-family:Helvetica,Verdana,Arial,sans-serif;font-size:0.85em;color:rgb(51,51,51);line-height:1.6">Interested in sponsoring PartnerConnex 2017? <a href="http://success.coredial.com/partnerconnex-2017-sponsorship" style="color:rgb(35,104,179);text-decoration:none" target="_blank">Learn more.</a></p><p style="padding-bottom:15px;max-width:600px;font-family:Helvetica,Verdana,Arial,sans-serif;font-size:0.6em;color:rgb(51,51,51);line-height:1.4">The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission,  dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.</p></div></div></div></div><a href="http:///" target="_blank"></a></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Mon, Jun 12, 2017 at 11:52 AM, 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">Hello,<br>
<span class=""><br>
On Monday, June 12, 2017 10:20:15 AM EDT John Petrini wrote:<br>
> We have a need to monitor voicemail directories for any sort of access.<br>
> Basically there is only one application that should be accessing the files.<br>
> If anything else accesses the files we need to log that.<br>
><br>
> We setup the following to accomplish this but it's doesn't quite do what we<br>
> want.<br>
><br>
> -a always,exit -S all -F dir=/path/to/voicemail -F perm=rwxa -F<br>
> auid!=voicemail_user -F key=voicemail_watch<br>
><br>
> voicemail_user is the user that initially starts the process. The problem<br>
> arises when someone logged in under a different account restarts the<br>
> process. From that point forward every time the application accesses that<br>
> directory it results in a log message.<br>
<br>
</span>This is a common problem with old SysVinit style systems. This works correctly<br>
on Systemd based init systems. I thought at one point that Upstart had fixed<br>
this, but I cannot find any reference in the Changelog that indicates it was<br>
fixed.<br>
<br>
The best solution is to write another daemon to start your application. Signal<br>
it to restart the application using some IPC mechanism. The basic issue is<br>
that the credentials are inherited from the login to all processes in the<br>
login. So, you need to restart the application from a clean environment where<br>
login credentials haven't leaked.<br>
<br>
This leaking of credentials between all processes in a login session is by<br>
design so that attackers cannot undo the breadcrumb trail left by the audit<br>
system.<br>
<span class=""><br>
> We need other users to be able to be able to log in and restart the process<br>
> so our method here really doesn't work. Is there a way to log only if a<br>
> different application access the directory rather than basing the audit on<br>
> user?<br>
<br>
</span>This really is telling you that the application is getting the whole login<br>
environment of the user restarting the application. You might try exploring<br>
dbus activation.<br>
<br>
<a href="https://dbus.freedesktop.org/doc/system-activation.txt" rel="noreferrer" target="_blank">https://dbus.freedesktop.org/<wbr>doc/system-activation.txt</a><br>
<br>
And then limit who can run that application by some group id.<br>
<br>
chmod 0750 /path/dbus-activation-launcher<br>
chgrp wheel  /path/dbus-activation-launcher<br>
<span class=""><br>
> I was hoping to us something like -F exe!="/path/to/application" but it<br>
> looks like this is not supported.<br>
<br>
</span>You haven't mentioned what kernel or init system you have, but it sounds like<br>
its not recent. Dbus activation is probably the cleanest way to fix the issue.<br>
<span class="HOEnZb"><font color="#888888"><br>
-Steve<br>
</font></span></blockquote></div><br></div>