Skip to content

Commit 1ad3056

Browse files
Update EDOT collector auth snippet (#487)
* Update EDOT collector auth snippet * Update API key request
1 parent 4015503 commit 1ad3056

File tree

1 file changed

+44
-3
lines changed

1 file changed

+44
-3
lines changed

docs/reference/central-configuration.md

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,51 @@ To activate {{product.apm-agent}} Central Configuration for EDOT SDKs, follow th
6565

6666
You need a valid {{es}} API key to authenticate to the {{es}} endpoint.
6767

68-
::::{include} _snippets/retrieve-credentials.md
69-
::::
68+
:::::
69+
70+
:::::{step} Create an Elasticsearch API key for central configuration
71+
72+
Create an API key with the `config_agent:read` privilege. This API key will be used by EDOT SDKs and validated by the Collector.
73+
74+
Use the following API request to generate the key:
7075

71-
Make sure the API key has `config_agent:read` permissions and resources set to `-`.
76+
```json
77+
POST /_security/api_key
78+
{
79+
"name": "apmconfig-opamp-test-sdk",
80+
"metadata": {
81+
"application": "apm"
82+
},
83+
"role_descriptors": {
84+
"apm": {
85+
"cluster": [],
86+
"indices": [],
87+
"applications": [
88+
{
89+
"application": "apm",
90+
"privileges": [
91+
"config_agent:read"
92+
],
93+
"resources": [
94+
"*"
95+
]
96+
}
97+
],
98+
"run_as": [],
99+
"metadata": {}
100+
}
101+
}
102+
}
103+
```
104+
105+
::::{note}
106+
The EDOT Collector doesn't store or embed the {{es}} API key.
107+
108+
Each EDOT SDK must send its own API key in the `Authorization` header (for example: `Authorization: ApiKey <Base64(id:key)>`).
109+
110+
The `apikeyauth` extension only validates this API key against {{es}}, ensuring it includes the `config_agent:read` privilege with `resources: ["*"]`.
111+
::::
112+
:::::
72113

73114
::::{dropdown} Example JSON payload
74115
```json

0 commit comments

Comments
 (0)