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

Sanitise HTTP message logs #454

Closed
mikkokar opened this issue Aug 21, 2019 · 5 comments
Closed

Sanitise HTTP message logs #454

mikkokar opened this issue Aug 21, 2019 · 5 comments
Assignees
Labels

Comments

@mikkokar
Copy link
Contributor

mikkokar commented Aug 21, 2019

Problem Statement

Styx logs HTTP messages for access logs, errors, warnings and so on. The messages are constructed by toString method, which includes all HTTP fields in verbatim, including sensitive information like security tokens.

Styx needs a configurable mechanism to sanitise the HTTP messages before logging them.

Acceptance Criteria

  • Remove toString method from HttpRequest, HttpResponse, LiveHttpRequest, LiveHttpResponse, and any possible base classes. This is to prevent developers from logging them accidentally.

  • Add a "removeCookies" option, that is a list of cookie names, in styx server under request-logging section. Any cookie name in this list gets removed from the logged message output.

    request-logging:
      inbound:
          ...
      outbound:
          ...
      removeCookies:
         - sessionToken
         - anotherToken
  • TODO: do we need removeHeaders option. Similar to removeCookies above.

  • The new config is documented in styx end user manual.

  • The new config option is added to styx config validator, so that it can pick up any invalid configuration.

@mikkokar
Copy link
Contributor Author

Hi @fantayeneh and @taer. Please check this bug.

@OwenLindsell could you look into this please?

@fantayeneh
Copy link
Contributor

I would add an option to redact headers and cookies. That will make debugging easy.

@OwenLindsell
Copy link
Contributor

I would add an option to redact headers and cookies. That will make debugging easy.

Definitely something we will consider

@OwenLindsell
Copy link
Contributor

Almost done on this story. Will hopefully submit a PR tomorrow.

@OwenLindsell
Copy link
Contributor

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants