<?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 Re: Anonymize clear text credentials in Powershell logs using SEDCMD in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Anonymize-clear-text-credentials-in-Powershell-logs-using-SEDCMD/m-p/411293#M72827</link>
    <description>&lt;P&gt;Hi geoffmx,&lt;BR /&gt;
you have work in the same way:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-ps_logs_mask_cred = s/-password\s+.*\s+-Credential\s+.*/-password\sxxxxxx-Credential\sxxxxxx/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 31 Jul 2019 11:00:42 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2019-07-31T11:00:42Z</dc:date>
    <item>
      <title>Anonymize clear text credentials in Powershell logs using SEDCMD</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Anonymize-clear-text-credentials-in-Powershell-logs-using-SEDCMD/m-p/411290#M72824</link>
      <description>&lt;P&gt;I am attempting to anonymize clear-text credentials passed via PowerShell referring to the splunk documentation &lt;BR /&gt;
 to Anonymize_data_with_a_sed_script &lt;/P&gt;

&lt;P&gt;In the  inputs.conf I have...&lt;BR /&gt;
sourcetype = WinEventLog:Microsoft-Windows-PowerShell/Operational&lt;/P&gt;

&lt;P&gt;In props.conf I have... &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[WinEventLog:Microsoft-Windows-PowerShell/Operational]
SEDCMD-ps_logs_mask_cred = s/-ScriptBlock*/xxxxxx/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have attempted to mask just the password and the credential, but could not get it to work. I am able to do this partially via sed or perl on a linux command line, but have not been able to replicate on splunk.&lt;/P&gt;

&lt;P&gt;Sample data&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Invoke-Command -computername somePC -ScriptBlock {get-something -password 'som3_verY-Long_Pa$$w0rd'} -Credential somedomain\someuser
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Expected output (masking the entire ScriptBlock)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Invoke-Command -computername somePC xxxxxx
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or more appropriately, masking only the password and Credential &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Invoke-Command -computername somePC -ScriptBlock {get-something -password 'xxxxxx'} -Credential xxxxxx
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any help will be much appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:28:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Anonymize-clear-text-credentials-in-Powershell-logs-using-SEDCMD/m-p/411290#M72824</guid>
      <dc:creator>geoffmx</dc:creator>
      <dc:date>2020-09-30T01:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Anonymize clear text credentials in Powershell logs using SEDCMD</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Anonymize-clear-text-credentials-in-Powershell-logs-using-SEDCMD/m-p/411291#M72825</link>
      <description>&lt;P&gt;Hi geoffmx,&lt;BR /&gt;
with SEDCMD you replace the regex you have in the first part with the one in the second part, so try something like this in props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-ps_logs_mask_cred = s/-ScriptBlock\s.*/xxxxxx/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 09:32:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Anonymize-clear-text-credentials-in-Powershell-logs-using-SEDCMD/m-p/411291#M72825</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-07-31T09:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Anonymize clear text credentials in Powershell logs using SEDCMD</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Anonymize-clear-text-credentials-in-Powershell-logs-using-SEDCMD/m-p/411292#M72826</link>
      <description>&lt;P&gt;Thanks gcusello! This helps with masking everything after -ScriptBlock. I am also attempting to mask the text just after -password and -Credential.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 10:21:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Anonymize-clear-text-credentials-in-Powershell-logs-using-SEDCMD/m-p/411292#M72826</guid>
      <dc:creator>geoffmx</dc:creator>
      <dc:date>2019-07-31T10:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Anonymize clear text credentials in Powershell logs using SEDCMD</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Anonymize-clear-text-credentials-in-Powershell-logs-using-SEDCMD/m-p/411293#M72827</link>
      <description>&lt;P&gt;Hi geoffmx,&lt;BR /&gt;
you have work in the same way:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-ps_logs_mask_cred = s/-password\s+.*\s+-Credential\s+.*/-password\sxxxxxx-Credential\sxxxxxx/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 11:00:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Anonymize-clear-text-credentials-in-Powershell-logs-using-SEDCMD/m-p/411293#M72827</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-07-31T11:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: Anonymize clear text credentials in Powershell logs using SEDCMD</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Anonymize-clear-text-credentials-in-Powershell-logs-using-SEDCMD/m-p/411294#M72828</link>
      <description>&lt;P&gt;Thanks again!&lt;/P&gt;

&lt;P&gt;I finally got it to work with this. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-ps_logs_mask_cred = s/-password\s[[:alnum:][:punct:]]*/-password xxxxx/g s/-Credential\s[[:alnum:][:punct:]]*/-Credential xxxxx/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I like your method too. Thanks again for pointing me in the right direction.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 11:12:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Anonymize-clear-text-credentials-in-Powershell-logs-using-SEDCMD/m-p/411294#M72828</guid>
      <dc:creator>geoffmx</dc:creator>
      <dc:date>2019-07-31T11:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Anonymize clear text credentials in Powershell logs using SEDCMD</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Anonymize-clear-text-credentials-in-Powershell-logs-using-SEDCMD/m-p/411295#M72829</link>
      <description>&lt;P&gt;Gotta love positional based strategies for masking passwords.  We have something like 200 masking rules which process against every event for sourcetypes where passwords are probable.   Next strat is user education.  Hopefully Stream processor will give more logic control for sensitive data masking.  &lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 02:01:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Anonymize-clear-text-credentials-in-Powershell-logs-using-SEDCMD/m-p/411295#M72829</guid>
      <dc:creator>dstaulcu</dc:creator>
      <dc:date>2019-08-02T02:01:49Z</dc:date>
    </item>
  </channel>
</rss>

