Skip to content

feat(server): Disable graphql scrubbing when datascrubbing is disabled#2689

Merged
TBS1996 merged 4 commits intomasterfrom
skip_empty_rules
Nov 7, 2023
Merged

feat(server): Disable graphql scrubbing when datascrubbing is disabled#2689
TBS1996 merged 4 commits intomasterfrom
skip_empty_rules

Conversation

@TBS1996
Copy link
Copy Markdown
Contributor

@TBS1996 TBS1996 commented Nov 6, 2023

issue: #2666

Previously the graphql scrubbing would run any time there is a pii config, which would always be the case even if datascrubbing is disabled as it would simply be a config without rules.

The expected behaviour would be that if you disable datascrubbing, graphql scrubbing will also be disabled.

this PR moves the graphql scrubbing outside of the processor, and simply checks the datascrubbing flag for whether to scrub graphql or not. Moving it out because we don't have access to the datascrubbing config in the processor.

in the future, it would be better to have a separate graphql option for the user to configure in sentry and the graphql rules could be part of the normal datascrubbing rules.

@TBS1996 TBS1996 changed the title feat(server): Skip processing when no rules feat(server): Disable graphql scrubbing when datascrubbing is disabled Nov 6, 2023
@TBS1996 TBS1996 self-assigned this Nov 6, 2023
Ok(())
}

fn process_event(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since removing scrub_graphl makes it match the default implementation we can simply remove this


/// Scrubs GraphQL variables from the event.
fn scrub_graphql(event: &mut Event) {
pub fn scrub_graphql(event: &mut Event) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since it's not used in the processor directly we might consider moving it elsewhere, thoughts?

@TBS1996 TBS1996 marked this pull request as ready for review November 6, 2023 08:10
@TBS1996 TBS1996 requested a review from a team November 6, 2023 08:10
@TBS1996 TBS1996 linked an issue Nov 6, 2023 that may be closed by this pull request
if let Some(event) = event.value_mut() {
scrub_graphql(event);
}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So the reason for moving this here is that inside the processor, we do not have access to datascrubbing_settings? Might be worth pointing that out in the PR description.

@TBS1996 TBS1996 enabled auto-merge (squash) November 7, 2023 07:14
@TBS1996 TBS1996 merged commit 5970ee9 into master Nov 7, 2023
@TBS1996 TBS1996 deleted the skip_empty_rules branch November 7, 2023 07:34
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.

Graphql Scrubbing can't be disabled via the Data Scrubber toggle option

2 participants