-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Initial implementation for TPM extension #39059
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Pavol Loffay <[email protected]>
pavolloffay
commented
Mar 31, 2025
|
||
// RoundTrip modifies the original request and adds Bearer token Authorization headers. Incoming requests support multiple tokens, but outgoing requests only use one. | ||
func (interceptor *TPMRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { | ||
return interceptor.tpmTLSTransport.RoundTrip(req) |
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.
It is unfortunate that it skips other interceptors.
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Replaced by open-telemetry/opentelemetry-collector#12801 |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
github-merge-queue bot
pushed a commit
to open-telemetry/opentelemetry-collector
that referenced
this pull request
Apr 30, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Add trusted platform module (TPM) support to TLS package. <!-- Issue number if applicable --> #### Link to tracking issue Resolves open-telemetry/opentelemetry-collector-contrib#38682 Replaces open-telemetry/opentelemetry-collector-contrib#39059 TPM cannot be implemented as extension open-telemetry/opentelemetry-collector-contrib#38682 because it overrides the entire `http.transport` and therefore invalidates other extensions/authenticators. <!--Describe what testing was performed and which tests were added.--> #### Testing ```yaml # make otelcorecol # sudo ./bin/otelcorecol_linux_amd64 --config ./examples/local/tpm.yaml # # CA # openssl genrsa -des3 -out ca.key 2048 # openssl req -new -x509 -days 1826 -key ca.key -out ca.crt -subj "/C=US/ST=CA/L=Santa Clara/O=Edge/OU=Edge/CN=localhost" -addext "subjectAltName=DNS:localhost,IP:127.0.0.1" # # client # sudo tpm2tss-genkey -a rsa -s 2048 edge-cert.key # sudo openssl req -new -provider tpm2 -key edge-cert.key -out edge-cert.csr -subj "/C=US/ST=CA/L=Santa Clara/O=Edge/OU=Edge/CN=localhost" -addext "subjectAltName=DNS:localhost,IP:127.0.0.1" # openssl x509 -req -in edge-cert.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out edge-cert.crt -days 1826 -copy_extensions copyall # # server # openssl genrsa -out server.key 2048 # openssl req -new -key server.key -out server.csr -subj "/C=US/ST=CA/L=Santa Clara/O=Edge/OU=Edge/CN=localhost" -addext "subjectAltName=DNS:localhost,IP:127.0.0.1" # openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days 360 -copy_extensions copyall receivers: otlp: protocols: grpc: endpoint: localhost:4317 http: endpoint: localhost:4318 otlp/server: protocols: grpc: endpoint: localhost:4319 tls: client_ca_file: ca.crt cert_file: server.crt key_file: server.key exporters: otlp: endpoint: https://localhost:4319 tls: key_file: edge-cert.key cert_file: edge-cert.crt ca_file: ca.crt tpm: enabled: true path: /dev/tpmrm0 debug: verbosity: normal service: telemetry: metrics: address: localhost:8889 pipelines: metrics/client: receivers: [otlp] exporters: [otlp] metrics/server: receivers: [otlp/server] exporters: [debug] ``` <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.--> Signed-off-by: Pavol Loffay <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Link to tracking issue
Updates: #38682
Testing
Documentation