Customize Data Masking and Anonymization
Assist Edge (AE) 18.0 comes with features which helps processes to mask and anonymize any data deemed sensitive. This is done by a Data Masking (DM) and Anonymization framework that is built in the product. The built in DM framework helps process designers to mask data related to Credit Card (CC), Email, SSN, and any string (which falls in the Default category) by using out of the box available masking patterns. The masking patterns for the built-in masking strategy is as follows.
- Credit Card – Masks all but last four digits. E.g., 1334-1234-1234-1234 is masked as xxxx-xxxxx-xxxx-1234
- Email – Masks alternate characters in the email address and masks all of domain name. E.g., sony@gmail.com is masked as sxnx@xxxx.com
- SSN – masks all but last four characters. E.g. - 123-12-1234 is masked as xxx-xx-1234
- Default – masks alternate characters. E.g., Hello, world is masked as Hxlx0x xoxlx. Note: space is treated as a character and is masked as well.
As is the wont of frameworks, DM is flexible enough to add new masking strategies or even modify existing strategy patterns or even to replace the masking character (‘x’). Here is a guide how to go about implementing custom masking framework.
Customize Data Masking by Implementing the Interface
DM in AE is implemented using an interface IDataMaskAdapter. The library that implements this is placed in \\Plugins\DataMasking\ folder. This is applicable to Studio, EPA and robot. Customized library needs to do the same. Implement the interface and replace existing library in the above-mentioned folder.
To implement custom DM, implement the IDataMaskAdapter available in Utilities.Interface library. A reference to MaskingPattern object available in Utilities.Models.Studio also needs to be added.
Find attached an implementation of the above interface.
Customize Data Masking Extending the Existing Implementation
Class diagram of the default implementation. The file attached in section 24.1 contains this implementation.
Inherit DataMaskAdapter and override existing properties/methods to extend the custom implementation. Add new strategies to _dataMaskStrategies and masking patterns to _maskingPatterns dictionaries. Call the new implementations from the Mask method. Custom written newer strategies need not follow the existing approach where they implement IMask interface.
Find a sample attached which adds a new Phone Number masking to the existing strategies.
NOTE: |
Before replacing the existing library, move it into another folder outside plugins. This way application will be able to load modified as well as existing masking patterns. Similar thing needs to be done on the robot side as well. |
Customize Anonymization by Implementing the Interface
Data anonymization in AE is implemented using an interface IDataAnonymizer. The library that implements this is placed in \\Plugins\ DataAnonymizer\ folder. This is applicable to AutomationStudio, EPA and robot. Customized library needs to do the same. Implement the interface and replace existing library in the above-mentioned folder. The library shipped anonymizes the input using SHA512 algorithm.
To implement custom Data Anonymization, implement the IDataAnonymizer available in Utilities.Interface library.