-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Add new predefined reserved roles #71710
Changes from 4 commits
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 |
---|---|---|
|
@@ -336,9 +336,93 @@ private static Map<String, RoleDescriptor> initializeReservedRoles() { | |
.indices(".enrich-*") | ||
.privileges("manage", "read", "write") | ||
.build() }, null, MetadataUtils.DEFAULT_RESERVED_METADATA)) | ||
.put("viewer", buildViewerRoleDescriptor()) | ||
.put("editor", buildEditorRoleDescriptor()) | ||
.immutableMap(); | ||
} | ||
|
||
private static RoleDescriptor buildViewerRoleDescriptor() { | ||
return new RoleDescriptor("viewer", | ||
new String[] {}, | ||
new RoleDescriptor.IndicesPrivileges[] { | ||
// Stack | ||
RoleDescriptor.IndicesPrivileges.builder() | ||
.indices("/~(([.]|ilm-history-).*)/") | ||
.privileges("read", "view_index_metadata").build(), | ||
// Security | ||
RoleDescriptor.IndicesPrivileges.builder().indices(".siem-signals-*").privileges("read", "view_index_metadata").build() }, | ||
new RoleDescriptor.ApplicationResourcePrivileges[] { | ||
RoleDescriptor.ApplicationResourcePrivileges.builder().application("kibana-.kibana").resources("*").privileges( | ||
"feature_discover.read", | ||
"feature_dashboard.read", | ||
"feature_canvas.read", | ||
"feature_maps.read", | ||
"feature_ml.read", | ||
"feature_graph.read", | ||
"feature_visualize.read", | ||
"feature_logs.read", | ||
"feature_infrastructure.read", | ||
"feature_apm.read", | ||
"feature_uptime.read", | ||
"feature_siem.read", | ||
"feature_dev_tools.read", | ||
"feature_advancedSettings.read", | ||
"feature_indexPatterns.read", | ||
"feature_savedObjectsManagement.read", | ||
"feature_savedObjectsTagging.read", | ||
"feature_fleet.read", | ||
"feature_actions.read", | ||
"feature_stackAlerts.read").build() }, | ||
null, | ||
null, | ||
MetadataUtils.DEFAULT_RESERVED_METADATA, | ||
null); | ||
} | ||
|
||
private static RoleDescriptor buildEditorRoleDescriptor() { | ||
return new RoleDescriptor("editor", | ||
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. @bytebilly would we expect the If we need the editor to manage spaces, then this role would instead need to grant the
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. @legrego I'm not sure to follow your comment. We are not using the Could you also explain why there is 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. Sorry for not being clear -- If we want editors to be able to manage spaces, then we have to use the 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.
That is an implementation detail of Kibana's "reserved privileges", and is something we can potentially simplify in 8.x once Kibana drops support for multi-tenant setups. The 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. Larry and I had a sync on that, and he is checking if using his proposed approach will give UX problems or not. Based on that, we can define if we want to use one approach or the other. 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 didn't get a chance to verify this today. I struggled to get ES to build locally, and my time was quite limited today. I'm on PTO until Wednesday (after feature freeze), so please don't hold this PR up on me. We can tweak the application privileges definition following FF if we have to without any real interruption |
||
new String[] {}, | ||
new RoleDescriptor.IndicesPrivileges[] { | ||
// Stack | ||
RoleDescriptor.IndicesPrivileges.builder() | ||
.indices("/~(([.]|ilm-history-).*)/") | ||
.privileges("read", "view_index_metadata").build(), | ||
// Observability | ||
RoleDescriptor.IndicesPrivileges.builder() | ||
.indices("observability-annotations") | ||
.privileges("read", "view_index_metadata", "write").build(), | ||
// Security | ||
RoleDescriptor.IndicesPrivileges.builder() | ||
.indices(".siem-signals-*", ".lists-*", ".items-*") | ||
.privileges("read", "view_index_metadata", "write", "maintenance").build() }, | ||
new RoleDescriptor.ApplicationResourcePrivileges[] { | ||
RoleDescriptor.ApplicationResourcePrivileges.builder().application("kibana-.kibana").resources("*").privileges( | ||
"feature_discover.all", | ||
"feature_dashboard.all", | ||
"feature_canvas.all", | ||
"feature_maps.all", | ||
"feature_ml.all", | ||
"feature_graph.all", | ||
"feature_visualize.all", | ||
"feature_logs.all", | ||
"feature_infrastructure.all", | ||
"feature_apm.all", | ||
"feature_uptime.all", | ||
"feature_siem.all", | ||
"feature_dev_tools.all", | ||
"feature_advancedSettings.all", | ||
"feature_indexPatterns.all", | ||
"feature_savedObjectsManagement.all", | ||
"feature_savedObjectsTagging.all", | ||
"feature_fleet.all", | ||
"feature_actions.all", | ||
"feature_stackAlerts.all").build() }, | ||
null, | ||
null, | ||
MetadataUtils.DEFAULT_RESERVED_METADATA, | ||
null); | ||
} | ||
|
||
private static RoleDescriptor kibanaAdminUser(String name, Map<String, Object> metadata) { | ||
return new RoleDescriptor(name, null, null, | ||
new RoleDescriptor.ApplicationResourcePrivileges[] { | ||
|
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.
I thought this is supposed to look like
/@&~(([.]|ilm-history-).*)/
, but tests say it works anyway.