Skip to content

Commit c50d3f6

Browse files
authored
docs: instructions on how to create SDKs ApiKeys (#620)
1 parent 93132ef commit c50d3f6

File tree

1 file changed

+39
-7
lines changed

1 file changed

+39
-7
lines changed

extension/apmconfigextension/README.md

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/confi
123123

124124
#### Authentication settings
125125

126-
In addition to TLS, you can configure authentication to ensure that only authorized agents can communicate with the extension.
126+
In addition to TLS, you can configure authentication to ensure that only authorized agents can communicate with the extension and retrieve their corresponding remote configurations.
127127

128-
The apmconfig extension supports any [configauth authenticator](https://github.com/open-telemetry/opentelemetry-collector/blob/v0.125.0/config/configauth/README.md). We recommend using the [apikeyauth extension](https://github.com/elastic/opentelemetry-collector-components/tree/main/extension/apikeyauthextension) to authenticate with Elastic APM API keys (HTTP headers must include a valid API Key):
128+
The apmconfig extension supports any [configauth authenticator](https://github.com/open-telemetry/opentelemetry-collector/blob/v0.125.0/config/configauth/README.md). We recommend using the [apikeyauth extension](https://github.com/elastic/opentelemetry-collector-components/tree/main/extension/apikeyauthextension) to authenticate with Elasticsearch API keys:
129129

130130
```yaml
131131
extensions:
@@ -134,18 +134,50 @@ extensions:
134134
application_privileges:
135135
- application: "apm"
136136
privileges:
137-
- "event:write"
137+
- "config_agent:read"
138138
resources:
139139
- "-"
140140
apmconfig:
141141
opamp:
142142
protocols:
143143
http:
144-
endpoint: ":4320"
145-
tls:
146-
cert_file: server.crt
147-
key_file: server.key
148144
auth:
149145
authenticator: apikeyauth
150146
...
151147
```
148+
149+
The server will expect incoming HTTP requests to include an API key with sufficient privileges, using the following header format:
150+
```
151+
Authorization: ApiKey <base64(id:api_key)>
152+
```
153+
154+
An API key with the minimum required application permissions (as verified with the configuration above) can be created via Kibana by navigating to: `Observability → Applications → Settings → Agent Keys`, or by using the Elasticsearch Security API:
155+
156+
```
157+
POST /_security/api_key
158+
{
159+
"name": "apmconfig-opamp-test-sdk",
160+
"metadata": {
161+
"application": "apm"
162+
},
163+
"role_descriptors": {
164+
"apm": {
165+
"cluster": [],
166+
"indices": [],
167+
"applications": [
168+
{
169+
"application": "apm",
170+
"privileges": [
171+
"config_agent:read"
172+
],
173+
"resources": [
174+
"*"
175+
]
176+
}
177+
],
178+
"run_as": [],
179+
"metadata": {}
180+
}
181+
}
182+
}
183+
```

0 commit comments

Comments
 (0)