<div dir="ltr">Unfortunately, you might miss a lot of files this way. While most files will *normally* be in /var/log, some may not depending on a given configuration so you really need to parse from rsyslog outward.<div><br>
</div><div>Trevor</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 19, 2013 at 12:21 AM, Tim Moor <span dir="ltr">&lt;<a href="mailto:tmoor@redhat.com" target="_blank">tmoor@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">Wouldn&#39;t it be possible to walk the /var/log/directory and for each file<br>
perform a look up in the rsyslog configuration file. If it exists then<br>
it is managed by rsyslog and therefore must have specific ownership. If<br>
the grep fails to return a record from either /etc/rsyslog.conf or a<br>
file within /etc/rsyslog.d/ then it would be safe to ignore.<br>
<br>
Your thoughts?<br>
<div class="HOEnZb"><div class="h5"><br>
On Sat, 2013-08-17 at 13:54 -0400, Trevor Vaughan wrote:<br>
&gt; This would definitely be a case where I&#39;d use an external helper script.<br>
&gt;<br>
&gt; From the configs that I have, you only seem to care about:<br>
&gt;<br>
&gt; $IncludeConfig .* &lt;= Parse whatever this glob results in.<br>
&gt;<br>
&gt; Anything that does not start with $[A-Z], ends a line, has spaces before<br>
&gt; it, and has a slash in it.<br>
&gt;<br>
&gt; IF the file referenced exists, then check the file for permissions.<br>
&gt;<br>
&gt; That should at least get you to the 80% mark.<br>
&gt;<br>
&gt; If you want to get fancy, you could point out things in /var/log (or all<br>
&gt; base directories that you discover) that aren&#39;t referenced and have them be<br>
&gt; automatically checked.<br>
&gt;<br>
&gt; Trevor<br>
&gt;<br>
&gt;<br>
&gt; On Tue, Aug 13, 2013 at 4:38 PM, Kayse, Josh<br>
&gt; &lt;<a href="mailto:Joshua.Kayse@gtri.gatech.edu">Joshua.Kayse@gtri.gatech.edu</a>&gt;wrote:<br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt; On Aug 13, 2013, at 4:16 PM, &quot;Truhn, Chad M CTR NSWCDD, CXA30&quot; &lt;<br>
&gt; &gt; <a href="mailto:chad.m.truhn.ctr@navy.mil">chad.m.truhn.ctr@navy.mil</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; &gt;&gt;&gt; How do you think we should handle file owner and group permission<br>
&gt; &gt; &gt;&gt;&gt; checks on rsyslog files? Should we look for a predetermined list of<br>
&gt; &gt; &gt;&gt;&gt; files (trying to search for *.log is insufficient, since at the very<br>
&gt; &gt; &gt;&gt;&gt; least, /var/log/messages, /var/log/secure, and /var/log/maillog would<br>
&gt; &gt; &gt;&gt;&gt; get passed over)? Or should we try ninja regex to parse rsyslog.conf?<br>
&gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt;&gt; I&#39;m torn. The &#39;right way&#39; would be regex ninja. However that&#39;s hard, and<br>
&gt; &gt; &gt;&gt; has resulted in nothing getting done. Personally I&#39;d rather have<br>
&gt; &gt; &gt;&gt; *something* hard coded, then evolve into ninja regex.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I don&#39;t know if it is even really an option, but I would personally like<br>
&gt; &gt; to see it always fail with something like a manual check rather than hard<br>
&gt; &gt; coding some things that will not necessarily reflect the real state of the<br>
&gt; &gt; system.  If you hard code fileA, fileB, and fileC and I also have fileD,<br>
&gt; &gt; you could potentially give a false Pass if fileD was 777.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I think a regex is the only way that you could ever pass with some<br>
&gt; &gt; degree of confidence, but the rsyslog config file is SUPER hard.  I don&#39;t<br>
&gt; &gt; want to downplay anyone&#39;s regex skills, but rsyslog deals with some<br>
&gt; &gt; variables (like %HOSTNAME%, %syslogfacility%, etc) that can be used in the<br>
&gt; &gt; file path/name.  How could you ever be able to derive that?  I think any<br>
&gt; &gt; normal person would have a system where syslog sends things to a directory<br>
&gt; &gt; where other files should not be, but is it safe to assume?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I could be negatively skewed here, but I personally would prefer to have<br>
&gt; &gt; a false failure or a manual check than a false pass.  The CISSP stuff beat<br>
&gt; &gt; that into my head with a rather large bat.  But I&#39;m not the one doing the<br>
&gt; &gt; hard work here, you guys are.  Just my $0.02.<br>
&gt; &gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; I would add my concurrence to this suggestion.  You can use an include dir<br>
&gt; &gt; in rsyslog such that the configuration is built up amongst multiple files;<br>
&gt; &gt; how would that be handled?<br>
&gt; &gt;<br>
&gt; &gt; -josh<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; scap-security-guide mailing list<br>
&gt; &gt; <a href="mailto:scap-security-guide@lists.fedorahosted.org">scap-security-guide@lists.fedorahosted.org</a><br>
&gt; &gt; <a href="https://lists.fedorahosted.org/mailman/listinfo/scap-security-guide" target="_blank">https://lists.fedorahosted.org/mailman/listinfo/scap-security-guide</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; scap-security-guide mailing list<br>
&gt; <a href="mailto:scap-security-guide@lists.fedorahosted.org">scap-security-guide@lists.fedorahosted.org</a><br>
&gt; <a href="https://lists.fedorahosted.org/mailman/listinfo/scap-security-guide" target="_blank">https://lists.fedorahosted.org/mailman/listinfo/scap-security-guide</a><br>
<br>
_______________________________________________<br>
scap-security-guide mailing list<br>
<a href="mailto:scap-security-guide@lists.fedorahosted.org">scap-security-guide@lists.fedorahosted.org</a><br>
<a href="https://lists.fedorahosted.org/mailman/listinfo/scap-security-guide" target="_blank">https://lists.fedorahosted.org/mailman/listinfo/scap-security-guide</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <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>