Skip to content

Mask scheduler URL password in RPC logs and errors - #3468

Open
s6hib wants to merge 1 commit into
spotify:masterfrom
s6hib:redact-scheduler-url-credentials
Open

s6hib wants to merge 1 commit into
spotify:masterfrom
s6hib:redact-scheduler-url-credentials

Conversation

@s6hib

@s6hib s6hib commented Oct 6, 2026

Copy link
Copy Markdown

Description

RemoteScheduler now masks the password whenever it puts the scheduler URL in a log line or an RPCError message, so http://user:pass@host:8082 shows up as http://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 both RPCError messages. 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 a RemoteScheduler at a local server that returns 503: before the change the warning and the exception both showed the password, and after it both show ***.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant