<?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 Masking Sensitive Data in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Masking-Sensitive-Data/m-p/123439#M33317</link>
    <description>&lt;P&gt;Ok Splunkers......&lt;/P&gt;

&lt;P&gt;I have 1 search-head, 2 indexers, 1 Deployment server&lt;/P&gt;

&lt;P&gt;Here is the event (sourcetype=mysourcetype)that I want to mask out the CC number:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2014-06-01 00:01:34 W3SVC1 10.0.99.120 GET /Disputes/BackToMYDomain.aspx ID=183481&amp;amp;ClaimNum=05/31-1370&amp;amp;DType=DMC&amp;amp;DClass=Debit%20Fraud&amp;amp;DeptExt=1234&amp;amp;**Card=1234567891234567**&amp;amp;SubmitDate=5/31/2014&amp;amp;samedayptr=N&amp;amp;CrdHolder=JOHN+DOE&amp;amp;TotClaim=150.00&amp;amp;Action=REVPC80MyDomain\mmouse10.XX.XX.XXMozilla/4.0+compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/5.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+Media+Center+PC+6.0;+.NET4.0C;+.NET4.0E;+InfoPath.3) 200 0 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have the following props &amp;amp; Transforms in my Splunk_HOME/etc/system/local/directory:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;props.conf:
[sourcetype]
TRANSFORMS-1card = cc_num_anon

Transforms.conf:
[cc_num_anon]
REGEX = (.*CARD=)\d{12}(\d{4}.*)
DEST_KEY = _raw
FORMAT = $1xxxxxxxxxxxx$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I ran the debug mode, reloaded the forwarders....but Im still seeing the card information.....Oh I forgot to mention that the variable changes from Card/CARD within the event.&lt;/P&gt;</description>
    <pubDate>Fri, 30 Jan 2015 20:33:47 GMT</pubDate>
    <dc:creator>dperry</dc:creator>
    <dc:date>2015-01-30T20:33:47Z</dc:date>
    <item>
      <title>Masking Sensitive Data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Masking-Sensitive-Data/m-p/123439#M33317</link>
      <description>&lt;P&gt;Ok Splunkers......&lt;/P&gt;

&lt;P&gt;I have 1 search-head, 2 indexers, 1 Deployment server&lt;/P&gt;

&lt;P&gt;Here is the event (sourcetype=mysourcetype)that I want to mask out the CC number:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2014-06-01 00:01:34 W3SVC1 10.0.99.120 GET /Disputes/BackToMYDomain.aspx ID=183481&amp;amp;ClaimNum=05/31-1370&amp;amp;DType=DMC&amp;amp;DClass=Debit%20Fraud&amp;amp;DeptExt=1234&amp;amp;**Card=1234567891234567**&amp;amp;SubmitDate=5/31/2014&amp;amp;samedayptr=N&amp;amp;CrdHolder=JOHN+DOE&amp;amp;TotClaim=150.00&amp;amp;Action=REVPC80MyDomain\mmouse10.XX.XX.XXMozilla/4.0+compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/5.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+Media+Center+PC+6.0;+.NET4.0C;+.NET4.0E;+InfoPath.3) 200 0 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have the following props &amp;amp; Transforms in my Splunk_HOME/etc/system/local/directory:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;props.conf:
[sourcetype]
TRANSFORMS-1card = cc_num_anon

Transforms.conf:
[cc_num_anon]
REGEX = (.*CARD=)\d{12}(\d{4}.*)
DEST_KEY = _raw
FORMAT = $1xxxxxxxxxxxx$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I ran the debug mode, reloaded the forwarders....but Im still seeing the card information.....Oh I forgot to mention that the variable changes from Card/CARD within the event.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2015 20:33:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Masking-Sensitive-Data/m-p/123439#M33317</guid>
      <dc:creator>dperry</dc:creator>
      <dc:date>2015-01-30T20:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Masking Sensitive Data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Masking-Sensitive-Data/m-p/123440#M33318</link>
      <description>&lt;P&gt;Normally, such masking will happen at parse time on the indexer, so just to be clear, these configs are on the indexers, correct?&lt;/P&gt;

&lt;P&gt;A few things strike me as off about your regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = (.CARD=)d{12}(d{4}.)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am not sure about the dots at the beginning and end, case is not matching your data either, also the character types don't have backslashes. So, to me this looks a little better:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = (Card=)\d{12}(\d{4})
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also note that this will only apply to newly indexed data once the transform is in place.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2015 21:17:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Masking-Sensitive-Data/m-p/123440#M33318</guid>
      <dc:creator>chanfoli</dc:creator>
      <dc:date>2015-01-30T21:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Masking Sensitive Data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Masking-Sensitive-Data/m-p/123441#M33319</link>
      <description>&lt;P&gt;See updated answer.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2015 21:29:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Masking-Sensitive-Data/m-p/123441#M33319</guid>
      <dc:creator>chanfoli</dc:creator>
      <dc:date>2015-01-30T21:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Masking Sensitive Data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Masking-Sensitive-Data/m-p/123442#M33320</link>
      <description>&lt;P&gt;Try this props.conf-only solution that honours the variable case:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sourcetype]
SEDCMD-cc = s/(?i)(card=)\d{12}(\d{4})/\1xxxxxxxxxxxx\2/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should also run considerably faster because a leading &lt;CODE&gt;.*&lt;/CODE&gt; in a regex will eat your server's soul.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2015 22:21:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Masking-Sensitive-Data/m-p/123442#M33320</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-01-30T22:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Masking Sensitive Data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Masking-Sensitive-Data/m-p/123443#M33321</link>
      <description>&lt;P&gt;Silly question...when you say add to the props.conf...this is on the indexers, correct?&lt;/P&gt;

&lt;P&gt;Indexer&lt;BR /&gt;
Splunk_HOME/etc/system/local&lt;/P&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;P&gt;The deployment server in Deployment apps (the app) local folder.&lt;/P&gt;</description>
      <pubDate>Sat, 31 Jan 2015 03:24:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Masking-Sensitive-Data/m-p/123443#M33321</guid>
      <dc:creator>dperry</dc:creator>
      <dc:date>2015-01-31T03:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Masking Sensitive Data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Masking-Sensitive-Data/m-p/123444#M33322</link>
      <description>&lt;P&gt;So Im having  a different scenario since I added the SEDCMD to the indexer local props.conf:&lt;/P&gt;

&lt;P&gt;Right output: (IT WORKS)&lt;/P&gt;

&lt;P&gt;2015-01-31 03:58:10 W3SVC1 10.XX.XX.XX GET /Disputes/BackTohost.aspx ID=222888&amp;amp;ShID=70&amp;amp;&lt;BR /&gt;
Choice=Fraud&amp;amp;&lt;STRONG&gt;CARD=xxxxxxxxxxxx5144&lt;/STRONG&gt;&amp;amp;DType=DEBIT&amp;amp;ACode=W&amp;amp;SCode=G&amp;amp;AmtFr=&amp;amp;AmtTo=&amp;amp;DtFr=01/29/2015&amp;amp;DtTo=01/30/2015&amp;amp;CCIssued=&amp;amp;&lt;BR /&gt;
Action=History 80 MyDomain\mmouse 10.XX.XX.XX Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/5.0;+SLCC2;&lt;BR /&gt;
+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+Media+Center+PC+6.0;+.NET4.0C;+.NET4.0E;+InfoPath.3) 200 0 0&lt;/P&gt;

&lt;P&gt;Then I get a different output from the same sourcetype: (Its not changing the Card=, but adding an end output)&lt;/P&gt;

&lt;P&gt;2015-01-30 20:33:52 W3SVC1 10.XX.XX.XX GET /Disputes/BackTohost.aspx ID=222796&amp;amp;&lt;BR /&gt;
ShID=ALL%20SHARES&amp;amp;Choice=Fraud&amp;amp;CARD=1234567891234567&amp;amp;DType=DEBIT&amp;amp;ACode=W&amp;amp;SCode=G&amp;amp;AmtFr=&amp;amp;AmtTo=&amp;amp;DtFr=&amp;amp;DtTo=&amp;amp;&lt;BR /&gt;
CCIssued=&amp;amp;Action=History 80 MyDoamin\mmouse 10.XX.XX.XX Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/5.0;&lt;BR /&gt;
+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+Media+Center+PC+6.0;+.NET4.0C;+.NET4.0E) 200 0 &lt;STRONG&gt;0xxxxxxxxxxxx$2&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;The the second event it applying the numbers 0xxxxxxxxxxxx$2&lt;/P&gt;

&lt;P&gt;Is this because the event is different in word count?&lt;/P&gt;</description>
      <pubDate>Sat, 31 Jan 2015 04:41:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Masking-Sensitive-Data/m-p/123444#M33322</guid>
      <dc:creator>dperry</dc:creator>
      <dc:date>2015-01-31T04:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Masking Sensitive Data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Masking-Sensitive-Data/m-p/123445#M33323</link>
      <description>&lt;P&gt;This config belongs on the indexers. If you have heavy forwarders that perform parsing then you will need it there as well.&lt;/P&gt;

&lt;P&gt;The second event is several hours older, it was indexed before the SEDCMD was applied. I'm sure of this because there is &lt;CODE&gt;$2&lt;/CODE&gt; at the end, and there is no dollar sign used in the SEDCMD.&lt;/P&gt;</description>
      <pubDate>Sat, 31 Jan 2015 12:45:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Masking-Sensitive-Data/m-p/123445#M33323</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-01-31T12:45:20Z</dc:date>
    </item>
  </channel>
</rss>

