-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Controls - Role Management API Docs #34854
Changes from 7 commits
dfd4c99
32026f3
e2281d8
6234e84
0064bea
15a0437
2feb129
9d85329
92af0ad
ec6a85c
8bbee63
f99efcc
323608b
4e89fa5
f43cd7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,9 +32,39 @@ that begin with `_` are reserved for system usage. | |
`elasticsearch`:: (object) Optional {es} cluster and index privileges, valid keys are | ||
`cluster`, `indices` and `run_as`. For more information, see {xpack-ref}/defining-roles.html[Defining Roles]. | ||
|
||
`kibana`:: (object) An object that specifies the <<kibana-privileges>>. Valid keys are `global` and `space`. Privileges defined in the `global` key will apply to all spaces within Kibana, and will take precedent over any privileges defined in the `space` key. For example, specifying `global: ["all"]` will grant full access to all spaces within Kibana, even if the role indicates that a specific space should only have `read` privileges. | ||
`kibana`:: (array) An array of objects that specifies the <<kibana-privileges>> for this role: | ||
[source,js] | ||
-------------------------------------------------- | ||
[{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rather than explain all this in prose, I thought it'd be easier to understand if I just had a well-documented JSON snippet instead. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a good idea. However, some of the lines are hard to read because of horizontal scrolling. I made an attempt to edit them down. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My only concern is that we can't link to the "Kibana Privileges" section when using comments within the JSON. Perhaps we could mirror the way that Elasticsearch's role API docs implement the "index privileges": https://www.elastic.co/guide/en/elasticsearch/reference/7.0/security-api-put-role.html |
||
// An optional base privilege. | ||
// If specified, must either be ["all"] or ["read"]. | ||
// You can't revoke or downgrade privileges via the `feature` section. | ||
// "all" grants read/write access to all Kibana features for the specified spaces. | ||
// "read" grants read-only access to all Kibana features for the specified spaces. | ||
"base": [], | ||
|
||
// Object containing privileges for specific features. | ||
// Privileges are added to the base privilege, if one is provided. | ||
// For example, specifying `base: ["read"]` grants users read access to every feature, | ||
// even if they aren't granted anything in this feature section. | ||
legrego marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Use the Features API to retrieve a list of available features. <1> | ||
"feature": { | ||
"advancedSettings": ["all"], | ||
"discover": ["all"], | ||
"visualize": ["all"], | ||
"dashboard": ["read"] | ||
}, | ||
|
||
// The spaces these privileges should be applied to. | ||
// To grant access to all spaces, set this to `["*"]`, or omit the value. | ||
"spaces": ["default", "marketing", "sales"] | ||
}] | ||
-------------------------------------------------- | ||
|
||
<1> <<features-api>> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: This relies on the Features API docs created in #34575 |
||
|
||
===== Example | ||
===== Example 1 | ||
Granting read access to all features in all spaces, with full access to Advanced Settings. | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
|
@@ -54,22 +84,60 @@ PUT /api/security/role/my_kibana_role | |
"query" : "{\"match\": {\"title\": \"foo\"}}" | ||
} ] | ||
}, | ||
"kibana": { | ||
"global": ["all"] | ||
} | ||
"kibana": [ | ||
{ | ||
"base": [ | ||
"read" | ||
], | ||
"feature": { | ||
"advancedSettings": ["all"] | ||
}, | ||
"spaces": [ | ||
"*" | ||
] | ||
} | ||
] | ||
} | ||
-------------------------------------------------- | ||
// KIBANA | ||
|
||
==== Response | ||
|
||
A successful call returns a response code of `204` and no response body. | ||
===== Example 2 | ||
Granting "dashboard only" access to only the Marketing space. | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
PUT /api/security/role/my_kibana_role | ||
{ | ||
"metadata" : { | ||
"version" : 1 | ||
}, | ||
"elasticsearch": { | ||
legrego marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"cluster" : [ "all" ], | ||
"indices" : [ { | ||
"names" : [ "index1", "index2" ], | ||
"privileges" : [ "all" ], | ||
"field_security" : { | ||
"grant" : [ "title", "body" ] | ||
}, | ||
"query" : "{\"match\": {\"title\": \"foo\"}}" | ||
} ] | ||
}, | ||
"kibana": [ | ||
{ | ||
"base": [], | ||
"feature": { | ||
"dashboard": ["read"] | ||
}, | ||
"spaces": [ | ||
"marketing" | ||
] | ||
} | ||
] | ||
} | ||
-------------------------------------------------- | ||
|
||
==== Granting access to specific spaces | ||
To grant access to individual spaces within {kib}, specify the space identifier within the `kibana` object. | ||
|
||
Note: granting access | ||
===== Example 3 | ||
Granting full access to all features in the Default space. | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
|
@@ -89,12 +157,19 @@ PUT /api/security/role/my_kibana_role | |
"query" : "{\"match\": {\"title\": \"foo\"}}" | ||
} ] | ||
}, | ||
"kibana": { | ||
"global": [], | ||
"space": { | ||
"marketing": ["all"], | ||
"engineering": ["read"] | ||
"kibana": [ | ||
{ | ||
"base": ["all"], | ||
"feature": { | ||
}, | ||
"spaces": [ | ||
"default" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
-------------------------------------------------- | ||
|
||
==== Response | ||
|
||
A successful call returns a response code of `204` and no response body. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,30 @@ | |
[[kibana-privileges]] | ||
=== Kibana privileges | ||
legrego marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
This section lists the Kibana privileges that you can assign to a role. | ||
Privileges have levels that you can use to manage which features users can access. Roles have privileges to determine whether users have write or read access. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of trying to discuss the concept of "levels", would it simplify this to just have two sections: "Base privileges" and "Feature privileges"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that's perfect, since we won't be referencing this from the "Role Management UI docs", do you mind integrating this within the role api docs themselves? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll make those changes, but I'd prefer to wait on integrating until we have the rest of the doc updates in place: we have almost 10 references to this section today, so I want to see what those sections look like after we've updated them for Feature Controls. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kobelb Last we talked, we had discussed including more context here to help users understand where this is used. What are your thoughts on something like this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like it! |
||
|
||
For more information and examples, consult the <<role-management-api-put, Role Management API>>. | ||
|
||
==== Privilege levels | ||
|
||
You can assign privileges the following levels: | ||
|
||
[horizontal] | ||
`base`:: | ||
legrego marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Grants access to all available features in Kibana (Discover, Visualize, Dashboard, and so on). | ||
|
||
`feature`:: | ||
Grants access to a specific feature. | ||
|
||
|
||
==== Role privileges | ||
|
||
You can assign a role these privileges: | ||
|
||
[horizontal] | ||
legrego marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[[kibana-privileges-all]] | ||
`all`:: | ||
All Kibana privileges, can read, write and delete saved searches, dashboards, visualizations, | ||
short URLs, Timelion sheets, graph workspaces, index patterns and advanced settings. | ||
Grants full read-write access. | ||
|
||
`read`:: | ||
Can read saved searches, dashboards, visualizations, short URLs, Timelion sheets, graph workspaces, | ||
index patterns, and advanced settings. | ||
Grants read-only access. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feature list might be overkill, but I wanted to show an example of a really customized role definition. I can scale it back if that'd be better.