<?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>post Masking Sensitive PII data (aka SSN) in ServiceNow Fields in ITSM articles</title>
    <link>https://www.servicenow.com/community/itsm-articles/masking-sensitive-pii-data-aka-ssn-in-servicenow-fields/ta-p/2302829</link>
    <description>&lt;P&gt;I recently had a customer that wanted to make sure that PII data like SSN and Acct number was masked or more specifically removed from the Incident Description field in ServiceNow. &amp;nbsp; I looked at using "Field Normalization &amp;gt; Transformations" rules to use regex expressions to mask this but ran into issue where it was only masking the first occurrence of the pattern when that pattern occurred multiple times in the description field. See example data below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14938478924082241 jive_text_macro" data-renderedposition="92_8_1192_96" jivemacro_uid="_14938478924082241" modifiedtitle="true"&gt;&lt;P&gt;Joe 305-44-5678 3456-2345-2342-2345&lt;/P&gt;&lt;P&gt;Jimmy 306-66-3345 2345-2345-1234-1235&lt;/P&gt;&lt;P&gt;Joe 305-44-5678 3456-2345-2342-2345&lt;/P&gt;&lt;P&gt;Jimmy 306-66-3345 2345-2345-1234-1235&lt;/P&gt;&lt;P&gt;Joe 305-44-5678 3456-2345-2342-2345&lt;/P&gt;&lt;P&gt;Jimmy 306-66-3345 2345-2345-1234-1235&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe this is a bug and will update this entry of my findings, but to solve the customer's problem I created two simple business rules that use the SN Regex API to do the masking for me. Here is the setup:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Created Business Rule for SSN Masking. This rule they just wanted SSN when found to be replaced by ###-##-#### so they knew SSN was found and removed.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Name = Mask SSN in Incident Description&lt;/LI&gt;&lt;LI&gt;Table = Incident&lt;/LI&gt;&lt;LI&gt;When = Before (Insert or Update)&lt;/LI&gt;&lt;LI&gt;Click Advanced - Here is the script&lt;/LI&gt;&lt;/UL&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="_jivemacro_uid_14938482563714642 jive_macro_code jive_text_macro" data-renderedposition="390.984375_8_1192_96" jivemacro_uid="_14938482563714642"&gt;&lt;P style="padding-left: 60px;"&gt;(function executeRule(current, previous /*null when async*/) {&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/P&gt;&lt;P style="padding-left: 30px;"&gt; &amp;nbsp; var rgx = new SNC.Regex('/\[0-9]{3}-\[0-9]{2}-\[0-9]{4}/');&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt; &amp;nbsp; var result = current.description;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt; &amp;nbsp; current.description = rgx.replaceAll(result,"###-##-####");&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;})(current, previous);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Created Business Rule for Acct # Masking. &amp;nbsp; This rule they had a requirement where there account numbers all start 45673 and then can contain any number of digits afterwards. &amp;nbsp; The business rule below removes account number where it finds it and replaces it with "45673..." denoting that account number was found and removed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the business rule for that masking&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Name = Mask Acct Number in Incident Description&lt;/LI&gt;&lt;LI&gt;Table = Incident&lt;/LI&gt;&lt;LI&gt;When = Before (Insert or Update)&lt;/LI&gt;&lt;LI&gt;Click Advanced Checkbox - Here is the script&lt;/LI&gt;&lt;/UL&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14938484554597062" data-renderedposition="689.96875_8_1192_80" jivemacro_uid="_14938484554597062" modifiedtitle="true"&gt;&lt;P&gt;(function executeRule(current, previous /*null when async*/) { &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; var rgx = new SNC.Regex('/45673[0-9]*/');&lt;/P&gt;&lt;P&gt; &amp;nbsp; var result = current.description;&lt;/P&gt;&lt;P&gt; &amp;nbsp; current.description = rgx.replaceAll(result,"45673...");&lt;/P&gt;&lt;P&gt;})(current, previous);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once these are activated, I tested on a number of data runs to make sure that if multiple patterns were found of each type they would be handled through all occurrences. Below is an example of data I used to test.&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14938488268309837 jive_text_macro" data-renderedposition="832.96875_8_1192_144" jivemacro_uid="_14938488268309837"&gt;&lt;P&gt;Joe 305-44-5678 3456-2345-2342-2345&lt;/P&gt;&lt;P&gt;Jimmy 306-66-3345 2345-2345-1234-1235&lt;/P&gt;&lt;P&gt;Joe 305-44-5678 3456-2345-2342-2345&lt;/P&gt;&lt;P&gt;Jimmy 306-66-3345 2345-2345-1234-1235&lt;/P&gt;&lt;P&gt;Joe 305-44-5678 3456-2345-2342-2345&lt;/P&gt;&lt;P&gt;Jimmy 306-66-3345 2345-2345-1234-1235&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;45673234238282 some more test&lt;/P&gt;&lt;P&gt;some test 45673678997 some more text&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the output of data when removed:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14938494222868874 jive_text_macro" data-renderedposition="1018.96875_8_1192_144" jivemacro_uid="_14938494222868874"&gt;&lt;P&gt;Joe ###-##-#### 3456-2345-2342-2345&lt;/P&gt;&lt;P&gt;Jimmy ###-##-#### 2345-2345-1234-1235&lt;/P&gt;&lt;P&gt;Joe ###-##-#### 3456-2345-2342-2345&lt;/P&gt;&lt;P&gt;Jimmy ###-##-#### 2345-2345-1234-1235&lt;/P&gt;&lt;P&gt;Joe ###-##-#### 3456-2345-2342-2345&lt;/P&gt;&lt;P&gt;Jimmy ###-##-#### 2345-2345-1234-1235&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;45673... some more test&lt;/P&gt;&lt;P&gt;some test 45673... some more text&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lastly, I wanted to provide link to documentation and sites that helped me put this together:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. First is documentation on the SN Regex API: &lt;A href="http://wiki.servicenow.com/index.php?title=SNC_Regex_API#gsc.tab=0" title="http://wiki.servicenow.com/index.php?title=SNC_Regex_API#gsc.tab=0"&gt;SNC Regex API - ServiceNow Wiki&lt;/A&gt; &lt;/P&gt;&lt;P&gt;2. In figuring out the regular expression I always use &lt;A href="https://regex101.com/" title="https://regex101.com/"&gt;https://regex101.com/&lt;BR /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This was a quick and easy solution, but I didn't see alot of topics on this subject, so I thought I would share. &amp;nbsp; Feedback &amp;amp; Comments on usefulness or better ways to do this are always appreciated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Enjoy!&lt;/P&gt;</description>
    <pubDate>Wed, 03 May 2017 22:11:35 GMT</pubDate>
    <dc:creator>joe_steinfeld</dc:creator>
    <dc:date>2017-05-03T22:11:35Z</dc:date>
    <item>
      <title>Masking Sensitive PII data (aka SSN) in ServiceNow Fields</title>
      <link>https://www.servicenow.com/community/itsm-articles/masking-sensitive-pii-data-aka-ssn-in-servicenow-fields/ta-p/2302829</link>
      <description>&lt;P&gt;I recently had a customer that wanted to make sure that PII data like SSN and Acct number was masked or more specifically removed from the Incident Description field in ServiceNow. &amp;nbsp; I looked at using "Field Normalization &amp;gt; Transformations" rules to use regex expressions to mask this but ran into issue where it was only masking the first occurrence of the pattern when that pattern occurred multiple times in the description field. See example data below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14938478924082241 jive_text_macro" data-renderedposition="92_8_1192_96" jivemacro_uid="_14938478924082241" modifiedtitle="true"&gt;&lt;P&gt;Joe 305-44-5678 3456-2345-2342-2345&lt;/P&gt;&lt;P&gt;Jimmy 306-66-3345 2345-2345-1234-1235&lt;/P&gt;&lt;P&gt;Joe 305-44-5678 3456-2345-2342-2345&lt;/P&gt;&lt;P&gt;Jimmy 306-66-3345 2345-2345-1234-1235&lt;/P&gt;&lt;P&gt;Joe 305-44-5678 3456-2345-2342-2345&lt;/P&gt;&lt;P&gt;Jimmy 306-66-3345 2345-2345-1234-1235&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe this is a bug and will update this entry of my findings, but to solve the customer's problem I created two simple business rules that use the SN Regex API to do the masking for me. Here is the setup:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Created Business Rule for SSN Masking. This rule they just wanted SSN when found to be replaced by ###-##-#### so they knew SSN was found and removed.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Name = Mask SSN in Incident Description&lt;/LI&gt;&lt;LI&gt;Table = Incident&lt;/LI&gt;&lt;LI&gt;When = Before (Insert or Update)&lt;/LI&gt;&lt;LI&gt;Click Advanced - Here is the script&lt;/LI&gt;&lt;/UL&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="_jivemacro_uid_14938482563714642 jive_macro_code jive_text_macro" data-renderedposition="390.984375_8_1192_96" jivemacro_uid="_14938482563714642"&gt;&lt;P style="padding-left: 60px;"&gt;(function executeRule(current, previous /*null when async*/) {&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/P&gt;&lt;P style="padding-left: 30px;"&gt; &amp;nbsp; var rgx = new SNC.Regex('/\[0-9]{3}-\[0-9]{2}-\[0-9]{4}/');&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt; &amp;nbsp; var result = current.description;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt; &amp;nbsp; current.description = rgx.replaceAll(result,"###-##-####");&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;})(current, previous);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Created Business Rule for Acct # Masking. &amp;nbsp; This rule they had a requirement where there account numbers all start 45673 and then can contain any number of digits afterwards. &amp;nbsp; The business rule below removes account number where it finds it and replaces it with "45673..." denoting that account number was found and removed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the business rule for that masking&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Name = Mask Acct Number in Incident Description&lt;/LI&gt;&lt;LI&gt;Table = Incident&lt;/LI&gt;&lt;LI&gt;When = Before (Insert or Update)&lt;/LI&gt;&lt;LI&gt;Click Advanced Checkbox - Here is the script&lt;/LI&gt;&lt;/UL&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14938484554597062" data-renderedposition="689.96875_8_1192_80" jivemacro_uid="_14938484554597062" modifiedtitle="true"&gt;&lt;P&gt;(function executeRule(current, previous /*null when async*/) { &amp;nbsp; &lt;/P&gt;&lt;P&gt; &amp;nbsp; var rgx = new SNC.Regex('/45673[0-9]*/');&lt;/P&gt;&lt;P&gt; &amp;nbsp; var result = current.description;&lt;/P&gt;&lt;P&gt; &amp;nbsp; current.description = rgx.replaceAll(result,"45673...");&lt;/P&gt;&lt;P&gt;})(current, previous);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once these are activated, I tested on a number of data runs to make sure that if multiple patterns were found of each type they would be handled through all occurrences. Below is an example of data I used to test.&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14938488268309837 jive_text_macro" data-renderedposition="832.96875_8_1192_144" jivemacro_uid="_14938488268309837"&gt;&lt;P&gt;Joe 305-44-5678 3456-2345-2342-2345&lt;/P&gt;&lt;P&gt;Jimmy 306-66-3345 2345-2345-1234-1235&lt;/P&gt;&lt;P&gt;Joe 305-44-5678 3456-2345-2342-2345&lt;/P&gt;&lt;P&gt;Jimmy 306-66-3345 2345-2345-1234-1235&lt;/P&gt;&lt;P&gt;Joe 305-44-5678 3456-2345-2342-2345&lt;/P&gt;&lt;P&gt;Jimmy 306-66-3345 2345-2345-1234-1235&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;45673234238282 some more test&lt;/P&gt;&lt;P&gt;some test 45673678997 some more text&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the output of data when removed:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14938494222868874 jive_text_macro" data-renderedposition="1018.96875_8_1192_144" jivemacro_uid="_14938494222868874"&gt;&lt;P&gt;Joe ###-##-#### 3456-2345-2342-2345&lt;/P&gt;&lt;P&gt;Jimmy ###-##-#### 2345-2345-1234-1235&lt;/P&gt;&lt;P&gt;Joe ###-##-#### 3456-2345-2342-2345&lt;/P&gt;&lt;P&gt;Jimmy ###-##-#### 2345-2345-1234-1235&lt;/P&gt;&lt;P&gt;Joe ###-##-#### 3456-2345-2342-2345&lt;/P&gt;&lt;P&gt;Jimmy ###-##-#### 2345-2345-1234-1235&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;45673... some more test&lt;/P&gt;&lt;P&gt;some test 45673... some more text&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lastly, I wanted to provide link to documentation and sites that helped me put this together:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. First is documentation on the SN Regex API: &lt;A href="http://wiki.servicenow.com/index.php?title=SNC_Regex_API#gsc.tab=0" title="http://wiki.servicenow.com/index.php?title=SNC_Regex_API#gsc.tab=0"&gt;SNC Regex API - ServiceNow Wiki&lt;/A&gt; &lt;/P&gt;&lt;P&gt;2. In figuring out the regular expression I always use &lt;A href="https://regex101.com/" title="https://regex101.com/"&gt;https://regex101.com/&lt;BR /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This was a quick and easy solution, but I didn't see alot of topics on this subject, so I thought I would share. &amp;nbsp; Feedback &amp;amp; Comments on usefulness or better ways to do this are always appreciated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Enjoy!&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 22:11:35 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-articles/masking-sensitive-pii-data-aka-ssn-in-servicenow-fields/ta-p/2302829</guid>
      <dc:creator>joe_steinfeld</dc:creator>
      <dc:date>2017-05-03T22:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: Masking Sensitive PII data (aka SSN) in ServiceNow Fields</title>
      <link>https://www.servicenow.com/community/itsm-articles/masking-sensitive-pii-data-aka-ssn-in-servicenow-fields/tac-p/2302830#M381</link>
      <description>&lt;P&gt;This is great. &amp;nbsp; We need to do the same thing. &amp;nbsp; I assume this only works on new Incidents. &amp;nbsp; Were you able to run something similar to mask data already in your instance?&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Jan 2018 17:50:10 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-articles/masking-sensitive-pii-data-aka-ssn-in-servicenow-fields/tac-p/2302830#M381</guid>
      <dc:creator>marionclemens</dc:creator>
      <dc:date>2018-01-08T17:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Masking Sensitive PII data (aka SSN) in ServiceNow Fields</title>
      <link>https://www.servicenow.com/community/itsm-articles/masking-sensitive-pii-data-aka-ssn-in-servicenow-fields/tac-p/2302831#M382</link>
      <description>&lt;P&gt;Have you any time tried for Password Masking?&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 13:14:26 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-articles/masking-sensitive-pii-data-aka-ssn-in-servicenow-fields/tac-p/2302831#M382</guid>
      <dc:creator>Jayaragavan</dc:creator>
      <dc:date>2019-05-03T13:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: Masking Sensitive PII data (aka SSN) in ServiceNow Fields</title>
      <link>https://www.servicenow.com/community/itsm-articles/masking-sensitive-pii-data-aka-ssn-in-servicenow-fields/tac-p/2961471#M2448</link>
      <description>&lt;P&gt;Hi Joe!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using your BR, the result a replacement of the original value and now has "###-##-####" for the SSAN.&amp;nbsp; &amp;nbsp;Our Use Case is to retain the original value BUT only display the last 4.&amp;nbsp; &amp;nbsp; Did your solution mean to replace the value or show another value?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have 2 fields, original (SSAN3 would behidden and viewable field SSAN with last 4 displayed, prefaced with ###-##-&lt;/P&gt;
&lt;P&gt;I used the Advanced View--&amp;gt;Calculated Value for the field we're displaying&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thoughts about another more scalable or sustainable method?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sharpy2_0-1718226809247.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/364582iC6B5D8255827BEA3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sharpy2_0-1718226809247.png" alt="Sharpy2_0-1718226809247.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sharpy2_1-1718226851971.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/364583iE613606AC8E2F647/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sharpy2_1-1718226851971.png" alt="Sharpy2_1-1718226851971.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Password 1 type can't be reversed.&lt;/P&gt;
&lt;P&gt;Password2 type can be extrapolated but only shows ******&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 21:15:36 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-articles/masking-sensitive-pii-data-aka-ssn-in-servicenow-fields/tac-p/2961471#M2448</guid>
      <dc:creator>Sharpy2</dc:creator>
      <dc:date>2024-06-12T21:15:36Z</dc:date>
    </item>
  </channel>
</rss>

