Skip to content

Data scrubbing should filter sensitive headers such as Set-Cookie #1501

Closed

Description

@marandaneto

OkHttp defines its own sensitive headers.
Some of them are filtered by Relay already, but not all of them.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cookie

Not all HTTP clients respect that Set-Cookie should not be accessible.

Cookie is just removed from the headers list instead of being [Filtered], most likely because there's a high-level property Request#cookies already.

Screenshot 2022-09-27 at 10 46 02

Activity

  1. untitaker commented on Sep 27, 2022

    @untitaker
    Member

    the request interface of an event is for http request headers, set-cookie is a response header. generally we are filtering header names iirc

  2. marandaneto commented on Sep 28, 2022

    @marandaneto
    ContributorAuthor

    We're trying to use the request property for all the merged headers (request, response), but since there's this limitation plus a few other ones, I will reconsider that.
    I'll leave that up to you if you still wanna run scrubbing or not, there's also the inconsistency of Cookie being removed instead of filtered.

  3. jjbayer commented on Sep 29, 2022

    @jjbayer
    Member

    I suggest we put this hold until we've completed the RFC on where to put response data in the event payload.

  4. untitaker commented on Sep 29, 2022

    @untitaker
    Member

    We're trying to use the request property for all the merged headers (request, response), but since there's this limitation plus a few other ones, I will reconsider that.

    I would definitely not do that. Which RFC are we talking about?

  5. marandaneto commented on Sep 29, 2022

    @marandaneto
    ContributorAuthor

    @untitaker I'm going to write an RFC that adds Event.response or Event.contexts.response, data structure similar to event.request but with additional fields such as status_code, etc...
    Data scrubbing would need to give a pass in the headers field, etc.

  6. untitaker commented on Sep 29, 2022

    @untitaker
    Member

    @marandaneto sounds good. there is potential for a lot of pii there so i think we should think about designing new default scrubbing rules in the same vein.

  7. marandaneto commented on Oct 3, 2022

    @marandaneto
    ContributorAuthor

    @marandaneto sounds good. there is potential for a lot of pii there so i think we should think about designing new default scrubbing rules in the same vein.

    getsentry/rfcs#22

  8. marandaneto commented on Oct 7, 2022

    @marandaneto
    ContributorAuthor

    Closing in favor of getsentry/rfcs#22
    Request #headers[Cookie] is removed from the list because it's set to the high-level field cookies if found.
    Set-Cookie isn't scrubbed because it's a response header and it should not be set in the first place.
    Response headers go to the Response interface -> getsentry/rfcs#22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions