<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Why is /etc/shadow being indexed?  Does fschange index files? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-etc-shadow-being-indexed-Does-fschange-index-files/m-p/12894#M1074</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;unix       [monitor:///etc]
unix       _blacklist = (/etc/shadow)
system     _rcvbuf = 1572864
unix       _whitelist = (\.conf|\.cfg|config$|\.ini|\.init|\.cf|\.cnf|shrc$|^ifcfg|\.profile|\.rc|\.rules|\.tab|tab$|\.login|policy$)
system     host = blah.blah.com
unix       index = os
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;/etc/shadow is being indexed and I can't figure out why.  This is the only stanza related to /etc other than the fschange stanza.  Does fschange index the files it monitors?  We don't want /etc/shadow indexed &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;  I added the _blacklist entry but that didn't do anything.&lt;/P&gt;</description>
    <pubDate>Wed, 05 May 2010 07:09:33 GMT</pubDate>
    <dc:creator>oreoshake</dc:creator>
    <dc:date>2010-05-05T07:09:33Z</dc:date>
    <item>
      <title>Why is /etc/shadow being indexed?  Does fschange index files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-etc-shadow-being-indexed-Does-fschange-index-files/m-p/12894#M1074</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;unix       [monitor:///etc]
unix       _blacklist = (/etc/shadow)
system     _rcvbuf = 1572864
unix       _whitelist = (\.conf|\.cfg|config$|\.ini|\.init|\.cf|\.cnf|shrc$|^ifcfg|\.profile|\.rc|\.rules|\.tab|tab$|\.login|policy$)
system     host = blah.blah.com
unix       index = os
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;/etc/shadow is being indexed and I can't figure out why.  This is the only stanza related to /etc other than the fschange stanza.  Does fschange index the files it monitors?  We don't want /etc/shadow indexed &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;  I added the _blacklist entry but that didn't do anything.&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2010 07:09:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-etc-shadow-being-indexed-Does-fschange-index-files/m-p/12894#M1074</guid>
      <dc:creator>oreoshake</dc:creator>
      <dc:date>2010-05-05T07:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Why is /etc/shadow being indexed?  Does fschange index files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-etc-shadow-being-indexed-Does-fschange-index-files/m-p/12895#M1075</link>
      <description>&lt;P&gt;"monitor://" is not fschange, but is file tailing/indexing.  From &lt;A href="http://www.splunk.com/base/Documentation/latest/Admin/Inputsconf" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/Admin/Inputsconf&lt;/A&gt; you will want to use a "fschange:" stanza instead.&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2010 07:47:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-etc-shadow-being-indexed-Does-fschange-index-files/m-p/12895#M1075</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2010-05-05T07:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Why is /etc/shadow being indexed?  Does fschange index files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-etc-shadow-being-indexed-Does-fschange-index-files/m-p/12896#M1076</link>
      <description>&lt;P&gt;Agree with dwaddle.&lt;/P&gt;

&lt;P&gt;However, assuming the events you get are not fschange events, it's unclear to me why your blacklist does not exclude the indexing of shadow.  How does the event appear in index?&lt;/P&gt;

&lt;P&gt;Independently, we have a config that tries to prevent this, but it's goofed.  Look in etc/apps/unix/default/props.conf, you'll see:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::///etc/passwd]
sourcetype = ignored_type

[source::///etc/shadow*]
sourcetype = ignored_type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This wants to be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/etc/passwd]
sourcetype = ignored_type

[source::/etc/shadow*]
sourcetype = ignored_type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can drop the lower set of lines in etc/apps/unix/local/props.conf (or another local directory) until we ship the next maintenance release.  Investigating the blacklist fail is worthwhile though, since it also should have worked.  I think you've a ticket in?&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2010 12:34:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-etc-shadow-being-indexed-Does-fschange-index-files/m-p/12896#M1076</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2010-05-05T12:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: Why is /etc/shadow being indexed?  Does fschange index files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-etc-shadow-being-indexed-Does-fschange-index-files/m-p/12897#M1077</link>
      <description>&lt;P&gt;Small world.  I just reported this as a bug to Splunk a few days back. (Splunk Case #42678, SPL-31254)&lt;/P&gt;

&lt;P&gt;Also note that you probably want the entry for &lt;CODE&gt;passwd&lt;/CODE&gt; to be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/etc/passwd*]
sourcetype = ignored_type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should protect against backup files being indexed too, which can be just as dangerous.  (Many different variations of Linux have different suffixes, so it seems easier and safer just to do &lt;CODE&gt;passwd*&lt;/CODE&gt;)&lt;/P&gt;

&lt;P&gt;Also note that &lt;CODE&gt;/etc/&lt;/CODE&gt; is in &lt;CODE&gt;inputs.conf&lt;/CODE&gt; both as a &lt;CODE&gt;monitor&lt;/CODE&gt; and via &lt;CODE&gt;fschange&lt;/CODE&gt; which the docs say should should do.  See the answer on &lt;A href="http://answers.splunk.com/questions/1967/are-there-any-reasons-to-setup-both-monitor-and-fschange-on-the-same-path/1971#1971" rel="nofollow"&gt;Are there any reasons to setup both monitor and fschange on the same path?&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2010 21:00:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-etc-shadow-being-indexed-Does-fschange-index-files/m-p/12897#M1077</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-05-05T21:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: Why is /etc/shadow being indexed?  Does fschange index files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-etc-shadow-being-indexed-Does-fschange-index-files/m-p/12898#M1078</link>
      <description>&lt;P&gt;Yeah, I probably had that answer ready after reading your bug.  I read some bug that mentioned it, in any event.&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2010 21:52:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-etc-shadow-being-indexed-Does-fschange-index-files/m-p/12898#M1078</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2010-05-05T21:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: Why is /etc/shadow being indexed?  Does fschange index files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-etc-shadow-being-indexed-Does-fschange-index-files/m-p/12899#M1079</link>
      <description>&lt;P&gt;Thanks, this certainly makes sense.  I do see the fschange events but I was only worried about the text being indexed.  It actually came up when I was demoing the *nix app!!!  &lt;/P&gt;

&lt;P&gt;The weird thing is that it is very sporadic.  My indexers and forwarders pretty much share the same config for the *nix app, but it was only seeing /etc/shadows from 2 of my 3 indexers and none from my forwarders.  Odd.  I will accept the answer if I don't see any events for a while.  I created a saved search to automatically delete these events.&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2010 00:35:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-etc-shadow-being-indexed-Does-fschange-index-files/m-p/12899#M1079</guid>
      <dc:creator>oreoshake</dc:creator>
      <dc:date>2010-05-06T00:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why is /etc/shadow being indexed?  Does fschange index files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-etc-shadow-being-indexed-Does-fschange-index-files/m-p/12900#M1080</link>
      <description>&lt;P&gt;This did not help, /etc/shadow is still showing up &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2010 08:48:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-etc-shadow-being-indexed-Does-fschange-index-files/m-p/12900#M1080</guid>
      <dc:creator>oreoshake</dc:creator>
      <dc:date>2010-05-12T08:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why is /etc/shadow being indexed?  Does fschange index files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-etc-shadow-being-indexed-Does-fschange-index-files/m-p/12901#M1081</link>
      <description>&lt;P&gt;Oreoshake,&lt;/P&gt;

&lt;P&gt;I'm surprised splunk is still reading your shadow file with the config entries given here.  Whether your &lt;CODE&gt;/etc/&lt;/CODE&gt; files are being pulled in via &lt;CODE&gt;monitor&lt;/CODE&gt; or &lt;CODE&gt;fschange&lt;/CODE&gt; input, the given config really should be blocking these files.&lt;/P&gt;

&lt;P&gt;Here is one theory about why this may not be working for you:&lt;/P&gt;

&lt;P&gt;You may want to consider the possibility that some other &lt;CODE&gt;[source::]&lt;/CODE&gt; stanza is matching before the &lt;CODE&gt;ignored_type&lt;/CODE&gt; rules.  Keep in mind that that using wildcards (such as &lt;CODE&gt;*&lt;/CODE&gt;), will lower the priority of a matching stanza, where as a literal path will be given a very high (100) priority.  This can be compensated for with the following:&lt;/P&gt;

&lt;PRE&gt;
[source::/etc/passwd*]
sourcetype = ignored_type
priority = 100

[source::/etc/shadow*]
sourcetype = ignored_type
priority = 100
&lt;/PRE&gt;

&lt;P&gt;I suggest that you open a shell on a machine where you are having this problem.  Log in as, or switch to the user that &lt;CODE&gt;splunkd&lt;/CODE&gt; runs as.  Then issue the following command to see what rules are being used for this file:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;&lt;CODE&gt;splunk test sourcetype /etc/shadow&lt;/CODE&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;You should either see "cannot_read" (if OS permissions prevent access), or the sourcetype should be shown as &lt;CODE&gt;ignored_type&lt;/CODE&gt;.  Otherwise, your file will get indexed.  This should help you track down either a config issue due to priority (which I confirmed that I had this problem on my system too, so that's for asking about this again!!!), or if your config change wasn't deployed properly, or some other config issue.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Unix Admin side note:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;BTW, I assume your running splunk as &lt;CODE&gt;root&lt;/CODE&gt; and not as the default &lt;CODE&gt;splunk&lt;/CODE&gt; user.  Changing that may be the &lt;EM&gt;best&lt;/EM&gt; solution to this.  From an unix admin perspective, I think that &lt;CODE&gt;/etc/passwd&lt;/CODE&gt; needs to be readable by everyone, where as &lt;CODE&gt;/etc/shadow&lt;/CODE&gt; should be pretty much only readable by the root user.  So one suggestion would be to setup splunk to run as a non-privileged user.&lt;/P&gt;

&lt;P&gt;I setup all my log files in &lt;CODE&gt;/var/log/&lt;/CODE&gt; to be readable by the &lt;CODE&gt;adm&lt;/CODE&gt; user and then made splunk a member of that group, and it's worked quite well.  (I do have one system with an older Linux install, and the syslog daemon on that system doesn't let me set user/group permissions on new log files.  So that's a pain.  I have an hourly job that runs a bunch of &lt;CODE&gt;chown&lt;/CODE&gt; and &lt;CODE&gt;chmod&lt;/CODE&gt; commands to get the permissions set properly.)  This does require more initial setup, but it's probably a safer solution, especially if there are ever any security bugs that would allow a malicious user to take control of &lt;CODE&gt;splunkd&lt;/CODE&gt; and run commands as that user.&lt;/P&gt;</description>
      <pubDate>Tue, 18 May 2010 03:13:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-etc-shadow-being-indexed-Does-fschange-index-files/m-p/12901#M1081</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-05-18T03:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why is /etc/shadow being indexed?  Does fschange index files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-etc-shadow-being-indexed-Does-fschange-index-files/m-p/12902#M1082</link>
      <description>&lt;P&gt;For anyone following along wit this issue...  If you do not set &lt;CODE&gt;priority&lt;/CODE&gt; value here, than this solution will not work, as noted in my second answer.     BTW, Splunk support said this would be fixed in 4.1.3, but now it's scheduled to be fixed in 4.1.4.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2010 22:37:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-etc-shadow-being-indexed-Does-fschange-index-files/m-p/12902#M1082</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-06-30T22:37:27Z</dc:date>
    </item>
  </channel>
</rss>

