-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix CodeQL Security Alert: Remove Sensitive File Paths from Log Messages #7345
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
Merged
Conversation
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
Signed-off-by: danish9039 <danishsiddiqui040@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7345 +/- ##
==========================================
- Coverage 96.49% 96.44% -0.05%
==========================================
Files 378 378
Lines 22910 22910
==========================================
- Hits 22107 22096 -11
- Misses 608 616 +8
- Partials 195 198 +3
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:
|
yurishkuro
approved these changes
Jul 19, 2025
Merged
via the queue into
jaegertracing:main
with commit Jul 19, 2025
fe7e90a
61 of 63 checks passed
chethanac15
pushed a commit
to chethanac15/jaeger
that referenced
this pull request
Jul 20, 2025
…ges (jaegertracing#7345) <!-- !! Please DELETE this comment before posting. We appreciate your contribution to the Jaeger project! 👋🎉 --> Related to - jaegertracing#7316 - jaegertracing#7225 - Security Fix This PR addresses a High severity CodeQL security alert for "Clear-text logging of sensitive information" in the FSWatcher component. This issue was originally found in PR jaegertracing#7316 . - Problem CodeQL detected that sensitive file paths (potentially containing credentials) were being logged in plain text: ``` // Before: Exposes sensitive file paths in logs w.logger.Warn("Unable to read the file", zap.String("file", filePathName), zap.Error(err)) ``` Security Risk: If logs are compromised, attackers could identify locations of credential files, configuration files, or other sensitive resources. - Solution Removed sensitive file path information from log messages while preserving error context: ``` // After: Secure logging without exposing file paths w.logger.Warn("Unable to read the file", zap.Error(err)) ``` - Files Changed `internal/fswatcher/fswatcher.go`: Removed zap.String("file", filePathName) from error logging `internal/fswatcher/fswatcher_test.go`: Updated test assertions to match new log format - - [ ] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [ ] I have signed all commits - [ ] I have added unit tests for the new functionality - [ ] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` Signed-off-by: danish9039 <danishsiddiqui040@gmail.com> Signed-off-by: Chethan A C <acchethan15@gmail.com>
chethanac15
pushed a commit
to chethanac15/jaeger
that referenced
this pull request
Jul 20, 2025
…ges (jaegertracing#7345) <!-- !! Please DELETE this comment before posting. We appreciate your contribution to the Jaeger project! 👋🎉 --> Related to - jaegertracing#7316 - jaegertracing#7225 - Security Fix This PR addresses a High severity CodeQL security alert for "Clear-text logging of sensitive information" in the FSWatcher component. This issue was originally found in PR jaegertracing#7316 . - Problem CodeQL detected that sensitive file paths (potentially containing credentials) were being logged in plain text: ``` // Before: Exposes sensitive file paths in logs w.logger.Warn("Unable to read the file", zap.String("file", filePathName), zap.Error(err)) ``` Security Risk: If logs are compromised, attackers could identify locations of credential files, configuration files, or other sensitive resources. - Solution Removed sensitive file path information from log messages while preserving error context: ``` // After: Secure logging without exposing file paths w.logger.Warn("Unable to read the file", zap.Error(err)) ``` - Files Changed `internal/fswatcher/fswatcher.go`: Removed zap.String("file", filePathName) from error logging `internal/fswatcher/fswatcher_test.go`: Updated test assertions to match new log format - - [ ] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [ ] I have signed all commits - [ ] I have added unit tests for the new functionality - [ ] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` Signed-off-by: danish9039 <danishsiddiqui040@gmail.com> Signed-off-by: Chethan A C <acchethan15@gmail.com>
4 tasks
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.
Which problem is this PR solving?
Related to
Description of the changes
Security Fix
This PR addresses a High severity CodeQL security alert for "Clear-text logging of sensitive information" in the FSWatcher component. This issue was originally found in PR [refactor] Used OTEL Optional type for union Auth struct #7316 .
Problem
CodeQL detected that sensitive file paths (potentially containing credentials) were being logged in plain text:
Security Risk: If logs are compromised, attackers could identify locations of credential files, configuration files, or other
sensitive resources.
Solution
Removed sensitive file path information from log messages while preserving error context:
Files Changed
internal/fswatcher/fswatcher.go
: Removed zap.String("file", filePathName) from error logginginternal/fswatcher/fswatcher_test.go
: Updated test assertions to match new log formatHow was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:npm run lint
andnpm run test