-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[Entitlements] Add URLConnection instrumentation for ftp, http and https protocols #123802
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
[Entitlements] Add URLConnection instrumentation for ftp, http and https protocols #123802
Conversation
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
| java.net.HttpURLConnection that, | ||
| String name | ||
| ) { | ||
| policyManager.checkOutboundNetworkAccess(callerClass); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Wow, this kind of sucks. Requiring a check for every individual property of a connection seems fishy. But we really have no alternative right now unless we consider some form of "deep" check.)
...-plugin/src/main/java/org/elasticsearch/entitlement/qa/test/URLConnectionNetworkActions.java
Show resolved
Hide resolved
...-plugin/src/main/java/org/elasticsearch/entitlement/qa/test/URLConnectionNetworkActions.java
Show resolved
Hide resolved
| void check$sun_net_www_protocol_http_HttpURLConnection$$openConnectionCheckRedirects(Class<?> callerClass, java.net.URLConnection c); | ||
|
|
||
| void check$sun_net_www_protocol_http_HttpURLConnection$connect(Class<?> callerClass, java.net.HttpURLConnection that); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about doTunneling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and looks like this is yet another case we haven't handled yet :/
protected HttpClient getNewHttpClient(URL url, Proxy p, int connectTimeout)
throws IOException {
return HttpClient.New(url, p, connectTimeout, this);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added those and then removed them because they are "internal" - they are public but in non-exported classes.
(I realized because I was not able to test them :D )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just about to say, this is probably not exported 👍
mosche
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
but I fear there's just more and more coming up that requires instrumentation
Agreed, this is best effort/what seems to be a sensible compromise |
💔 Backport failed
You can use sqren/backport to manually backport by running |
Based on #123503
Relates to ES-10994