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

fix(pii): Scrub user fields in span.sentry_tags #4364

Merged
merged 11 commits into from
Dec 10, 2024
Merged

Conversation

jjbayer
Copy link
Member

@jjbayer jjbayer commented Dec 10, 2024

User fields are transferred into span.sentry_tags before PII scrubbing. Most user fields are marked as pii = true, that is, they should be scrubbed by default.

This PR

  1. converts sentry_tags into a special type SentryTags, such that we can mark specific tags as pii = true,
  2. adds sentry_tags.user_ip to the builtin PII selector for IP scrubbing.

@jjbayer jjbayer self-assigned this Dec 10, 2024
@@ -1183,7 +1183,7 @@ def test_span_ingestion_with_performance_scores(
"data": {
"transaction": "/page/with/click/interaction/jane/123",
"replay_id": "8477286c8e5148b386b71ade38374d58",
"user": "admin@sentry.io",
"user": "[email]",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now scrubbed by default, just like the top level event.user.email.

/// A list of supported span tags for tag extraction.
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
#[allow(missing_docs)]
pub enum SpanTagKey {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of storing a BTreeMap<SpanTagKey, Annotated<String>>, we now have a SentryTags struct.

relay-event-schema/src/protocol/span.rs Outdated Show resolved Hide resolved
@jjbayer jjbayer marked this pull request as ready for review December 10, 2024 12:21
@jjbayer jjbayer requested a review from a team as a code owner December 10, 2024 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants