-
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
[Fleet] Allow Kibana system user to read and write to Fleet server indices #67726
Changes from all commits
7719096
a9e1003
1483236
f6450fa
5aaef0c
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 |
---|---|---|
|
@@ -155,6 +155,30 @@ private static Map<String, RoleDescriptor> initializeReservedRoles() { | |
RoleDescriptor.IndicesPrivileges.builder() | ||
.indices(".logs-endpoint.diagnostic.collection-*") | ||
.privileges("read").build(), | ||
// Fleet Server indices. Kibana read and write from these indices to manage Elastic Agents. | ||
// Kibana write to this indice to reassign agent policy or perform force unenroll | ||
RoleDescriptor.IndicesPrivileges.builder() | ||
.indices(".fleet-agents") | ||
.privileges("read", "write").build(), | ||
// Kibana write to this indice to add action to an agent, upgrade, unenroll, ... | ||
RoleDescriptor.IndicesPrivileges.builder() | ||
.indices(".fleet-actions") | ||
.privileges("read", "write").build(), | ||
// Kibana write to this indice new enrollment api key | ||
RoleDescriptor.IndicesPrivileges.builder() | ||
.indices(".fleet-enrollment-api-keys") | ||
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. TLDR: If there are Kibana authz checks that can be bypassed by directly reading the enrollment api keys index, I suggest we make it a restricted index. This might be the case for the other fleet indices as well. Users that have read access to all indices, eg:
can access dot-named indices (which are implicitly hidden) using the index name or, in the case of wildcards, with a request option. For indices that contain sensitive data (more than just configuration data or raw-metrics, which is a nuisance to expose but is not equivalent to bypassing any other checks we have in place) we have an extra protection level, named restricted indices. The restricted indices concept is most likely to become superseded by system indices, but this is what we have and use currently. 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 was not aware of 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. Was also not aware of restricted indices concept. @scunningham @jaymode One more option ... ? 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. To maybe make it more clear what I mean, restricted indices confer addition protection by requiring explicit toggling of a flag when defining index permissions in a role, and relies on the expectation that roles in general don't have this flag toggled. Importantly, The fact that this is a new index and that it contains credentials prompted my suggestion. But restricted indices is no silver bullet, we can just simply document non-fleet-admin users should not be granted privileges over these indices. 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. |
||
.privileges("read", "write").build(), | ||
// Kibana write to this indice every policy change | ||
RoleDescriptor.IndicesPrivileges.builder() | ||
.indices(".fleet-policies") | ||
.privileges("read", "write").build(), | ||
// Fleet Server indices. Kibana read from these indices to manage Elastic Agents | ||
RoleDescriptor.IndicesPrivileges.builder() | ||
.indices(".fleet-servers") | ||
.privileges("read").build(), | ||
RoleDescriptor.IndicesPrivileges.builder() | ||
.indices(".fleet-actions-results") | ||
.privileges("read").build(), | ||
}, | ||
null, | ||
new ConfigurableClusterPrivilege[] { new ManageApplicationPrivileges(Collections.singleton("kibana-*")) }, | ||
|
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.
Does Kibana need write permissions for the agents?
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.
Yes right now if we want to reassign an agent to a new policy, force unenroll, we do it by writing to
.fleet-agents
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.
Would be nice to use the doc line 158 to also mention why a specific access is needed.
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 was hoping for a bit more details and have comments on all the lines. For example that write permissions are need to force unenroll etc.
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.
Just updated with more a per indice comment 👍