fix: adding pre logging oath url scrubbing to ensure sensitive data not stored #83
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.
Summary
Implements URL sanitization for logging to prevent sensitive OAuth parameters from appearing in logs. Adds a utility to remove sensitive query parameters from URLs before they are written to error logs and HTTP request logs, improving security posture without affecting functionality.
Type of Change
Testing
Run and verify all URL sanitizer tests pass:
All 25 unit tests pass, covering:
Additional Context
Changes:
lib/url-sanitizer.jsmodule to sanitize URLs by removing sensitive OAuth query parameterslogEventCtxError()inlib/server.jsto sanitize URLs before error loggingmorgan('tiny')with custom format that sanitizes URLs in HTTP request logsImpact:
Sanitized Parameters: Removes sensitive OAuth query parameters from logged URLs while preserving non-sensitive query parameters (e.g.,
scope,response_type).Related Issue
Closes #W-20006706