relay icon indicating copy to clipboard operation
relay copied to clipboard

Enrich payloads after PII scrubbing

Open jjbayer opened this issue 1 year ago • 3 comments

We run event normalization before PII scrubbing, and for good reason: The user expects that their scrubbing rules are evaluated on the event in its canonical form.

However, what we currently call "normalization" includes enriching the event with information derived from the event itself, for example in span.sentry_tags. These derived fields should be populated after PII scrubbing, for two reasons:

  1. It's very easy to miss that the derived field needs to be scrubbed. Currently we potentially have to update our default scrubbers for every derived field we add in normalization. See https://github.com/getsentry/relay/pull/4364, https://github.com/getsentry/relay/issues/3917.
  2. If users define a custom rule on a derived field, they might miss the fact that they need to scrub the original field as well. Running the "enrichment" before PII scrubbing forces the user to define the rule on the correct field.

Proposal: Introduce a new processing step named "enrichment" or similar that runs after PII scrubbing. Gradually move derived fields from normalization to enrichment.

ref: INC-984

jjbayer avatar Dec 13 '24 07:12 jjbayer

ref: https://github.com/getsentry/security-advisories/issues/16

jjbayer avatar Dec 13 '24 07:12 jjbayer

Con: Doing enrichments after PII scrubbing also means that selectors for inbound filters / dynamic sampling might not be available. So we should initially do it only for sentry_tags.

jjbayer avatar Dec 16 '24 08:12 jjbayer

Q: Could on-demand metric extraction leak PII?

jjbayer avatar Dec 16 '24 12:12 jjbayer