-
Notifications
You must be signed in to change notification settings - Fork 25k
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 read_failures
privilege for authorizing failure store access
#119915
base: main
Are you sure you want to change the base?
Conversation
This commit adds the `read_failures` privilege and the logic supporting that privilege. The `read_failures` privilege enables read access to failure store indices owned by data streams named in the `indices` field of an indices privileges group, without implying `read` access to that data stream's "normal" backing indices. This is a bit of a mismatch with the existing privilege model, which authorizes actions and indices orthogonally. As of this change, in order to fully authorize an action, *both* action name and requested indices must be considered. Non-read actions to failure store indices, such as management calls, are authorized the same as backing indices; authorization will be granted to manage failure store indices if the user has permission to manage the owning data stream. It is only data visibility that is gated behind the new permission.
Documentation preview: |
…nto failure-store-authentication
@jbaiera and @jakelandis this is still quite rough around the edges but I'd like especially Jake to at least take a look at the core changes; it's possible (though I think unlikely) that this is contrary to larger goals for this code and I'd like to sort that out early. I'm going to get another CI run on this but I think the remaining failure store test failures may indicate a failure in my logic so tomorrow is digging into that. |
Pinging @elastic/es-security (Team:Security) |
read_failures
privilege for authorizing failure storeread_failures
privilege for authorizing failure store access
Hi @gwbrown, I've created a changelog YAML for you. |
…nto failure-store-authentication
As-is the code does not fully work to apply the new privilege, so it is pretty hard to review the code as-is. The existing code is already complex and tricky code and this adds that complexity and this change refactors signfigant portions of the authorization logic (which makes me nervous). There are still parts and reasons for which I don't fully understand however, I can comment on a few areas...
Functionally: "all" does not mean "all" anymore, instead you need to add "all + read_failures". This takes away from the simplicity of "all". Since you have to explicitly enable the failure store and change your query to include the values in your results, I think "read_failures" should be included in the all permission, perhaps with a note in the documentation to take this into consideration when enabling this. all is really an admin permission anyway (full CRUD permission for the index/data stream) and i assume that most normal users would get the read permission which does not by default include the read_failures (which is I agree with). Do we need any special auditing ? Finally, I wonder if we could short-circuit much of this complexity if we changed the way we express the permission. Perhaps a new boolean much like allow_restricted_indices, allow_failure_store and just mirror the implementation of restricted indices. We would need to resolving the concrete indices of the data stream and determine if concrete indices are from a failure store, but IIUC the strategy of marking those up to never match without the boolean could work without a fundamental change (I think)? |
This commit adds the
read_failures
privilege and the logic supporting that privilege. Theread_failures
privilege enables read access to failure store indices owned by data streams named in theindices
field of an indices privileges group, without implyingread
access to that data stream's "normal" backing indices. Theread_failures
privilege is not included in any other index privilege, includingall
.This is a bit of a mismatch with the existing privilege model, which authorizes actions and indices orthogonally. As of this change, in order to fully authorize an action, both action name and requested indices must be considered. To these ends, this PR refactors and centralizes a fair amount of the index authorization logic, reducing duplication of code and work at runtime.
Non-read actions to failure store indices, such as management calls, are authorized the same as backing indices; authorization will be granted to manage failure store indices if the user has permission to manage the owning data stream. It is only data visibility that is gated behind the new permission.
Todos before merge: