Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LogEntryEventBuilder: Apply Data Masking to HttpRequestEndpoint__c, possibly provide "requestEndpointMasked" flag #781

Open
dturkel opened this issue Oct 14, 2024 · 3 comments
Labels
Feature: Data Masking Layer: Logger Engine Items related to the core logging engine Logging Source: Apex Items related to using Logger within Apex Logging Source: Lightning Components Items related to using Nebula Logger using JavaScript within lightning components (lwc & aura) Type: Enhancement New feature or request

Comments

@dturkel
Copy link

dturkel commented Oct 14, 2024

New Feature Summary

Some APIs require keys and other sensitive information in the GET endpoint; Data Masking rules should be applied to protect this information:

In LogEntryEventBuilder.setHttpRequestDetails:

Instead of
this.logEntryEvent.HttpRequestEndpoint__c = request.getEndpoint();

Do:
this.logEntryEvent.HttpRequestEndpoint__c = applyDataMaskRules(this.userSettings.IsDataMaskingEnabled__c, request.getEndpoint());

@dturkel dturkel added the Type: Enhancement New feature or request label Oct 14, 2024
@jongpie
Copy link
Owner

jongpie commented Oct 15, 2024

@dturkel this is a great idea, thanks for the suggestion! Any chance you have an example you could provide of a (fake) endpoint + data masking rule that you'd want to apply to the endpoint? If so, I can use that info as a test to ensure this works.

And I could also see extending data masking to be applied to a few other fields:

  • Browser Context fields:
    • BrowserAddress__c: this could maaaaybe contain some sensitive parameters?
  • HTTP Request fields:
  • HTTP Response fields:
    • HttpRequestHeaders__c: when populated, this contains header keys and values, which could be sensitive
    • HttpResponseHeaders__c: same as the previous, when populated, this contains key keys and values
  • REST Request fields:
    • RestRequestUri__c: similar to HttpRequestEndpoint__c, the URI could contain some sensitive parameters

I think these are all of the fields that could have sensitive data (and don't currently have data masking applied) - if I find others (or you have any other suggestions), I'll add them to this list.

As far as a timeline, I'm currently working on wrapping up Nebula Logger's Winter '25 release over the next few weeks. Once I'm done with that release, I'll have a better sense of when I'll be able to work on this item.

@jongpie jongpie added Logging Source: Apex Items related to using Logger within Apex Logging Source: Lightning Components Items related to using Nebula Logger using JavaScript within lightning components (lwc & aura) Layer: Logger Engine Items related to the core logging engine Feature: Data Masking labels Oct 15, 2024
@dturkel
Copy link
Author

dturkel commented Oct 15, 2024

Hi there @jongpie, thanks for the detailed writeup.
In a recent case, the Google Places/Maps APIs has a parameter, "key" (the API service key), that must be included.

My initial rule is probably oversimplistic, since it could apply to far too many other pieces of content. I would/could extend my SenstiveDataRegEx into better capture groups. This is what I used, with the output screenshotted further below:

<CustomMetadata xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <label>Mask &quot;key&quot; values</label> <protected>false</protected> <values> <field>ApplyToMessage__c</field> <value xsi:type="xsd:boolean">true</value> </values> <values> <field>ApplyToRecordJson__c</field> <value xsi:type="xsd:boolean">true</value> </values> <values> <field>IsEnabled__c</field> <value xsi:type="xsd:boolean">true</value> </values> <values> <field>ReplacementRegEx__c</field> <value xsi:type="xsd:string">key=****</value> </values> <values> <field>SensitiveDataRegEx__c</field> <value xsi:type="xsd:string">key=[a-zA-Z0-9]+</value> </values> </CustomMetadata>

image

@jongpie
Copy link
Owner

jongpie commented Oct 16, 2024

@dturkel awesome, this is very helpful, thanks for sharing this info & screenshot! As soon as I have some time to work on this, I'll let you know if I need anything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Data Masking Layer: Logger Engine Items related to the core logging engine Logging Source: Apex Items related to using Logger within Apex Logging Source: Lightning Components Items related to using Nebula Logger using JavaScript within lightning components (lwc & aura) Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants