-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Optimize Index Permission Automatons for Has Privileges #136625
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
Optimize Index Permission Automatons for Has Privileges #136625
Conversation
|
The reported CI failure in serverless is valid I think: Working on reproducing locally now. |
|
Hi @jfreden, I've created a changelog YAML for you. |
|
Pinging @elastic/es-security (Team:Security) |
docs/changelog/136625.yaml
Outdated
| @@ -0,0 +1,5 @@ | |||
| pr: 136625 | |||
| summary: Optimize index permissions | |||
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.
Will update this as soon as CI finishes
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.
136625
slobodanadamovic
left a comment
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.
LGTM 🚀
Thanks for fixing it!
💔 Backport failed
You can use sqren/backport to manually backport by running |
This PR optimizes how index permission automatons are created. In elastic#110633 a feature was added to allow for doing regular expression "has privilege" style checks against index permission groups. The reason this was added was to support regular expressions for the `manage_roles` privilege (so unrelated to the has privileges API). The implementation was known to have performance issues and the change was therefore made optional (and disabled in the has privileges API). Unfortunately, a change to simplify the logic by doing `Automatons.unionAndMinimize` on all index permissions in a group was left outside the conditional and therefore caused a performance regression. See [this](https://github.com/elastic/elasticsearch/blob/2a9c07eb6fe4e8bbb7fc9fbab6fa59ccc006e10b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java#L840-L860) comment for details on the original change.
This PR optimizes how index permission automatons are created. In elastic#110633 a feature was added to allow for doing regular expression "has privilege" style checks against index permission groups. The reason this was added was to support regular expressions for the `manage_roles` privilege (so unrelated to the has privileges API). The implementation was known to have performance issues and the change was therefore made optional (and disabled in the has privileges API). Unfortunately, a change to simplify the logic by doing `Automatons.unionAndMinimize` on all index permissions in a group was left outside the conditional and therefore caused a performance regression. See [this](https://github.com/elastic/elasticsearch/blob/2a9c07eb6fe4e8bbb7fc9fbab6fa59ccc006e10b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java#L840-L860) comment for details on the original change.
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
This PR optimizes how index permission automatons are created. In elastic#110633 a feature was added to allow for doing regular expression "has privilege" style checks against index permission groups. The reason this was added was to support regular expressions for the `manage_roles` privilege (so unrelated to the has privileges API). The implementation was known to have performance issues and the change was therefore made optional (and disabled in the has privileges API). Unfortunately, a change to simplify the logic by doing `Automatons.unionAndMinimize` on all index permissions in a group was left outside the conditional and therefore caused a performance regression. See [this](https://github.com/elastic/elasticsearch/blob/2a9c07eb6fe4e8bbb7fc9fbab6fa59ccc006e10b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java#L840-L860) comment for details on the original change. (cherry picked from commit 3df0abb) # Conflicts: # x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java
…36674) This PR optimizes how index permission automatons are created. In #110633 a feature was added to allow for doing regular expression "has privilege" style checks against index permission groups. The reason this was added was to support regular expressions for the `manage_roles` privilege (so unrelated to the has privileges API). The implementation was known to have performance issues and the change was therefore made optional (and disabled in the has privileges API). Unfortunately, a change to simplify the logic by doing `Automatons.unionAndMinimize` on all index permissions in a group was left outside the conditional and therefore caused a performance regression. See [this](https://github.com/elastic/elasticsearch/blob/2a9c07eb6fe4e8bbb7fc9fbab6fa59ccc006e10b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java#L840-L860) comment for details on the original change.
…36678) This PR optimizes how index permission automatons are created. In #110633 a feature was added to allow for doing regular expression "has privilege" style checks against index permission groups. The reason this was added was to support regular expressions for the `manage_roles` privilege (so unrelated to the has privileges API). The implementation was known to have performance issues and the change was therefore made optional (and disabled in the has privileges API). Unfortunately, a change to simplify the logic by doing `Automatons.unionAndMinimize` on all index permissions in a group was left outside the conditional and therefore caused a performance regression. See [this](https://github.com/elastic/elasticsearch/blob/2a9c07eb6fe4e8bbb7fc9fbab6fa59ccc006e10b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java#L840-L860) comment for details on the original change. (cherry picked from commit 3df0abb) # Conflicts: # x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java
…36673) This PR optimizes how index permission automatons are created. In #110633 a feature was added to allow for doing regular expression "has privilege" style checks against index permission groups. The reason this was added was to support regular expressions for the `manage_roles` privilege (so unrelated to the has privileges API). The implementation was known to have performance issues and the change was therefore made optional (and disabled in the has privileges API). Unfortunately, a change to simplify the logic by doing `Automatons.unionAndMinimize` on all index permissions in a group was left outside the conditional and therefore caused a performance regression. See [this](https://github.com/elastic/elasticsearch/blob/2a9c07eb6fe4e8bbb7fc9fbab6fa59ccc006e10b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java#L840-L860) comment for details on the original change.
This PR optimizes how index permission automatons are created. In elastic#110633 a feature was added to allow for doing regular expression "has privilege" style checks against index permission groups. The reason this was added was to support regular expressions for the `manage_roles` privilege (so unrelated to the has privileges API). The implementation was known to have performance issues and the change was therefore made optional (and disabled in the has privileges API). Unfortunately, a change to simplify the logic by doing `Automatons.unionAndMinimize` on all index permissions in a group was left outside the conditional and therefore caused a performance regression. See [this](https://github.com/elastic/elasticsearch/blob/2a9c07eb6fe4e8bbb7fc9fbab6fa59ccc006e10b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java#L840-L860) comment for details on the original change.
This PR optimizes how index permission automatons are created.
In #110633 a feature was added to allow for doing regular expression "has privilege" style checks against index permission groups. The reason this was added was to support regular expressions for the
manage_rolesprivilege (so unrelated to the has privileges API). The implementation was known to have performance issues and the change was therefore made optional (and disabled in the has privileges API). Unfortunately, a change to simplify the logic by doingAutomatons.unionAndMinimizeon all index permissions in a group was left outside the conditional and therefore caused a performance regression.See this comment for details on the original change.