Skip to content

Commit

Permalink
fix(st2common/router): don't log sensitive information (#6028)
Browse files Browse the repository at this point in the history
* fix(st2common/router): don't log sensitive information
  • Loading branch information
arthurzenika authored Oct 5, 2023
1 parent 6f5ac8a commit 7ab62de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
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

0 comments on commit 7ab62de

Please sign in to comment.