Repository navigation
Conversation
RemoteScheduler supports basic auth credentials in the scheduler URL (http://user:pass@host:8082), but logged the full URL on every retry and included it in RPCError messages, writing the password in plain text to worker logs and tracebacks. Use a copy of the URL with the password replaced by *** for logging and error messages; requests still go to the original URL.
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.
Description
RemoteSchedulernow masks the password whenever it puts the scheduler URL in a log line or anRPCErrormessage, sohttp://user:pass@host:8082shows up ashttp://user:***@host:8082. Requests still go to the original URL.Motivation and Context
Basic auth credentials in the scheduler URL have been supported since #2791, but the full URL is logged on every failed connection attempt (
Failed connecting to remote scheduler ...) and included in bothRPCErrormessages. That writes the password in plain text to worker logs and tracebacks, which often end up in CI output or log aggregation.Have you tested this? If so, how?
I have included unit tests. They cover the masking helper (no credentials, username only, empty password, a password containing
@, unix socket URLs), the retry warning and both error messages, and check that requests still use the unmasked URL. I also pointed aRemoteSchedulerat a local server that returns 503: before the change the warning and the exception both showed the password, and after it both show***.