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

Add configuration for client TLS auth and rename variable for trusted… #1375

Closed
wants to merge 7 commits into from

Conversation

anuraaga
Copy link
Contributor

… cert of server.

Fixes #1363

Changes

Adds variables for configuring client TLS auth and rename / clarify the current configuration for a server's trusted certificate.

@iNikem
Copy link
Contributor

iNikem commented Jan 26, 2021

Changelog?

@anuraaga
Copy link
Contributor Author

@iNikem Yeah generally add it after some approvals since until then it just causes daily merge conflicts :P

specification/protocol/exporter.md Outdated Show resolved Hide resolved
Comment on lines 13 to 14
/ Client certificate / key | The TLS certificate and private key to authenticate the client for mTLS. Should only be used for a secure connection.. | n/a | `OTLP_EXPORTER_OTLP_TLS_CERTIFICATE` `OTLP_EXPORTER_OTLP_SPAN_TLS_CERTIFICATE` `OTLP_EXPORTER_OTLP_METRIC_TLS_CERTIFICATE`, `OTLP_EXPORTER_OTLP_TLS_PRIVATE_KEY` `OTLP_EXPORTER_OTLP_SPAN_TLS_PRIVATE_KEY` `OTLP_EXPORTER_OTLP_METRIC_TLS_PRIVATE_KEY` |
| Trusted certificate | The trusted certificate to use when verifying a server's TLS credentials. Should only be used for a secure connection. | n/a | `OTEL_EXPORTER_OTLP_TLS_TRUSTED_CERTIFICATE` `OTEL_EXPORTER_OTLP_SPAN_TLS_TRUSTED_CERTIFICATE` `OTEL_EXPORTER_OTLP_METRIC_TLS_TRUSTED_CERTIFICATE` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per #1362 this should all be _TRACE_ instead of _SPAN_. Please don't forget updating the PR that gets merged last.

Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>
@tigrannajaryan
Copy link
Member

Lets use TRACES instead of SPAN as it is proposed by #1362

@@ -10,7 +10,8 @@ The following configuration options MUST be available to configure the OTLP expo
| -------------------- | ------------------------------------------------------------ | ----------------- | ------------------------------------------------------------ |
| Endpoint | Target to which the exporter is going to send spans or metrics. The endpoint MUST be a valid URL with scheme (http or https) and host, and MAY contain a port and path. A scheme of https indicates a secure connection. When using `OTEL_EXPORTER_ENDPOINT` with OTLP/HTTP, exporters SHOULD follow the collector convention of appending the version and signal to the path (e.g. `v1/traces` or `v1/metrics`). The per-signal endpoint configuration options take precedence and can be used to override this behavior. See the [OTLP Specification][otlphttp-req] for more details. | `https://localhost:4317` | `OTEL_EXPORTER_OTLP_ENDPOINT` `OTEL_EXPORTER_OTLP_SPAN_ENDPOINT` `OTEL_EXPORTER_OTLP_METRIC_ENDPOINT` |
| Protocol | The protocol used to transmit the data. One of `grpc`,`http/json`,`http/protobuf`. | `grpc` | `OTEL_EXPORTER_OTLP_PROTOCOL` `OTEL_EXPORTER_OTLP_SPAN_PROTOCOL` `OTEL_EXPORTER_OTLP_METRIC_PROTOCOL` |
| Certificate File | Path to certificate file for TLS credentials of gRPC client. Should only be used for a secure connection. | n/a | `OTEL_EXPORTER_OTLP_CERTIFICATE` `OTEL_EXPORTER_OTLP_SPAN_CERTIFICATE` `OTEL_EXPORTER_OTLP_METRIC_CERTIFICATE` |
| Client certificate / key | The TLS certificate and private key to authenticate the client for mTLS. Should only be used for a secure connection. | n/a | `OTEL_EXPORTER_OTLP_TLS_CERTIFICATE` `OTEL_EXPORTER_OTLP_SPAN_TLS_CERTIFICATE` `OTEL_EXPORTER_OTLP_METRIC_TLS_CERTIFICATE`, `OTEL_EXPORTER_OTLP_TLS_PRIVATE_KEY` `OTEL_EXPORTER_OTLP_SPAN_TLS_PRIVATE_KEY` `OTEL_EXPORTER_OTLP_METRIC_TLS_PRIVATE_KEY` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be renamed to OTEL_EXPORTER_OTLP_METRIC_TLS_TRUSTED_CERTIFICATE I think. Is that what you'd like to confirm?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we still allow the old Environment variable but mark it deprecated with a migration?

Given how CLOSE we are to 1.0 I think it'd be good if we pretend we have users we don't want to break, to get in the habit of how these changes will have to be made going forward.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If languages want to support multiple variables I think they could, even without it being mentioned in the spec right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comment was about checking with python maintainers whether it is already heavily in use. As @jsuereth pointed we need to be careful with renaming. If not much adoption so far, PR good with me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, there aren't any open source usage

https://github.com/search?q=OTEL_EXPORTER_OTLP_METRIC_CERTIFICATE&type=code

And if we were done making changes, we'd already be 1.0 - this doc doesn't have any label on it, not even feature-freeze like some of the other ones so it seems a bit unfair to require too much process. The variable seems to be a bug really since the description doesn't describe it, these are credentials of a server, not a client.

Languages can use a deprecation cycle to change the variable if they wish, but I don't think that's something to have here, or if we did, it would be a much more general document detailing a mandate for and how to deprecate features.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not asking for much process. Maybe just a ack from @open-telemetry/python-approvers

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok - @open-telemetry/python-approvers does this change look ok? Thanks!

Base automatically changed from master to main January 27, 2021 21:16
@anuraaga
Copy link
Contributor Author

anuraaga commented Feb 2, 2021

Any more updates needed on this?

@anuraaga
Copy link
Contributor Author

anuraaga commented Feb 4, 2021

@codeboten @ocelotl @lzchen Could you take a look at this PR? Thanks!

@ocelotl
Copy link
Contributor

ocelotl commented Feb 4, 2021

Sure, will do this tonight 👍

Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me, not sure if there is a heavy use of this variable just yet.

@@ -10,7 +10,8 @@ The following configuration options MUST be available to configure the OTLP expo
| -------------------- | ------------------------------------------------------------ | ----------------- | ------------------------------------------------------------ |
| Endpoint | Target to which the exporter is going to send spans or metrics. The endpoint MUST be a valid URL with scheme (http or https) and host, and MAY contain a port and path. A scheme of https indicates a secure connection. When using `OTEL_EXPORTER_ENDPOINT` with OTLP/HTTP, exporters SHOULD follow the collector convention of appending the version and signal to the path (e.g. `v1/traces` or `v1/metrics`). The per-signal endpoint configuration options take precedence and can be used to override this behavior. See the [OTLP Specification][otlphttp-req] for more details. | `https://localhost:4317` | `OTEL_EXPORTER_OTLP_ENDPOINT` `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` |
| Protocol | The protocol used to transmit the data. One of `grpc`,`http/json`,`http/protobuf`. | `grpc` | `OTEL_EXPORTER_OTLP_PROTOCOL` `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL` `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL` |
| Certificate File | Path to certificate file for TLS credentials of gRPC client. Should only be used for a secure connection. | n/a | `OTEL_EXPORTER_OTLP_CERTIFICATE` `OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE` `OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE` |
| Client certificate / key | The TLS certificate and private key to authenticate the client for mTLS. Should only be used for a secure connection. | n/a | `OTEL_EXPORTER_OTLP_TLS_CERTIFICATE` `OTEL_EXPORTER_OTLP_TRACES_TLS_CERTIFICATE` `OTEL_EXPORTER_OTLP_METRICS_TLS_CERTIFICATE`, `OTEL_EXPORTER_OTLP_TLS_PRIVATE_KEY` `OTEL_EXPORTER_OTLP_TRACES_TLS_PRIVATE_KEY` `OTEL_EXPORTER_OTLP_METRICS_TLS_PRIVATE_KEY` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question, mostly out of curiosity. I see a replacing of Path to certificate file... for The TLS certificate and private key.... The idea behind that is to use the contents of the certificate as the value of the environment variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for calling this out. This was tough for me since this table has both configuration options and environment variables. I don't think the SDK has to expose a programmatic interface that only accepts a path, and often it'd probably not a good idea since it makes it difficult to provide credentials in non-file ways such as embedding into the binary or using a KMS client. The environment variable makes sense to point to a path though. So I made the description generic to not specify the type to apply to both.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should move the environment variables out of here to the sdk-environment-variables doc since they seem somewhat mysterious to be defined here and would give us the flexibility when describing. That'd be for another PR though I think.

@carlosalberto
Copy link
Contributor

carlosalberto commented Feb 4, 2021

@jsuereth Any opinion on this one? 😄

@anuraaga anuraaga closed this Feb 7, 2021
codeboten pushed a commit to codeboten/opentelemetry-specification that referenced this pull request Jul 7, 2021
The current version of the specification makes me think that Certificate File is intended to be used as part of the client authentication, which it is not. This change addresses part of the confusion discussed in open-telemetry#1363, the certificate file option and environment variable points to the certificate used to verify the server's certificate. 

See also open-telemetry#1375.
SergeyKanzhelev added a commit that referenced this pull request Jul 7, 2021
* clarify meaning of "Certificate File" 

The current version of the specification makes me think that Certificate File is intended to be used as part of the client authentication, which it is not. This change addresses part of the confusion discussed in #1363, the certificate file option and environment variable points to the certificate used to verify the server's certificate. 

See also #1375.

* update changelog

* Update CHANGELOG.md

Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
tigrannajaryan pushed a commit to tigrannajaryan/opentelemetry-proto that referenced this pull request Apr 20, 2023
* clarify meaning of "Certificate File"

The current version of the specification makes me think that Certificate File is intended to be used as part of the client authentication, which it is not. This change addresses part of the confusion discussed in open-telemetry/opentelemetry-specification#1363, the certificate file option and environment variable points to the certificate used to verify the server's certificate.

See also open-telemetry/opentelemetry-specification#1375.

* update changelog

* Update CHANGELOG.md

Co-authored-by: Sergey Kanzhelev <S.Kanzhelev@live.com>
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.

Environment variables for OTLP client TLS key / certificate
10 participants