Splunk Search

Mask sensitive info with SEDCMD

geoffmoraes
Path Finder

I am attempting to mask sensitive information using SEDCMD. However, it does not seem to take effect.

I've run btool, but am not sure what to make of the output. It does not seem like an issue with splunk conf file precedence.

 

%SPLUNK_HOME%\bin> .\splunk.exe btool props --app=my_app list --debug 
%SPLUNK_HOME%\etc\apps\my_app\local\props.conf SEDCMD-cred_mask1 = s/-varPass\s(.+?)\;/xxxxxxxx/g
%SPLUNK_HOME%\etc\apps\my_app\local\props.conf SEDCMD-cred_mask2 = s/-sensitivePass=(.+)/xxxxxxxx/g

 

 

Running a search with rex in sed mode with the same regex works as expected.

 

<base search>
| rex field=Process_Command_Line mode=sed "s/-varPass\s(.+?)\;/xxxxxxxx/g" 
| rex field=Process_Command_Line mode=sed "s/--sensitivePass=(.+)/xxxxxxxx/g" 
| table _time host source Process_Command_Line

 

 

Tags (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @geoffmoraes,

where did you configured props.conf with SEDCMD?

it should be on Indexers or (when present) on heavy Forwarders.

In addition, put a backslash before "=" because it's a special char (but it shouldn't be the problem!).

Ciao.

Giuseppe

0 Karma

geoffmoraes
Path Finder

@gcusello This is configured on a Heavy Forwarder.

Thanks! I've added the \ for =. I overlooked it as it worked with rex in the search query. 

But like you said, that isn't the problem. Still no effect on masking newly indexed data.

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @geoffmoraes,

some stupid questions:

  • SEDCMD is for the correct sourcetype?
  • did you tried to put both on HF and Ind?
  • did you restarted HF?

Ciao.

Giuseppe

0 Karma

geoffmoraes
Path Finder

@gcusello 

Perfectly valid questions 🙂

  • SEDCMD is for the correct sourcetype? - I think this may be relevant. There was an upgrade on some of the TA's recently. The previous winevent sourcetypes are now the "source". So I think I may need to change the stanza to [source::my_winevent_source] in props.conf

 

  • did you tried to put both on HF and Ind? - No, this is just on the HF where it also indexes the data

 

  • did you restarted HF? - Yes 
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...