Guides
Keys and roles
Three roles: admin, viewer and gateway. What each can do, and how keys are created and revoked.
Access to the control plane is by key. Every key belongs to one organisation and has one role. The role is checked by the server on every request, so a hidden button is never the only thing standing between a viewer and a change.
#Roles
| Role | Intended for | Can |
|---|---|---|
| admin | The people who manage Rakuvo | Everything: change layer settings, create and revoke keys, manage alert rules, and read all data. |
| viewer | Anyone who needs to see it | Read the summary, charts, runs, memory graph, alerts and usage. Cannot change anything. |
| gateway | A running gateway | Pull the configuration and send traces and memory facts. Cannot read the dashboard data. |
#Creating a key
In Team, choose a name and a role. The secret is shown once, when the key is created, and cannot be shown again, so copy it then. Over the API:
curl -X POST "$RAKUVO_API_URL/v1/keys" \ -H "Authorization: Bearer $ADMIN_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "prod gateway", "role": "gateway" }'#Revoking a key
Revoke it in Team, or with DELETE /v1/keys/{id}. It stops working immediately. Create a replacement first when it is a gateway key, so the gateway can be restarted with the new one.
#Good practice
- Give each gateway its own gateway key. A leaked one can only send data and pull settings.
- Give people viewer keys unless they need to change settings.
- Name keys after what uses them, so a revoked key is easy to identify.
- Keys are not personal accounts. Named users, email invitations and single sign-on are not part of the product yet.
#Which routes need which role
| Route | admin | viewer | gateway |
|---|---|---|---|
GET /v1/config | yes | yes | yes |
PUT /v1/config | yes | no | no |
GET, POST, DELETE /v1/keys | yes | no | no |
GET /v1/summary, /v1/series, /v1/runs, /v1/usage, /v1/alerts | yes | yes | no |
GET /v1/memory/graph | yes | yes | no |
POST /v1/alerts/rules, PUT and DELETE on a rule | yes | no | no |
POST /v1/ingest/events, POST /v1/ingest/memory | yes | no | yes |