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

New component: jwtauthextension #30322

Closed
2 tasks
pjachowi opened this issue Jan 7, 2024 · 7 comments
Closed
2 tasks

New component: jwtauthextension #30322

pjachowi opened this issue Jan 7, 2024 · 7 comments
Labels
needs triage New item requiring triage Sponsor Needed New component seeking sponsor Stale

Comments

@pjachowi
Copy link
Contributor

pjachowi commented Jan 7, 2024

The purpose and use-cases of the new component

Exposing OTEL collector to public network requires authentication mechanism preventing unauthorized users from populating their data. One option, described here by Juraci Paixão Kröhling consists of

  • using oauth2client extension on sender side to obtain openid token, and
  • oidc extension on receivere's side to validate the openid token

The problem I encounter is that my authorization service in the client credentials flow can issue only jwt access token, which cannot be validated by the oidc extension.

To support jwt access token validation I created the jwtauth extension validating jwt access tokens.

Example configuration for the component

extensions:
      jwtauthextension:
        issuer_url: https://token_validator.com/
        jwks_path: ext/oauth/jwks
        scopes: [otelproxy]

Telemetry data types supported

Traces, metrics, logs.

Is this a vendor-specific component?

  • This is a vendor-specific component
  • If this is a vendor-specific component, I am proposing to contribute and support it as a representative of the vendor.

Code Owner(s)

No response

Sponsor (optional)

No response

Additional context

No response

@pjachowi pjachowi added needs triage New item requiring triage Sponsor Needed New component seeking sponsor labels Jan 7, 2024
@jpkrohling
Copy link
Member

can issue only jwt access token, which cannot be validated by the oidc extension.

Can you expand on that? The OIDC authenticator does validate JWT tokens.

@pjachowi
Copy link
Contributor Author

pjachowi commented Jan 11, 2024 via email

@pjachowi
Copy link
Contributor Author

Here is how my token looks like. The code

import jwt
jwt.decode(bearer, options={"verify_signature": False})

Prints

{'scope': ['<redacted>', '<redacted>', '<redacted>'],
 'authorization_details': [],
 'client_id': '<redacted>',
 'iss': 'https://<redacted>:443',
 'aud': '<redacted>',
 'exp': 1705050729}

@pjachowi
Copy link
Contributor Author

Did I answer you question @jpkrohling ?

@jpkrohling
Copy link
Member

Yes, you don't want to have a different validation, you want to skip validation altogether:

which cannot be validated by the oidc extension

vs.

options={"verify_signature": False}

I'm somewhat puzzled by why you'd want an authentication token that can't be validated. Wouldn't an adversary just need to create a simple JSON and impersonate a service of yours?

Copy link
Contributor

github-actions bot commented Apr 1, 2024

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@pjachowi
Copy link
Contributor Author

pjachowi commented Apr 7, 2024

Yes, you don't want to have a different validation, you want to skip validation altogether:

which cannot be validated by the oidc extension

vs.

options={"verify_signature": False}

I'm somewhat puzzled by why you'd want an authentication token that can't be validated. Wouldn't an adversary just need to create a simple JSON and impersonate a service of yours?

I checked again and now the combination of auth2client and oidc works as expected. Sorry for the confusion, I'm closing the issue.

@pjachowi pjachowi closed this as completed Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage New item requiring triage Sponsor Needed New component seeking sponsor Stale
Projects
None yet
Development

No branches or pull requests

2 participants