-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Unify TLS configuration #933
Comments
The purpose of having enabled flag is because all the config options are optional. We need a way to enable TLS with just the default options. tls_config: Wouldn't work because the value of tls_config would be empty so no easy way to tell it was enabled. So instead: tls_config:
enabled: true Of course this is assuming TLS is off by default and it's something the user explicitly enables. Is this the case for all components? |
Current config has a "UseSecure" property that is almost equal with |
I don't think tls_config:
use_secure: true
insecure_skip_verify: true So it's both secure and insecure? :P |
Other option is to separate out tls_enabled: true ( tls_enabled: true
tls_config:
ca_cert: /path/to/cert I kind of prefer ^. |
@jrcamp - I will take this task. I will update with a plan in a bit. |
+1 on unifying the TLS configuration. It is a bit confusing to have |
Instead of adding '
and the code base would check
|
They are similar but not quite the same. There are two paths forward:
I prefer option 1. This will result in a breaking change for existing configurations; however, it does default the behavior to use a secure connection (in line with gRPC and HTTP connections)
|
I don't think we can differentiate between https://repl.it/repls/MonthlyLowLinux I'm a bit confused about gRPC. Does WithInsecure just mean TLS isn't enabled? If that's the case then that's controlled by the overall TLS on/off flag right? (Depends on how we resolve the first issue above). Am I missing something? |
An empty TLS config doesn't do anything. In HTTP client scenarios, tls is determined by the url passed into the HTTP client config. If the CA need to be updated, they can add it to the TLSConfig. But that isn't a hard requirement, they can add CAs to the system. In gRPC path, the default behavior as implemented is to use Re your WithInsecure gRPC question - Looking at some implementations of http receivers, the http/https scheme is passed in as a separate field to the config. It would be better for the endpoint to require http:// or https:// and that is parsed for the user. That would be more inline with HTTP Client/Server handlings. |
I agree when a user is writing the endpoint explicitly it's better to have it as part of the URL. However this causes some problems with auto-discovered receivers. It's possible to put it in the endpoint but it requires a bit more trickery. Examples where you can configure receivers:
receiver_creator:
http/1:
rule: pod.labels["app"] == "http"
config:
tls_enabled: true receivers:
receiver_creator:
http/1:
rule: pod.labels["app"] == "http"
config:
tls_enabled: `pod.labels["secure"] == "true"` Examples where you have to configure it as part of endpoint: receivers:
receiver_creator:
http/1:
rule: pod.labels["app"] == "http"
config:
endpoint: `"https://" + endpoint` receivers:
receiver_creator:
http/1:
rule: pod.labels["app"] == "http"
config:
endpoint: `sprintf("%s://%s", pod.labels["secure"] == "true" ? "https" : "http", endpoint)` We could perhaps support both the flag and having it as part of endpoint but would have to figure out how to handle cases where the options conflict (error out or one takes precedence?) |
Note that that receiver and exporter TLS struct might want to expose different set properties: Exporter in addition to the cert and key should expose Receiver, on the other hand, should expose clients' CA cert #963 |
@pavolloffay - so the real distinction comes from if the receiver/exporter is making a client or server connection. Ex. Prometheus Receiver is making a client connection. A nice way to do this is to have the base TLSConfig (CA , cert and key for ex) and then have extra stuff in a TLSClientConfig/TLSServerConfig then have the components use the TLS*Config htat works best for them.
|
Synced with @jrcamp offline - to address the |
@bogdandrutu I think this is mostly done with latest TLS changes. I think we still have the open issue of how to specify TLS is enabled in the case where tls_settings are not needed? (ie you just want default TLS config). Do you do: endpoint: https://localhost:1234 endpoint: unix+tls:///var/run/sock I think we started discussing it but couldn't come to a conclusion. |
@jrcamp do you mind closing this issue and start smaller issues focus on the problems left to be resolved? |
Follow up from open-telemetry#933 where InsecureSkipVerify was discussed but not implemented.
Follow up from open-telemetry#933 where InsecureSkipVerify was discussed but not implemented.
Follow up from #933 where InsecureSkipVerify was discussed but not implemented.
There are several concurrent efforts to improve TLS configuration, some in core and some in contrib, so I think it'd help to get everybody aligned.
#288
#927
open-telemetry/opentelemetry-collector-contrib#215
open-telemetry/opentelemetry-collector-contrib#215
open-telemetry/opentelemetry-collector-contrib#198
Here is one proposal that includes all options I've seen so far:
@tigrannajaryan @bogdandrutu @ccaraman @pavolloffay @pjanotti
The text was updated successfully, but these errors were encountered: