-
-
Notifications
You must be signed in to change notification settings - Fork 437
Remove query parameters from logs #1997
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
base: develop
Are you sure you want to change the base?
Remove query parameters from logs #1997
Conversation
… logging - Updated all backend client files to log only SQL queries without parameter values - Changed logging from `self.log.debug("%s: %s", query, values)` to `self.log.debug("%s", query)` - Affects 7 backend clients: MySQL, SQLite, PostgreSQL (psycopg), ODBC, Oracle, MSSQL, AsyncPG - Prevents exposure of sensitive data like passwords, tokens, etc. in debug logs - Maintains debugging capability by still logging the SQL query structure Co-authored-by: bddap <2702854+bddap@users.noreply.github.com>
Co-authored-by: bddap <2702854+bddap@users.noreply.github.com>
Co-authored-by: bddap <2702854+bddap@users.noreply.github.com>
Co-authored-by: bddap <2702854+bddap@users.noreply.github.com>
CHANGELOG.rst
Outdated
0.25.2 | ||
------ | ||
Fixed | ||
^^^^^ | ||
- Remove sensitive query parameters from debug logging to prevent exposure of passwords, tokens, and personal data (#1996) |
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.
Want this too be added to an ## [Unreleased]
section? Keep A Changelog style?
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.
Yes, there is already a section with unreleased version in the newer version of CHANGELOG
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.
I've added my change to that new section.
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.
CodSpeed Performance ReportMerging #1997 will not alter performanceComparing Summary
|
Pull Request Test Coverage Report for Build 17163515135Details
💛 - Coveralls |
Co-authored-by: bddap <2702854+bddap@users.noreply.github.com>
Co-authored-by: bddap <2702854+bddap@users.noreply.github.com>
…f898-c331-4fbb-a571-d445599ed67f # Conflicts: # CHANGELOG.rst
I see you approved, @henadzit . This pr should be good to merge now. |
fixes #1996
Full disclosure, I had github copilot implement these changes. (been trying out the agent feature, it's pretty neat). I have personally reviewed for slop and the code looks good. Even the pr description below is true, it actually did run Manual verification and the unit tests. context
BEGIN COPILOT'S OWN DESCRIPTION (fact-checked by me)
Description
This PR fixes a security vulnerability where sensitive data (passwords, tokens, API keys, personal information) was being exposed in debug logs through SQL query parameters. The fix removes parameter values from debug logging while preserving the SQL query structure for debugging purposes.
Changes made:
self.log.debug("%s: %s", query, values)
toself.log.debug("%s", query)
Before:
After:
Motivation and Context
Fixes #1996
SQL query parameters often contain sensitive information that should never be logged:
This creates a significant security risk, especially in:
The current implementation logs both the SQL structure AND the parameter values, which unnecessarily exposes this sensitive data.
How Has This Been Tested?
Added comprehensive test suite (
tests/test_logging_security.py
):Manual verification:
Existing test compatibility:
Checklist:
Notes on checklist:
tests/test_logging_security.py
with comprehensive coverage of the security fix