Debian Codegraph @

config/configauth/README.md

raw
1 # Authentication configuration
2
3 This module defines necessary interfaces to implement server and client type authenticators:
4
5 - Server type authenticators perform authentication for incoming HTTP/gRPC requests and are typically used in receivers.
6 - Client type authenticators perform client-side authentication for outgoing HTTP/gRPC requests and are typically used in exporters.
7
8 The currently known authenticators are listed below.
9
10 ## Server Authenticators
11
12 - [Basic Auth Extension](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/basicauthextension)
13 - [Bearer Token Extension](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/bearertokenauthextension)
14 - [OIDC Extension](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/oidcauthextension)
15
16 ## Client Authenticators
17
18 - [ASAP Client Authentication Extension](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/asapauthextension)
19 - [Basic Auth Extension](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/basicauthextension)
20 - [Bearer Token Extension](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/bearertokenauthextension)
21 - [OAuth2 Client Extension](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/oauth2clientauthextension)
22 - [Sigv4 Extension](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/sigv4authextension)
23
24 Example:
25
26 ```yaml
27 extensions:
28 oidc:
29 # see the blog post on securing the otelcol for information
30 # on how to setup an OIDC server and how to generate the TLS certs
31 # required for this example
32 # https://medium.com/opentelemetry/securing-your-opentelemetry-collector-1a4f9fa5bd6f
33 issuer_url: http://localhost:8080/auth/realms/opentelemetry
34 audience: account
35
36 oauth2client:
37 client_id: someclientid
38 client_secret: someclientsecret
39 token_url: https://example.com/oauth2/default/v1/token
40 scopes: ["api.metrics"]
41 # tls settings for the token client
42 tls:
43 insecure: true
44 ca_file: /var/lib/mycert.pem
45 cert_file: certfile
46 key_file: keyfile
47 # timeout for the token client
48 timeout: 2s
49
50 receivers:
51 otlp/with_auth:
52 protocols:
53 grpc:
54 endpoint: localhost:4318
55 tls:
56 cert_file: /tmp/certs/cert.pem
57 key_file: /tmp/certs/cert-key.pem
58 auth:
59 ## oidc is the extension name to use as the authenticator for this receiver
60 authenticator: oidc
61
62 otlphttp/withauth:
63 endpoint: http://localhost:9000
64 auth:
65 authenticator: oauth2client
66
67 ```
68
69 ## Creating an authenticator
70
71 New authenticators can be added by creating a new extension that also implements the appropriate interface (`configauth.ServerAuthenticator` or `configauth.ClientAuthenticator`).
72
73 Generic authenticators that may be used by a good number of users might be accepted as part of the contrib distribution. If you have an interest in contributing an authenticator, open an issue with your proposal. For other cases, you'll need to include your custom authenticator as part of your custom OpenTelemetry Collector, perhaps being built using the [OpenTelemetry Collector Builder](https://github.com/open-telemetry/opentelemetry-collector/tree/main/cmd/builder).