Avoid logging MySQL connection configs #1501
Merged
Conversation
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
PR Overview
This pull request addresses a code scanning alert related to clear-text logging of sensitive MySQL connection configurations by removing sensitive data from the error message.
- Introduces a new error constant, ErrMigrationNotAllowedOnMaster, which avoids logging sensitive connection configuration details.
- Refactors error handling to utilize the new constant instead of formatting sensitive configuration data into the error message.
Reviewed Changes
| File | Description |
|---|---|
| go/logic/migrator.go | Defines a new error constant and updates existing error handling to prevent sensitive info logging |
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
go/logic/migrator.go:27
- [nitpick] Consider rephrasing the error message for clarity by using past tense (e.g., 'attempted' instead of 'attempt') to improve grammatical accuracy.
ErrMigrationNotAllowedOnMaster = errors.New("It seems like this migration attempt to run directly on master. Preferably it would be executed on a replica (this reduces load from the master). To proceed please provide --allow-on-master.")
Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more
susanzhang27
approved these changes
Feb 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Avoid logging MySQL connection configs.
Fix for https://github.com/github/gh-ost/security/code-scanning/2