-
Notifications
You must be signed in to change notification settings - Fork 276
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
[2.x Backport] Optimized Privilege Evaluation #4898
base: 2.x
Are you sure you want to change the base?
[2.x Backport] Optimized Privilege Evaluation #4898
Conversation
Signed-off-by: Nils Bandener <[email protected]>
Signed-off-by: Nils Bandener <[email protected]>
Signed-off-by: Nils Bandener <[email protected]>
Signed-off-by: Nils Bandener <[email protected]>
…aluation Signed-off-by: Nils Bandener <[email protected]>
Signed-off-by: Nils Bandener <[email protected]>
Signed-off-by: Nils Bandener <[email protected]>
Signed-off-by: Nils Bandener <[email protected]>
Signed-off-by: Nils Bandener <[email protected]>
Signed-off-by: Nils Bandener <[email protected]>
Signed-off-by: Nils Bandener <[email protected]>
Signed-off-by: Nils Bandener <[email protected]>
Signed-off-by: Nils Bandener <[email protected]>
Signed-off-by: Nils Bandener <[email protected]>
…d_privileges.include_indices See discussion in opensearch-project#4380 (comment) Signed-off-by: Nils Bandener <[email protected]>
Signed-off-by: Nils Bandener <[email protected]>
Signed-off-by: Nils Bandener <[email protected]>
Signed-off-by: Nils Bandener <[email protected]>
Signed-off-by: Nils Bandener <[email protected]>
* Defines the first OpenSearch version which does not need the legacy headers | ||
* TODO this needs to be adapted | ||
*/ | ||
static final Version LEGACY_HEADERS_UNNECESSARY_AS_OF = Version.V_2_19_0; |
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.
Important: Before this PR is released, it must be made sure that the attribute LEGACY_HEADERS_UNNECESSARY_AS_OF
refers to the OpenSearch version this functionality is released in. Otherwise, DLS/FLS won't properly work in mixed clusters with older versions.
This also needs to be forward-ported to main
then.
Description
This implements the optimized privilege evaluation as described in #3870 and backports the changes from #4380 to the 2.x branch.
Important: Before this can be release, the OpenSearch version in the
LEGACY_HEADERS_UNNECESSARY_AS_OF
property must be checked to be in sync with the actual release version. See review comment at #4898 (review)This introduces de-normalized data structures that are optimized for the checks that need to be done during privilege evaluation. Additionally, certain objects (like DLS queries) are prepared ahead of time, as early as possible in order to minimize the overhead during actual privilege evaluation.
This is a big change set - in order to facilitate the review, I have split it into three major commits:
The code is extensively commented - I hope that will help during review.
Performance tests indicate that the OpenSearch security layer adds a noticeable overhead to the indexing throughput of an OpenSearch cluster. The overhead may vary depending on the number of indices, the use of aliases, the number of roles and the size of the user object. The goal of these changes is to improve privilege evaluation performance and to make it less dependent on the number of indices, etc.
No significant behavioral changes in the "happy case", when privileges are present.
The undocumented config option
config.dynamic.multi_rolespan_enabled
is no longer evaluated. The code now behaves like it is always set totrue
- that is the former default. See #4495 for details.Some slight changes are present in error cases:
Issues Resolved
This is a backport from #4380
Testing
SecurityBackwardsCompatibilityIT
(extended in Fixed bulk index requests in BWC tests and hardened assertions #4817 )Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.