sentry-ruby icon indicating copy to clipboard operation
sentry-ruby copied to clipboard

Sanitize Sidekiq args?

Open ericproulx opened this issue 2 years ago • 5 comments

Hi,

Is there a way to sanitize Sidekiq args ? We're already sanitizing within the before_send but I can't find how to sanitize Sidekiq context through an event

Thanks.

ericproulx avatar Jul 21 '23 09:07 ericproulx

@ericproulx by sanitize you mean filter out or replace?

sl0thentr0py avatar Jul 26 '23 13:07 sl0thentr0py

@ericproulx by sanitize you mean filter out or replace?

Replace

ericproulx avatar Jul 26 '23 18:07 ericproulx

@ericproulx, so something like this behavior, but for sidekiq job arguments, when they're reported via Sentry?

When Raven split into new sentry gems, they've moved away from allowing you to set what fields and headers to sanitize to config.send_default_pii = false. https://docs.sentry.io/platforms/ruby/migration/#removed-processors

There's already Sentry::Sidekiq::ContextFilter that filters out sidekiq context. If you wanted to filter things out, you could patch into that.

@st0012, what's our stance on filtering out personal / sensitive information beyond the filter_default_pii info? I assume that it's up to the user now, in before_send and such?

natikgadzhi avatar Nov 23 '23 21:11 natikgadzhi

That question is better asking @sl0thentr0py as it's probably changed since the last time I answered a similar question 😛

st0012 avatar Nov 23 '23 21:11 st0012

before_send should work for this, it should be available in event.contexts[:sidekiq] where you can do the replace/masking.

sl0thentr0py avatar Jan 08 '24 16:01 sl0thentr0py