-
-
Notifications
You must be signed in to change notification settings - Fork 226
fix: Redact Authorization header before sending events to Sentry #4164
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
Conversation
|
|
||
| internal class RedactedHeaders : IDictionary<string, string> | ||
| { | ||
| private static readonly string[] SensitiveKeys = ["Authorization", "Proxy-Authorization"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could be a bit more aggressive there. The Python SDK redacts a bunch of headers.
See Potential suspects.
src/Sentry/Protocol/Response.cs
Outdated
| Cookies = cookies, | ||
| Data = data, | ||
| InternalHeaders = headers?.WhereNotNullValue().ToDict(), | ||
| InternalHeaders = headers.Redact(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the implicit operator, do we need to call the method here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do unfortunately. InternalHeaders is nullable and that can't be done with an implicit operator.
Resolves #4163: