Skip to content

Commit fe994dd

Browse files
authored
[apm] Remove APM Server ApiKey CLI tool from docs. (#1415)
This method was removed in 9.0, see elastic/apm-server#14127
1 parent a4c1378 commit fe994dd

File tree

1 file changed

+1
-110
lines changed

1 file changed

+1
-110
lines changed

solutions/observability/apm/api-keys.md

Lines changed: 1 addition & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -161,122 +161,13 @@ You can now apply your newly created API keys in the configuration of each of yo
161161
* **Python agent**: [`api_key`](apm-agent-python://reference/configuration.md#config-api-key)
162162
* **Ruby agent**: [`api_key`](apm-agent-ruby://reference/configuration.md#config-api-key)
163163

164-
## Alternate API key creation methods [apm-configure-api-key-alternative]
164+
## Alternate API key creation method [apm-configure-api-key-alternative]
165165

166166
```{applies_to}
167167
stack:
168168
serverless: unavailable
169169
```
170170

171-
API keys can also be created and validated outside of {{kib}}:
172-
173-
* [APM Server API key workflow](#apm-create-api-key-workflow-apm-server)
174-
* [{{es}} API key workflow](#apm-create-api-key-workflow-es)
175-
176-
### APM Server API key workflow [apm-create-api-key-workflow-apm-server]
177-
178-
This API creation method only works with the APM Server binary.
179-
180-
::::{admonition} Deprecated in 8.6.0.
181-
:class: warning
182-
183-
Users should create API Keys through {{kib}} or the {{es}} REST API
184-
::::
185-
186-
APM Server provides a command line interface for creating, retrieving, invalidating, and verifying API keys. Keys created using this method can only be used for communication with APM Server.
187-
188-
#### `apikey` subcommands [apm-create-api-key-subcommands]
189-
190-
**`create`**
191-
: Create an API Key with the specified privilege(s). No required flags.
192-
193-
The user requesting to create an API Key needs to have APM privileges used by the APM Server. A superuser, by default, has these privileges.
194-
195-
::::{dropdown} Expand for more information on assigning these privileges to other users
196-
To create an APM Server user with the required privileges for creating and managing API keys:
197-
1. Create an **API key role**, called something like `apm_api_key`, that has the following `cluster` level privileges:
198-
199-
| Privilege | Purpose |
200-
| --- | --- |
201-
| `manage_own_api_key` | Allow APM Server to create, retrieve, and invalidate API keys |
202-
203-
2. Depending on what the **API key role** will be used for, also assign the appropriate `apm` application-level privileges:
204-
* To **receive Agent configuration**, assign `config_agent:read`.
205-
* To **ingest agent data**, assign `event:write`.
206-
* To **upload source maps**, assign `sourcemap:write`.
207-
::::
208-
209-
**`info`**
210-
: Query API Key(s). `--id` or `--name` required.
211-
212-
**`invalidate`**
213-
: Invalidate API Key(s). `--id` or `--name` required.
214-
215-
**`verify`**
216-
: Check if a credentials string has the given privilege(s). `--credentials` required.
217-
218-
#### Privileges [apm-create-api-key-privileges]
219-
220-
If privileges are not specified at creation time, the created key will have all privileges.
221-
222-
* `--agent-config` grants the `config_agent:read` privilege
223-
* `--ingest` grants the `event:write` privilege
224-
* `--sourcemap` grants the `sourcemap:write` privilege
225-
226-
#### Create an API key [apm-create-api-key-workflow]
227-
228-
Create an API key with the `create` subcommand.
229-
230-
The following example creates an API key with a `name` of `java-001`, and gives the "agent configuration" and "ingest" privileges.
231-
232-
```sh
233-
apm-server apikey create --ingest --agent-config --name java-001
234-
```
235-
236-
The response will look similar to this:
237-
238-
```console-result
239-
Name ........... java-001
240-
Expiration ..... never
241-
Id ............. qT4tz28B1g59zC3uAXfW
242-
API Key ........ rH55zKd5QT6wvs3UbbkxOA (won't be shown again)
243-
Credentials .... cVQ0dHoyOEIxZzU5ekMzdUFYZlc6ckg1NXpLZDVRVDZ3dnMzVWJia3hPQQ== (won't be shown again)
244-
```
245-
246-
You should always verify the privileges of an API key after creating it. Verification can be done using the `verify` subcommand.
247-
248-
The following example verifies that the `java-001` API key has the "agent configuration" and "ingest" privileges.
249-
250-
```sh
251-
apm-server apikey verify --agent-config --ingest --credentials cVQ0dHoyOEIxZzU5ekMzdUFYZlc6ckg1NXpLZDVRVDZ3dnMzVWJia3hPQQ==
252-
```
253-
254-
If the API key has the requested privileges, the response will look similar to this:
255-
256-
```console-result
257-
Authorized for privilege "event:write"...: Yes
258-
Authorized for privilege "config_agent:read"...: Yes
259-
```
260-
261-
To invalidate an API key, use the `invalidate` subcommand. Due to {{es}} caching, there may be a delay between when this subcommand is executed and when it takes effect.
262-
263-
The following example invalidates the `java-001` API key.
264-
265-
```sh
266-
apm-server apikey invalidate --name java-001
267-
```
268-
269-
The response will look similar to this:
270-
271-
```console-result
272-
Invalidated keys ... qT4tz28B1g59zC3uAXfW
273-
Error count ........ 0
274-
```
275-
276-
A full list of `apikey` subcommands and flags is available in the [API key command reference](/solutions/observability/apm/apm-server-command-reference.md#apm-apikey-command).
277-
278-
### {{es}} API key workflow [apm-create-api-key-workflow-es]
279-
280171
It is also possible to create API keys using the {{es}} [create API key API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-api-key).
281172

282173
This example creates an API key named `java-002`:

0 commit comments

Comments
 (0)