Improved index resolution and revised index authorization#5827
Improved index resolution and revised index authorization#5827nibix wants to merge 6 commits intoopensearch-project:mainfrom
Conversation
30aceb2 to
be840d0
Compare
c2d7b55 to
b47b6bc
Compare
b47b6bc to
1696555
Compare
e2bcf61 to
09c7f46
Compare
09c7f46 to
a4fdfd3
Compare
c008761 to
81c1ecb
Compare
|
@nibix apologies for a delay in comments. I plan to look at this in earnest over today and the coming days. |
...main/java/org/opensearch/security/privileges/actionlevel/legacy/PrivilegesEvaluatorImpl.java
Show resolved
Hide resolved
81c1ecb to
1d6fb4b
Compare
cwperks
left a comment
There was a problem hiding this comment.
TY for this change @nibix and introducing a dynamic feature flag through the security configuration.
I think this will greatly enhance the user experience, particularly for clusters where users are given fine-grained permissions over a subset of indices.
|
@nibix When a securityconfig update is made will it add an entry for When preparing for OpenSearch v4, what code change would need to take place in the security repo? |
|
on second thought, what do you think about making this a dynamic cluster setting instead of securityconfig? I'm a bit concerned about the persistence part of the securityconfig and generally prefer to make things dynamic cluster settings where its easier to change the default from one version to the next without concern about whether its been persisted with the default from previous major version |
Good question. Need to check that as well, will update later.
It depends on the question whether we just want to flip the feature flag default for v4 or whether the old logic shall be completely retired and deleted then. If just the feature flag default value is flipped, the changes in the main code are limited to flipping the default value. Test code would need to make sure to use explicit feature flag values where it is targeting the old behavior. If the old logic shall be completely deleted, of course, we would need to delete quite a lot of main code. However, that should be fairly well separated from the new code. Regarding tests, we'd need to delete quite a lot of legacy tests which only cover the old behavior. But we should already have new tests which cover the new behavior, so it should be fine to delete such tests. |
...ain/java/org/opensearch/security/privileges/actionlevel/nextgen/PrivilegesEvaluatorImpl.java
Show resolved
Hide resolved
c523117 to
5279383
Compare
|
I have now changed the value of the feature flag to The changes are in these commits: Can you re-review please? I will also try to write some docs. |
|
@nibix looks good to me. I've noticed that our integration tests have been running a lot longer lately (unrelated to this PR). Any idea which change we can attribute the increase to? |
I also had the feeling ... I will try to scan the logs to see if I find any indication. Of course, we added quite a few new integration tests which might add maybe three to five minutes of additional runtime. For the time being, I did not remove older integration tests which cover the same thing - just in order to be sure that the new tests agree with the old tests. But, after having merged the new int tests, we could consider cleaning up the old int tests a bit. Edit: Some findings at #5915 |
|
BTW, before merging this, we might want to have a closer look at the snapshot test issues described in #5915. This PR brings a few more test runs with snapshot/restore, which might make the issue worse. |
e0c1c27 to
1d00a86
Compare
Signed-off-by: Nils Bandener <nils.bandener@eliatra.com>
Signed-off-by: Nils Bandener <nils.bandener@eliatra.com> deleted unused code Signed-off-by: Nils Bandener <nils.bandener@eliatra.com>
…ecture Signed-off-by: Nils Bandener <nils.bandener@eliatra.com>
Signed-off-by: Nils Bandener <nils.bandener@eliatra.com>
1d00a86 to
66fad55
Compare
|
I have rebased this and fixed a conflict. With the merged test fixes, this is now IMHO ready for merging. @cwperks @shikharj05 wdyt? |
Signed-off-by: Nils Bandener <nils.bandener@eliatra.com>
|
@shikharj05 @DarshitChanpura @derek-ho @RyanL1997 @reta @willyborankin I kind this is a big PR; is there something I can facilitate the approval? It is already sitting around for a while. |
Description
This introduces all the necessary changes for the improved index resolution and revised index authorization described in #5814.
This has several advantages:
Issues Resolved
#5814
Testing
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.