Skip to content

Commit 4e752ac

Browse files
eedugonkosabogi
andauthored
[D&M] ECE roles tokens pages merged (#528)
This PR merges the content of the original docs: https://www.elastic.co/guide/en/cloud-enterprise/current/ece-generate-roles-token.html https://www.elastic.co/guide/en/cloud-enterprise/current/ece-revoke-roles-token.html Into a doc named "manage roles tokens" --------- Co-authored-by: kosabogi <[email protected]>
1 parent 204f23c commit 4e752ac

File tree

4 files changed

+89
-96
lines changed

4 files changed

+89
-96
lines changed
Lines changed: 89 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,103 @@
11
---
2+
applies_to:
3+
deployment:
4+
ece: all
25
mapped_urls:
36
- https://www.elastic.co/guide/en/cloud-enterprise/current/ece-generate-roles-token.html
47
- https://www.elastic.co/guide/en/cloud-enterprise/current/ece-revoke-roles-token.html
58
---
69

7-
# Generate roles tokens
10+
# Manage roles tokens
811

9-
% What needs to be done: Refine
12+
At the end of the {{ece}} installation process on the first host, you are provided with a roles token. This token can be used to install {{ece}} on additional hosts, but it does not include any role permissions.
1013

11-
% GitHub issue: https://github.com/elastic/docs-projects/issues/339
14+
You can [assign roles](./assign-roles-to-hosts.md) to the additional hosts through the Cloud UI later on, but this role assignment is a manual process.
1215

13-
% Scope notes: merge these two pages
16+
For automation purposes, you need to generate a new *ephemeral* or *persistent* token with the right role permissions, so that you can install {{ece}} on hosts and add the right roles at the same time.
1417

15-
% Use migrated content from existing pages that map to this page:
18+
This section covers the different types of tokens and the following tasks:
1619

17-
% - [ ] ./raw-migrated-files/cloud/cloud-enterprise/ece-generate-roles-token.md
18-
% - [ ] ./raw-migrated-files/cloud/cloud-enterprise/ece-revoke-roles-token.md
20+
* [Generate roles tokens](#ece-generate-roles-token)
21+
* [Revoke roles tokens](#ece-revoke-roles-token)
1922

20-
⚠️ **This page is a work in progress.** ⚠️
23+
## Ephemeral and persistent roles tokens
2124

22-
The documentation team is working to combine content pulled from the following pages:
25+
Ephemeral and persistent tokens differ as follows:
2326

24-
* [/raw-migrated-files/cloud/cloud-enterprise/ece-generate-roles-token.md](/raw-migrated-files/cloud/cloud-enterprise/ece-generate-roles-token.md)
25-
* [/raw-migrated-files/cloud/cloud-enterprise/ece-revoke-roles-token.md](/raw-migrated-files/cloud/cloud-enterprise/ece-revoke-roles-token.md)
27+
Ephemeral token
28+
: Available for use during {{ece}} installation on additional hosts for one hour before the token is revoked automatically. Cannot be revoked manually.
29+
30+
Persistent token
31+
: Available for use during {{ece}} installation on additional hosts indefinitely. Can be revoked at any time.
32+
33+
The permitted roles are the same as those you can [assign in the Cloud UI](./assign-roles-to-hosts.md):
34+
35+
`allocator`
36+
: Allocates the available computing resources to Elasticsearch nodes or Kibana instances. In larger installations, a majority of the machines will be allocators.
37+
38+
`coordinator`
39+
: Serves as a distributed coordination system and resource scheduler.
40+
41+
`proxy`
42+
: Manages communication between a user and an Elasticsearch or Kibana instance.
43+
44+
`director`
45+
: Manages the ZooKeeper datastore. This role is typically shared with the coordinator role. In production deployments it can be separated from a coordinator.
46+
47+
## Generate roles tokens [ece-generate-roles-token]
48+
49+
To generate an ephemeral token for additional allocators:
50+
51+
```sh
52+
curl -H 'Content-Type: application/json' -u USER:PASSWORD https://COORDINATOR_HOST_IP:12443/api/v1/platform/configuration/security/enrollment-tokens -d '{ "persistent": false, "roles": [ "allocator"] }'
53+
{
54+
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0Njk3N2I3ZC1hM2U2LTQ2MDUtYjcwZC0xNzIzMTI5YWY4ZTQiLCJyb2xlcyI6WyJwcm94eSIsImFsbG9jYXRvciJdLCJpc3MiOiJib290c3RyYXAtaW5pdGlhbCIsImV4cCI6MTQ5MzY0NjIxM30.xsaRb72CsNMuXKy6Y-PJgqLc0qmjCljlB4Smcx_MRxg"
55+
}
56+
```
57+
58+
To generate a persistent token for additional allocators:
59+
60+
```sh
61+
curl -H 'Content-Type: application/json' -u USER:PASSWORD https://COORDINATOR_HOST_IP:12443/api/v1/platform/configuration/security/enrollment-tokens -d '{ "persistent": true, "roles": [ "allocator"] }'
62+
{
63+
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0Yzg5OTBkZi0xZmI3LTQ4MjAtYjg2OC02YmM5ZTg4NjA4MTQiLCJyb2xlcyI6WyJwcm94eSIsImFsbG9jYXRvciJdLCJpc3MiOiJib290c3RyYXAtaW5pdGlhbCJ9.mfTkO4j8uZJ-qwB2jmBuMScyYfLmcJpvKgSTLx2WV24",
64+
"token_id": "4c8990df-1fb7-4820-b868-6bc9e8860814"
65+
}
66+
```
67+
68+
## Revoke roles tokens [ece-revoke-roles-token]
69+
70+
At the end of the {{ece}} installation process on the first host, you are provided with a roles token. You can also generate new roles tokens yourself, either as ephemeral tokens that get deleted after 24 hours or as persistent tokens that get stored by {{ece}}. These tokens enable additional hosts to join an {{ece}} installation and should be kept secure or deleted if they are no longer needed.
71+
72+
If you delete all tokens and need to add more hosts to your installation, you should generate a new token first.
73+
74+
::::{important}
75+
During installation, an emergency token gets generated that enables you to install {{ece}} on additional hosts with all roles already assigned, except the allocator role. The emergency token can save your installation if all coordinators fail or are removed and you can no longer use the Cloud UI or the RESTful API. You should not delete this token. To learn more, check [Using the Emergency Roles Token](/troubleshoot/deployments/cloud-enterprise/use-emergency-roles-token.md).
76+
::::
77+
78+
To delete a token:
79+
80+
1. Retrieve the list of available tokens through the RESTful API :
81+
82+
```sh
83+
curl -u USER:PASSWORD https://localhost:12443/api/v1/platform/configuration/security/enrollment-tokens
84+
{
85+
"tokens": [{
86+
"token_id": "5f9cad2f-c6e7-4ee2-8f6e-53225df45be5",
87+
"roles": []
88+
}, {
89+
"token_id": "4c8990df-1fb7-4820-b868-6bc9e8860814",
90+
"roles": ["proxy", "allocator"]
91+
}]
92+
}
93+
```
94+
95+
2. Use the token ID to delete the tokens you no longer need: `4c8990df-1fb7-4820-b868-6bc9e8860814`:
96+
97+
```sh
98+
curl -XDELETE -u USER:PASSWORD 'https://localhost:12443/api/v1/platform/configuration/security/enrollment-tokens/4c8990df-1fb7-4820-b868-6bc9e8860814'
99+
{
100+
}
101+
```
102+
103+
3. Optional: To check that the token has been deleted, repeat Step 1 and make sure that the token is no longer listed.

raw-migrated-files/cloud/cloud-enterprise/ece-generate-roles-token.md

Lines changed: 0 additions & 45 deletions
This file was deleted.

raw-migrated-files/cloud/cloud-enterprise/ece-revoke-roles-token.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

raw-migrated-files/toc.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ toc:
4040
- file: cloud/cloud-enterprise/ece-create-deployment.md
4141
- file: cloud/cloud-enterprise/ece-delete-deployment.md
4242
- file: cloud/cloud-enterprise/ece-find.md
43-
- file: cloud/cloud-enterprise/ece-generate-roles-token.md
4443
- file: cloud/cloud-enterprise/ece-getting-started-node-js.md
4544
- file: cloud/cloud-enterprise/ece-getting-started-python.md
4645
- file: cloud/cloud-enterprise/ece-getting-started-search-use-cases-beats-logstash.md
@@ -60,7 +59,6 @@ toc:
6059
- file: cloud/cloud-enterprise/ece-restful-api-examples-configuring-keystore.md
6160
- file: cloud/cloud-enterprise/ece-restore-across-clusters.md
6261
- file: cloud/cloud-enterprise/ece-restore-deployment.md
63-
- file: cloud/cloud-enterprise/ece-revoke-roles-token.md
6462
- file: cloud/cloud-enterprise/ece-secure-clusters-kerberos.md
6563
- file: cloud/cloud-enterprise/ece-secure-clusters-oidc.md
6664
- file: cloud/cloud-enterprise/ece-securing-clusters-ad.md

0 commit comments

Comments
 (0)