<div dir="ltr"><div><div>Rr-read the SSG section and see the settings for /tmp and the bind mount on /var/tmp which makes sense.<br><br></div>I&#39;m still curious as to how this will affect various vendor applications (and customer developer hackery) in the field though.<br>
<br>Thanks,<br><br></div>Trevor<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 10, 2013 at 11:29 PM, Trevor Vaughan <span dir="ltr">&lt;<a href="mailto:tvaughan@onyxpoint.com" target="_blank">tvaughan@onyxpoint.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Sorry for dropping out for a while.<div class="im"><div><br></div><div>&quot;<span style="font-family:arial,sans-serif;font-size:13px">The drawback to this method is that you have 4 rules that get evaluated for</span></div>

<span style="font-family:arial,sans-serif;font-size:13px">each and every syscall made to the kernel.&quot;</span><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></div><div><span style="font-family:arial,sans-serif;font-size:13px">I absolutely agree. But it seems to be a case of consistent minor slowdown where I have tons of cores (usually) vs &#39;find /....&#39; which KILLS my systems with slow disk I/O and misses things on NFS shares, etc...</span></div>
<div class="im">
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">&quot;</span><span style="font-family:arial,sans-serif;font-size:13px">I would also switch out uid!=0 to auid&gt;=500 auid!=4294967295&quot;</span></div>

<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></div><div><span style="font-family:arial,sans-serif;font-size:13px">I usually have my first rule be one that drops anything below 500 or equal to </span><font face="arial, sans-serif">4294967295 or the 32 bit equivalent on 32 bit systems since pretty much everything from that range is useless but, barring that, you should definitely do this.</font></div>
<div class="im">
<div><font face="arial, sans-serif"><br></font></div><div><span style="font-family:arial,sans-serif;font-size:13px">&quot;Does that actually happen? World writable dirs should have -noexec&quot;</span><font face="arial, sans-serif"><br>

</font></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></div><div><span style="font-family:arial,sans-serif;font-size:13px">Of course it does. They *should* have -noexec indeed but many/most lovely commercial vendors out there tend to not like that setting very much on /tmp or /var/tmp since they expect to install things from there (or /home or something equally horrible). Or, someone drops something into NFS/AFS or...pick your annoying misconfiguration of the day. (</span><a href="http://www.moreajays.com/2013/03/createouiprocess-13-permission-denied.html" target="_blank">http://www.moreajays.com/2013/03/createouiprocess-13-permission-denied.html</a>)</div>

<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Interestingly, looking through the latest STIG at <a href="http://stigviewer.com" target="_blank">stigviewer.com</a>, I don&#39;t see the requirement for setting /tmp and /var to noexec or nosuid.</span></div>

<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Honestly, I haven&#39;t really noticed that much in the way of system impact with the full CAPP profile enabled on systems. A lot of it comes down to tailoring your rules so that most of the chaff gets killed by the first few rules, just like iptables.</span></div>

<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Thanks,</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>

</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Trevor</span></div></div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Fri, Jun 28, 2013 at 10:59 AM, Steve Grubb <span dir="ltr">&lt;<a href="mailto:sgrubb@redhat.com" target="_blank">sgrubb@redhat.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Thursday, June 27, 2013 06:34:31 PM Trevor Vaughan wrote:<br>
&gt; All,<br>
&gt;<br>
&gt; Currently the remediation text for RHEL-06-000198 reads as:<br>
&gt;<br>
&gt; At a minimum the audit system should collect the execution of privileged<br>
&gt; commands for all users and root. To find the relevant setuid programs:<br>
&gt;<br>
&gt;   # find / -xdev -type f -perm -4000 -o -perm -2000 2&gt;/dev/null<br>
&gt;<br>
&gt;   Then, for each setuid program on the system, add a line of the following<br>
&gt; form to &quot;/etc/audit/audit.rules&quot;, where [SETUID_PROG_PATH] is the full path<br>
&gt; to each setuid program in the list:<br>
&gt;<br>
&gt;   -a always,exit -F path=[SETUID_PROG_PATH] -F perm=x -F auid&gt;=500 -F<br>
&gt; auid!=4294967295 -k privileged<br>
&gt;<br>
&gt; I would like to suggest that this be changed to<br>
&gt;<br>
&gt; Add the following to audit.rules:<br>
&gt;   -a always,exit -F arch=b64 -F euid=0 -F uid!=0 -S execve -k suid-root-exec<br>
&gt; -a always,exit -F arch=b64 -F egid=0 -F gid!=0 -S execve -k sgid-root-exec<br>
&gt; -a always,exit -F arch=b32 -F euid=0 -F uid!=0 -S execve -k suid-root-exec<br>
&gt; -a always,exit -F arch=b32 -F egid=0 -F gid!=0 -S execve -k sgid-root-exec<br>
&gt;<br>
&gt; From my testing, this appears to catch the execution of all suid/sgit<br>
&gt; binaries without digging all over the system to figure out what they are.<br>
<br>
</div>The drawback to this method is that you have 4 rules that get evaluated for<br>
each and every syscall made to the kernel. Syscall rules have performance<br>
impacts. I would also switch out uid!=0 to auid&gt;=500 auid!=4294967295. The<br>
reason being that the threat is what a user does rather than normal system<br>
operation.<br>
<br>
Regarding setgid, there are no apps that are setgid root.<br>
<div><br>
<br>
&gt; As an added bonus, you get to find out about binaries that pop onto your<br>
&gt; system for a brief period.<br>
<br>
</div>Does that actually happen? World writable dirs should have -noexec mount<br>
option and that leaves a user&#39;s home dir as the only place that could happen<br>
unless an admin installs apps. /home should be mounted -nosuid so...can it<br>
happen?<br>
<span><font color="#888888"><br>
-Steve<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div></div></div><div class="im">-- <br>Trevor Vaughan<br>Vice President, Onyx Point, Inc<br><a href="tel:%28410%29%20541-6699" value="+14105416699" target="_blank">(410) 541-6699</a><br>
<a href="mailto:tvaughan@onyxpoint.com" target="_blank">tvaughan@onyxpoint.com</a><br><br>
-- This account not approved for unencrypted proprietary information --
</div></div>
</blockquote></div><br><br clear="all"><br>-- <br>Trevor Vaughan<br>Vice President, Onyx Point, Inc<br>(410) 541-6699<br><a href="mailto:tvaughan@onyxpoint.com">tvaughan@onyxpoint.com</a><br><br>-- This account not approved for unencrypted proprietary information --
</div>