Bugfix: overzealous data masking rule for US social security numbers #751
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Core Unlocked Package Changes
🐞 Fixed #542 (almost exactly 1 year after it was opened😅) to use a more targeted regular expression for identifying US social security numbers (SSN) to mask. Previously, the rule was not restrictive enough in the regular expression used in
SensitiveDataRegEx__c
, which resulted in the rule masking some values that it should have ignored.For example, logging a message containing a (fake) credit card number like
Here is a value 5000-1111-2222-0005 and it looks like a Mastercard number, so apply the Mastercard masking rule
...Here is a value XXX-XX-1111-2222-0005 and it looks like a Mastercard number, so apply the Mastercard masking rule
Here is a value ****-****-****-0005 and it looks like a Mastercard number, so apply the Mastercard masking rule
🤏 And a little bit of scope creep included:
ComponentLogger
to cache the field map forLogEntryEvent__e
once per transactionv4.14.6
ComponentLogger
would re-call the describe method forLogEntryEvent__e
every time there was a component log entry that was setting 1 or more custom fieldsPipeline Changes
scripts/build/validate-custom-metadata-records.apex
to validate that the regex values inLogEntryDataMaskRule__mdt
work as expected