Kibana: Spaces, Roles & Privileges
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. |
Checked on 2026-11-09 against Kibana 9.5.x. Tested with Elasticsearch 9.5.6 and Kibana 9.5.6 in the hands-on lab (trial licence): the space, the two roles and the user alice were created with the requests below, and alice listed and created rules in the space.
To do this by hand, follow Spaces, Roles and Users.
Monitoring dashboards and alerts are shared artifacts, and sharing needs rules: who may look at the production dashboard, who may change an alert that wakes people up, and which team’s connectors a rule may use. Kibana answers with two independent mechanisms. Spaces partition the saved objects (dashboards, data views, rules, connectors) so that teams do not trip over each other, and roles decide what a user can do inside each space and on which Elasticsearch data. Confusing the two is the most common access mistake: a space does not protect data, and a role does not organize content. This page explains both, the privileges that matter for monitoring, and how to create them as code. The Grafana equivalent, with organizations, folders, teams and RBAC, is Users, Teams and Permissions.
Spaces
A space organizes content and users inside one Kibana. Each space has its own saved objects, users see only the spaces they have been granted, and a role can have different permissions in different spaces. Kibana creates a default space that cannot be deleted (it can be customized). Saved objects belong to the space where they were created; to move or duplicate them use Copy to spaces, or export and import (both create copies in the target space; there is no live sharing of one object between spaces). Rules and connectors are saved objects too: the connectors page describes managing the connectors of the current space, and the rule settings page applies flapping settings to all rules of a space, so a connector configured in one space is not offered to rules of another.
Source: Spaces (anchors #what-are-spaces, #default-space and
#space-scoped-objects),
Manage connectors and
Create and manage rules.
Creating a space takes a name, a description, a URL identifier and an avatar. The URL identifier cannot be changed later, so choose it
as you would a repository name. On the Stack you also choose a solution view and, for Classic, which features are visible. Limits differ:
Serverless allows up to 100 spaces; on the Stack the setting xpack.spaces.maxSpaces (default 1000) controls it. Managing spaces
needs the kibana_admin role on the Stack and the Admin role on Serverless. Deleting a space permanently removes the space and everything
in it.
Solution views (Stack only)
On the Elastic Stack (from 8.16), every space has its own navigation, the solution view, chosen when the space is created. It controls the navigation of every user in that space:
-
Observability: a lighter menu for analytics and Observability, the right choice for monitoring teams.
-
Search and Security: the equivalent lighter menus for those solutions.
-
Classic: all features of all solutions in the multi-layer classic menus, with feature visibility customizable one by one.
Solution views are documented for Stack deployments only; on Serverless the project type plays that role. A solution view is a navigation choice, not a permission: it changes what is shown, and privileges decide what works. Feature visibility in a Classic space is likewise a usability setting and not a security control: some management features may remain visible depending on privileges, so restrict access with roles.
Source: Spaces (anchors #solution-views, #creating-a-space,
#feature-visibility and #serverless-differences).
Addressing a space
Add /s/<space> right after the Kibana URL to work in a space. In the UI the same applies to every page; in the API it selects the space an
object is created in or read from:
curl -s -u elastic:"$ELASTIC_PASSWORD" \
"http://localhost:5601/s/bookshelf/api/saved_objects/_find?type=dashboard"
Requests without a space identifier go to the default space. A rule created with POST /s/bookshelf/api/alerting/rule therefore lives in the
bookshelf space, and the alerting API pages of this subsection always show the space prefix.
Reference: Spaces (anchor #url-and-api).
Creating the Bookshelf space
The lab uses one space for the Bookshelf team, with the Observability solution view. The Spaces API creates it (kbn-xsrf is a required CSRF
header; id accepts lowercase letters, numbers, underscores and hyphens; solution accepts security, oblt, es and classic):
curl -s -u elastic:"$ELASTIC_PASSWORD" -X POST "http://localhost:5601/api/spaces/space" \
-H "kbn-xsrf: true" -H "Content-Type: application/json" \
-d '{
"id": "bookshelf",
"name": "Bookshelf",
"description": "Bookshelf service dashboards, rules and connectors",
"solution": "oblt"
}'
The solution field is meant for Stack deployments, where solution views are documented. The response repeats the fields (id, name, description,
color, initials, disabledFeatures, imageUrl, solution).
Reference: Create a space API.
As Terraform, with the elastic/elasticstack provider:
resource "elasticstack_kibana_space" "bookshelf" {
space_id = "bookshelf"
name = "Bookshelf"
description = "Bookshelf service dashboards, rules and connectors"
solution = "oblt"
}
Reference: elasticstack_kibana_space
(the page also documents disabled_features, whose feature IDs come from the Features API, GET /api/features).
The later page Alerting APIs & Terraform puts the provider into context.
Roles and privileges
Elasticsearch security in general (realms, users, TLS, API keys) is covered in Elasticsearch security; this section is about the Kibana half and its interplay with the data.
A role has two halves. The Elasticsearch half grants cluster privileges and index privileges on named indices or data streams. The Kibana half is a
list of entries, each giving privileges on Kibana features in one or more spaces. A user gets the union of the roles assigned.
Roles can be managed in the UI (Stack Management, Security, Roles), through the role API, or in a roles.yml file; roles from the UI and API are stored in
an internal Elasticsearch index, while file-based roles live only in their file, cannot be edited through the UI or API, and win if
the same name exists in both. On Serverless, roles are custom roles of the Cloud organization instead.
Source: Defining roles.
Base, feature and sub-feature privileges
The Kibana half has three levels of detail:
-
Base privileges apply one level to all features:
all(read and write),read(read-only), or Customize to set each feature separately. Some features and sub-features are excluded from base privileges and must be granted explicitly. -
Feature privileges grant a specific feature:
all(full access, including actions and configuration),read(view only), ornone. Some features have noreadlevel. -
Sub-feature privileges refine
allandreadfor some features (Discover, Dashboard, Visualize library, Actions and Connectors, Fleet and others); the page says customizing sub-feature privileges is a subscription feature.
In the API, a Kibana entry has either base or feature, not both, plus the spaces it applies to. "spaces": ["*"] means all spaces
(All Spaces in the UI); a role granted on all spaces cannot be removed from one space’s settings, you must edit the role.
Some reserved roles can access every space and cannot be blocked from one.
Source: Kibana privileges (sections "Base privileges", "Feature privileges" and "Sub-feature privileges").
The features that matter for monitoring
| Feature (group) | What it controls |
|---|---|
Dashboard (Analytics) |
Access to and editing of dashboards. Adding visualizations or maps also needs the Visualize library or Maps privilege. Sub-features: short URLs, background searches, PDF/PNG reports and CSV reports from Discover session panels. |
Visualize library (Analytics) |
Access to and editing of visualizations, and adding them to dashboards. Sub-features: short URLs and PDF/PNG reports. |
Discover (Analytics) |
Access to Discover and managing Discover sessions. Sub-features include short URLs, background searches and CSV reports. |
Stack Rules (Management) |
Creating and managing Elastic Stack rules (the generic rule types, see Rules & Stack Rule Types). |
Rules Settings (Management) |
Settings that apply to all rules in a space; sub-features cover flapping detection and alert deletion. |
Maintenance Windows (Management) |
Creating and managing windows that suppress rule notifications for a scheduled period (Alert Lifecycle, Snooze & Maintenance Windows). |
Actions and Connectors (Management) |
Creating and managing connectors and running rule and case actions. A sub-feature grants the endpoint security Execute privilege. |
Stack Alerts / Observability Alerts |
Viewing alerts and per-alert actions (snooze, acknowledge) without the right to manage rules: |
Stack Management (Management) |
Advanced Settings, Data View Management, Saved Objects Management, Tag Management, Dev Tools and others. |
Fleet (Management) |
Fleet and the management of agents and agent policies. |
The Observability group holds the monitoring apps' own privileges (for example Infrastructure, APM, Logs, Synthetics and SLOs).
Creating Observability rules needs all on the Observability features of the rule type (for example APM, Logs, Infrastructure or
Synthetics), anomaly-detection rules also need Machine Learning privileges, and on Serverless the Editor role or higher is used for that purpose.
Source: Kibana privileges
(Analytics and Management groups),
Alerting setup (section "Security", anchor #required-privileges) and
Create and manage rules for Elastic Observability.
Privileges for alerting
The alerting setup page spells out what each job needs:
-
Manage rules and connectors (full):
allfor Stack Rules, Rules Settings and Actions and Connectors in Management. Creating a rule with the Cases connector also needsallfor Cases. Adding actions to a rule and testing connectors need onlyreadon Actions and Connectors. -
View rules only:
readfor the same three features. -
Triage without managing rules: Stack Alerts or Observability Alerts at
allorread. These do not allow creating, editing, enabling, disabling or deleting rules, and viewing rule statistics or rule details also needs rule read access. -
See alerts in Discover or dashboards: the
readindex privilege on.alerts-*. -
Revoke access: set the three Management features to
noneand remove index privileges on.alerts-*. -
Some rule types need more: Machine Learning, Stack Monitoring (the
monitoring_userrole) or Observability features.
A further rule matters more than any single privilege. A rule runs in the background with an API key that captures the privileges of the user who created or
last edited it. Kibana creates the Elasticsearch API key when the rule is saved and updates it on every edit; if a user who lacks, say, the
index privileges on logs-* edits the rule, the rule stops working, and if someone with more privileges edits it, it runs with the higher ones.
The key survives disabling and re-enabling the rule; an imported rule must be enabled to get a new key; and Update API key in the rule’s
menu regenerates it. For production, own critical rules with a dedicated service user whose roles are exactly what the rules need, and
avoid having personal accounts edit them. Serverless creates the key from the roles of the saving user in the same way.
Source: Alerting setup (anchors #required-privileges
and #api-keys). The API key lifecycle is continued in
Alerting Setup, Security & Scaling.
Spaces do not protect data
Kibana spaces control which saved objects a user sees; they do not restrict the underlying Elasticsearch indices. The SLO access guide, a
page of the frozen 8.x documentation, says it directly: Kibana spaces control which SLOs a user
can see, but they do not restrict access to the underlying Elasticsearch indices. The data side of access is the Elasticsearch half of the role. If
two teams must not read each other’s logs, give each team a role whose index privileges name only its own data streams (for example
logs-bookshelf.*), and add document- or field-level security only on subscriptions that provide it.
Source: Configure SLO access (frozen 8.x documentation).
Roles as code: the Bookshelf access model
The lab defines two roles in the bookshelf space. bookshelf-viewer reads dashboards and data, and bookshelf-sre (the owning team bookshelf-sre) builds
dashboards and manages rules, connectors and maintenance windows there. The role API call below uses base privileges, which is the simplest model: the
viewer gets read and the team gets all in the space. Both get read access to the telemetry data streams and to .alerts-*.
curl -s -u elastic:"$ELASTIC_PASSWORD" -X PUT "http://localhost:5601/api/security/role/bookshelf-viewer" \
-H "kbn-xsrf: true" -H "Content-Type: application/json" \
-d '{
"description": "Read Bookshelf dashboards, alerts and telemetry",
"elasticsearch": {
"cluster": [],
"indices": [
{ "names": ["logs-*", "metrics-*", "traces-*", ".alerts-*"], "privileges": ["read", "view_index_metadata"] }
]
},
"kibana": [ { "base": ["read"], "feature": {}, "spaces": ["bookshelf"] } ]
}'
curl -s -u elastic:"$ELASTIC_PASSWORD" -X PUT "http://localhost:5601/api/security/role/bookshelf-sre" \
-H "kbn-xsrf: true" -H "Content-Type: application/json" \
-d '{
"description": "Build Bookshelf dashboards and manage its rules and connectors",
"elasticsearch": {
"cluster": [],
"indices": [
{ "names": ["logs-*", "metrics-*", "traces-*", ".alerts-*"], "privileges": ["read", "view_index_metadata"] }
]
},
"kibana": [ { "base": ["all"], "feature": {}, "spaces": ["bookshelf"] } ]
}'
The kbn-xsrf header is required, the role name is 1 to 1024 characters, createOnly=true stops an existing role from being overwritten, and the call needs
the manage_security cluster privilege. A successful call returns an empty response. To assign a user, create it in Elasticsearch:
curl -s -u elastic:"$ELASTIC_PASSWORD" -X POST "http://localhost:9200/_security/user/alice" \
-H "Content-Type: application/json" \
-d '{"password":"change-me-lab-only","roles":["bookshelf-sre"],"full_name":"Alice (Bookshelf SRE)"}'
For least privilege, replace base by feature entries. The privileges page shows the feature form, naming for example visualize_v2 and dashboard_v2
(with url_create as a sub-feature of dashboards); list every feature ID of the running version with GET /api/features instead of guessing:
"kibana": [
{
"base": [],
"feature": { "dashboard_v2": ["all"], "visualize_v2": ["all"] },
"spaces": ["bookshelf"]
}
]
Reference: Create or update a role API and
Kibana privileges (role API example, marketing space).
The Elasticsearch user API is in the Elasticsearch API reference.
The same roles as Terraform. The provider’s documentation says a kibana block takes either base or feature blocks, not both, and spaces is required in
every kibana block:
resource "elasticstack_kibana_security_role" "bookshelf_sre" {
name = "bookshelf-sre"
elasticsearch {
indices {
names = ["logs-*", "metrics-*", "traces-*", ".alerts-*"]
privileges = ["read", "view_index_metadata"]
}
}
kibana {
base = ["all"]
spaces = ["bookshelf"]
}
}
Reference: elasticstack_kibana_security_role.
What can go wrong
-
Spaces treated as a security boundary. Anyone whose role allows reading
logs-*can read the data from Discover or the API in any space, and hidden features are only hidden. -
Rules silently losing power. A rule edited by a user with fewer index privileges stops finding data (a "no data" symptom), and one edited by an administrator quietly runs with administrator privileges. Check Rules for the last editor and use a service user.
-
Wrong URL identifier. It cannot be changed; recreate the space and copy the objects.
-
Connectors missing in a space. A rule in a new space cannot use a connector defined in another one; create the connector in each space.
-
Forgetting
.alerts-*. Users with dashboard access but no read privilege on.alerts-*see empty alert panels. -
Base privileges and excluded features. Some features and sub-features are excluded from base privileges; a role that "has all" may still lack them.
-
Reserved roles. Users with a reserved role that can access all spaces cannot be blocked from one space.
Verify it in the lab
-
Create the space with the Spaces API above and open
http://localhost:5601/s/bookshelf/app/dashboards; the navigation follows the Observability solution view. -
Create
bookshelf-viewer,bookshelf-sreand the useralice; log in asaliceand check that she sees thebookshelfspace and thatStack Managementlets her manage rules and connectors there. -
As the
elasticuser, create a dashboard in the default space; asalicecheck that it is not listed inbookshelf(curl -s -u alice:change-me-lab-only "http://localhost:5601/s/bookshelf/api/saved_objects/_find?type=dashboard"). -
Remove
.alerts-*frombookshelf-viewer, assign it to another user, and confirm alert panels become empty; restore it. -
After the rule pages of this subsection create the first rule, edit it as another user with fewer privileges and compare the result: the rule runs with the privileges of whoever saved it last.
Source: Spaces and Alerting setup.
In the books
Kibana 8.x: A Quick Start Guide to Data Analysis (Shah, chapter 2, Kibana 8.11) is the only provided book that covers spaces: it creates an Analyst and an Engineer space from the Spaces management page, names the space and its URL identifier, unchecks the Dashboard and Canvas features for a space, and notes that saved objects can be shared across spaces, deferring role-based access control to later chapters. Those steps still work; what changed is the solution views of 8.16 and later, which replace much of the feature unchecking, and the rule that feature visibility is not security. The role and privilege model (base and feature privileges, API keys captured by rules) is not in the books, so this page relies on the official documentation. Publisher pages are in the bibliography.