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!

Splunk Enterprise Security 8.0.2 Availability: On cloud and On-premise!

A few months ago, we released Splunk Enterprise Security 8.0 for our cloud customers. Today, we are excited to ...

Logs to Metrics

Logs and Metrics Logs are generally unstructured text or structured events emitted by applications and written ...

Developer Spotlight with Paul Stout

Welcome to our very first developer spotlight release series where we'll feature some awesome Splunk ...