Elastic Fleet
ReadonlyREST settings
readonlyrest:
access_control_rules:
# 1. Kibana user - used by Kibana itself and by Fleet initialisation scripts.
# No action or index restriction; Kibana needs unrestricted access during
# Fleet setup (e.g. bootstrapping the Fleet Server service account).
- name: "KIBANA"
type: allow
auth_key: kibana:kibana
# 2. Fleet Server - authenticates using an Elasticsearch service token.
# ReadonlyREST validates the token against Elasticsearch's service account API.
# No action restriction: Fleet Server needs to call
# cluster:admin/xpack/security/api_key/create to issue API keys to
# enrolling agents.
- name: "Fleet server"
type: allow
token_authentication:
type: "service-token"
username: "fleet"
indices:
- ".fleet-servers"
- ".fleet-agents"
- ".fleet-actions"
- ".fleet-policies"
- ".fleet-policies-leader"
- ".fleet-enrollment-api-keys"
# 3. Elastic Agents - each agent authenticates with its own API key, issued
# and rotated by Fleet Server. ReadonlyREST validates the key against Elasticsearch
# and grants access to the observability data-stream indices.
- name: "Agents"
type: allow
token_authentication:
type: "api-key"
username: "fleet"
indices:
- ".apm-agent-configuration"
- "metrics-*"
- "traces-*"
- "logs-*"
# 4. Forbid direct token management - only Kibana and Fleet Server (matched
# above) should create or revoke service tokens and API keys. This block
# denies these actions for everyone else.
- name: "Forbid access to service accounts and API keys"
type: forbid
actions:
- "cluster:admin/xpack/security/service_account/*"
- "cluster:admin/xpack/security/api_key/*"
# 5. Admin user - full Kibana access.
- name: "Admins"
type: allow
auth_key: admin:admin
kibana:
access: adminHow Fleet credentials flow through ReadonlyREST
Why the forbid block is necessary
forbid block is necessaryCredential rotation
Setting up Fleet Server and Elastic Agent
Running the example
Last updated