Getting Data In

Anonymize Multiple Data Points in Splunk Search

markhvesta
Path Finder

I am trying to anonymize customer credit card data in splunk logs but when more than one card appears in the same event only one is scrubbed.

transforms on the indexers:

[SEDCMD-anonymizecc]
REGEX =  s/(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})/###SCRUBBED###/g
FORMAT= $1###SCRUBBED###$2
REPEAT_MATCH = true
LOOKAHEAD = 800

Sample event:

2019-08-27 13:31:00,002 -0700 DEBUG -
Sent Message HTTP POST
Elapsed time : 0.007166 (seconds)
ContentType : application/x_www_form_urlencoded
Request : Amount = 528.01
CardNumber = CARDNUMBER
PaymentDeviceOnFileID =
ResponseCode = 0
Request Buffer : Amount=528.01&CardNumber=CARDNUMBER&PaymentDeviceOnFileID=##NULL##
Response Buffer : ResponseCode=0

0 Karma

harsmarvania57
Ultra Champion

Hi,

You can use SEDCMD in props.conf to achieve this easily at Index time, compare to combination of props and transforms.

Please try below config

props.conf

[yourSourcetype]
SEDCMD-Anon = s/(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})/###SCRUBBED###/g
0 Karma

markhvesta
Path Finder

I just tried this and it is only masking the second instance and not the first in the event.

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...