Skip to content
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

Redact sensitive information in redirected URLs #1408

Merged
merged 2 commits into from
Jul 18, 2022

Commits on Jul 18, 2022

  1. Redact sensitive information in redirected URLs

    This adds internal methods to redact potentially sensitive information
    from URLs in error messages, especially when those URLs are the result
    of server-side redirects.
    
    We already redact potentially sensitive information like this as part of
    transport.CheckError, but this isn't called when the error is the result
    of an http.Client.Do (e.g., tcp dial error).
    
    The specific use case where this can happen is a registry like GCR which
    redirects blob requests to GCS with a sensitive access_token in the
    query parameter. If the request to GCS fails due to tcp error, the error
    message will include the sensitive access token.
    
    This method of redaction relies on the original error being a
    *url.Error, and redaction is accomplished by simply updating the error's
    URL with a redacted equivalent.
    imjasonh committed Jul 18, 2022
    Configuration menu
    Copy the full SHA
    b6a54b6 View commit details
    Browse the repository at this point in the history
  2. review feedback

    imjasonh committed Jul 18, 2022
    Configuration menu
    Copy the full SHA
    38c0518 View commit details
    Browse the repository at this point in the history