-
Notifications
You must be signed in to change notification settings - Fork 872
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
HTTP Span Attributes: http.url
must not contain username / password
#2674
Comments
I don't think that otel-java contains any usage of the |
@mateuszrzeszutek I think this example could be reviewed just to make sure that others do not copy-paste potentially unsafe code. |
Hi @Hangzhi - thanks for the help on this. You can find where we set the attribute, with no scrubbing of credentials I think, here |
@Hangzhi I think you can also look at this: open-telemetry/opentelemetry-java#3118 which should be also simpler😉 |
@pellared Thanks! I'll work on that. |
There are two ways to solve this: either to force every instrumentation to take care removing user info from the url, or put that responsibility onto @open-telemetry/java-maintainers, your thoughts? |
Some HTTP clients return their own URI types - I briefly took a look at the instrumentations we have and saw Just a wild idea: maybe we could add a wrapper interface public HttpUrl url(Request request) {
java.net.URI uri = request.getUrl();
return HttpUrl.from(uri);
} |
Using URI would be nice if we do have good representation in the instrumentations - looks like @mateuszrzeszutek has found that it may not be the case though. Since we expect to not have to parse in most cases, I suspect we could avoid the parse and do a very simple scan to find userinfo within the String if URI seems impractical. Not a huge fan in introducing the hundredth Java interface for URL :P |
👍 |
Hey folks, I would be happy to contribute here. |
Thanks! I'll assign this issue to you. |
Fixes #2674 by replacing basic auth information as part of the URL with `username:password`. Co-authored-by: Malte <[email protected]> Co-authored-by: Mateusz Rzeszutek <[email protected]> Co-authored-by: Trask Stalnaker <[email protected]>
Fixes open-telemetry#2674 by replacing basic auth information as part of the URL with `username:password`. Co-authored-by: Malte <[email protected]> Co-authored-by: Mateusz Rzeszutek <[email protected]> Co-authored-by: Trask Stalnaker <[email protected]>
Fixes open-telemetry#2674 by replacing basic auth information as part of the URL with `username:password`. Co-authored-by: Malte <[email protected]> Co-authored-by: Mateusz Rzeszutek <[email protected]> Co-authored-by: Trask Stalnaker <[email protected]>
Fixes open-telemetry#2674 by replacing basic auth information as part of the URL with `username:password`. Co-authored-by: Malte <[email protected]> Co-authored-by: Mateusz Rzeszutek <[email protected]> Co-authored-by: Trask Stalnaker <[email protected]>
As is stated in the recent specification change :
The text was updated successfully, but these errors were encountered: