-
Notifications
You must be signed in to change notification settings - Fork 107
Masked the sensitive credential data in the connection string (DSN,data source name) from error messages for security reasons. #1973
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: master
Are you sure you want to change the base?
Conversation
… data source name) from error messages for security reasons.
summaryInferred base version: v3.121.0 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1973 +/- ##
==========================================
- Coverage 73.98% 73.90% -0.08%
==========================================
Files 392 394 +2
Lines 34417 34454 +37
==========================================
Hits 25462 25462
- Misses 7834 7863 +29
- Partials 1121 1129 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pull request overview
This PR implements security improvements to prevent sensitive credential data from being exposed in error messages by sanitizing DSN (Data Source Name) strings. The implementation introduces a new secret.DSN() function that removes credentials from connection strings before they are included in error messages.
Key Changes
- Created a new
internal/secretpackage with aDSN()function that removes sensitive credentials from connection strings - Applied the sanitization to error messages in three key locations:
sql.go,options.go, anddriver.go - Added test coverage for the DSN sanitization functionality
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/secret/dsn.go | New implementation of DSN sanitization function that removes credentials from connection strings |
| internal/secret/dsn_test.go | Test cases for DSN sanitization covering various credential formats |
| sql.go | Applied DSN sanitization to SQL driver error messages |
| options.go | Applied DSN sanitization to connection string parsing errors |
| driver.go | Applied DSN sanitization to driver initialization errors |
| CHANGELOG.md | Documented the security enhancement |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
🌋 SLO Test ResultsStatus: 🟡 6 workloads tested • 5 workloads with warnings
Generated by ydb-slo-action |
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.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: YDBAPPTEAM-453
What is the new behavior?
Other information