Question
Bank of America NA
IN
Last activity: 13 Aug 2024 3:38 EDT
How to mask account number entered in text area
We have a requirement to mask the account number entered on Comments which is an text area property. There is no specific format as it is Comments entered by the user. We need to find out whether account number entered or not in comments and if yes need to mask that with only showing last 4 digits. Account number may have more than 9 digits.
For eg: in comments if the user entered like this "act no for Case ID 01 1234567789"
Result should be: act no for Case ID 01 ******7789
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 13 Aug 2024 3:38 EDT
Bank of America NA
IN
@Prabakaran.SWe used Regex function as follows,
On change event of the text field, we have configured the activity. In which we checked the when condition as follows,
@pxContainsViaRegex(.Notes,@getDataSystemSetting("PQSol","AccountNumMasking"),true)
Where Notes is the text property
On the DSS we specified the string to match i.e.,accountt*|Accountt*|Acctt*|acctt*|ACCOUNTT*
If the Notes contains any of the words specified in the DSS then it execute the following property-set where we used other Regex function to mask
@pxReplaceAllViaRegex(Param.Notes,"[0-9]{9,10}","**********")
[0-9] numbers to consider
{9,10} length of the numbers
This function will check if Notes contains 9 to 10 length numbers it will replace with 10 asterisk.
Example: In Notes we have, The account number for xyz person is 12345678921234.
Output: The account number for xyz person is **********1234.
Maantic Inc
IN
I think it has to be handled via Access Control Policy. Please go through the below link, there's a portion provided for masking each type of char input:
https://docs-previous.pega.com/security/87/masking-property-visibility-users?
Bank of America NA
IN
@SohamM95 Thank You for your response.
I have gone through the Access Control policy, But it can be helpful if we know the exact characters to be masked . For us the we are not sure the length of characters users will enter as it is an Comments and We need to mask only if the user enter the Account number in it. So not always we will mask this Comments, we need to mask only if the user enters account number in it, also there ay be some other text also present with this account number in the comments.
Cyient Ltd
IN
Hi @Umamageswari G , Pega provides OOTB function @GenerateMaskedString(Param.AccountNumber). It does not depend on string size. It will masked all except last 4 digits. If the input string is "2131232199" then it will return "******2199" as output String. Function java code is ->
Input Parameter : Name - Str / Java type - String
Output : Java data type - String Classification : Usage type - Output formating
_______________________ //Generate String masked with * except last 4 digit. if (Str!=null && Str.length() > 4) { return Str.replaceAll("\\w(?=\\w{4})", "*"); } return Str; ---------------------
Bank of America NA
IN
@SaurabhJ7402 Thank you so much for your response. But in our requirement we are not passing the account number, we are passing the comments which user entered. It will be like 2 to 3 lines of paragraph, in between there comments their might be account number which needs to be masked.
Also I'm not able to find GenerateMaskedString function in 8.8.1 version.
Pegasystems Inc.
GB
@Umamageswari G In Pega 8.8.1, you can use the pxGetMaskedValue_Text function to mask an account number in a text property.
This function takes several parameters including the string property to be masked, the restriction method, the number of unmasked characters, and the masking character. For example, if you want to mask the first 6 characters of a 10-digit account number and display only the last 4, you can use a call like this: @pxGetMaskedValue_Text(local.instring,\"LastN\",4,\"\",0,\"X\"). Here, local.instring is set to the account number before calling the function.
⚠ This is a GenAI-powered tool. All generated answers require validation against the provided references.
Usage of pxGetMaskedValue_Text
Is there any way to achieve partial - Obfuscated
Masking sensitive data for use with AI > Process of applying the masking Rule an
Masking property visibility for users
@Umamageswari G In Pega 8.8.1, you can use the pxGetMaskedValue_Text function to mask an account number in a text property.
This function takes several parameters including the string property to be masked, the restriction method, the number of unmasked characters, and the masking character. For example, if you want to mask the first 6 characters of a 10-digit account number and display only the last 4, you can use a call like this: @pxGetMaskedValue_Text(local.instring,\"LastN\",4,\"\",0,\"X\"). Here, local.instring is set to the account number before calling the function.
⚠ This is a GenAI-powered tool. All generated answers require validation against the provided references.
Usage of pxGetMaskedValue_Text
Is there any way to achieve partial - Obfuscated
Masking sensitive data for use with AI > Process of applying the masking Rule an
Masking property visibility for users
Adding and enabling data masking
Masking sensitive data for use with AI
Eclatprime Digital Private Limited
AU
Hi @Umamageswari G,
You can use Edit input in the "Comment property" under Advanced tab,where you can write java code for your requirement.
Cognizant
US
@Umamageswari G Looking for a similar use case, pls post if you have found something related to this.
Accepted Solution
Updated: 13 Aug 2024 3:38 EDT
Bank of America NA
IN
@Prabakaran.SWe used Regex function as follows,
On change event of the text field, we have configured the activity. In which we checked the when condition as follows,
@pxContainsViaRegex(.Notes,@getDataSystemSetting("PQSol","AccountNumMasking"),true)
Where Notes is the text property
On the DSS we specified the string to match i.e.,accountt*|Accountt*|Acctt*|acctt*|ACCOUNTT*
If the Notes contains any of the words specified in the DSS then it execute the following property-set where we used other Regex function to mask
@pxReplaceAllViaRegex(Param.Notes,"[0-9]{9,10}","**********")
[0-9] numbers to consider
{9,10} length of the numbers
This function will check if Notes contains 9 to 10 length numbers it will replace with 10 asterisk.
Example: In Notes we have, The account number for xyz person is 12345678921234.
Output: The account number for xyz person is **********1234.
Cognizant
US
@Umamageswari G Thank you so much, this helps a lot.
This solution will mask all the 9 to 10 numbers in the notes right. Lets say, if a reference number also is entered with account number in the notes, even the reference number will be masked.
Cognizant
US
@Umamageswari G thank you, it helps a lot.
In above use case, it will mask any numbers of length 9 to10 and it could be a Case Ref No if the user post it as part of the notes along with the account number right ?
Bank of America NA
IN
@Prabakaran.S Yes. The above regex function will just mask any number of length 9 to 10 as per our specification. We can specify any length range in the function as per requirement.
Cognizant
US
@Umamageswari G Thank you for the reponse, it helps a lot.