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

fix(st2common/router): don't log sensitive information #6028

Merged
merged 2 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Fixed
* Bumped `paramiko` to `2.10.5` to fix an issue with SSH Certs - https://github.com/paramiko/paramiko/issues/2017
Contributed by @jk464

* Avoid logging sensitive information in debug (fix #5977)

Added
~~~~~

Expand Down
7 changes: 6 additions & 1 deletion st2common/st2common/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,12 @@ def __call__(self, req):

At the time of writing, the only property being utilized by middleware was `x-log-result`.
"""
LOG.debug("Received call with WebOb: %s", req)
LOG.debug("Received call with WebOb: %s %s", req.method, req.url)
# if a more detailed log is required:
# loggable_req = req.copy()
# loggable_req.headers.pop('Authorization', None)
# loggable_req.headers.pop('X-Request-Id', None)
# LOG.debug("Received call with WebOb: %s", loggable_req)
endpoint, path_vars = self.match(req)
LOG.debug("Parsed endpoint: %s", endpoint)
LOG.debug("Parsed path_vars: %s", path_vars)
Expand Down
Loading