-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add changes for Create PIT and Delete PIT rest layer and rest high level client #4064
Merged
Bukhtawar
merged 23 commits into
opensearch-project:main
from
bharath-techie:createpitrest
Sep 1, 2022
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
49b3f01
Create and delete pit rest layer changes
bharath-techie 6746775
Merge branch 'main' of https://github.com/opensearch-project/OpenSear…
bharath-techie 1626cfb
addressing review comments
bharath-techie 3bdf1cc
Marking APIs stable
bharath-techie 6ce972e
Addressing comments
bharath-techie 03785b9
Merge branch 'main' of https://github.com/opensearch-project/OpenSear…
bharath-techie 60b5552
Merge branch 'main' of https://github.com/opensearch-project/OpenSear…
bharath-techie dce02c2
changing action name for delete
bharath-techie ce306c1
addressing comments
bharath-techie 94b8a6a
Changing client due to change in security action and also fixing conc…
bharath-techie 5203a3c
Merge branch 'main' of https://github.com/opensearch-project/OpenSear…
bharath-techie 90bdb5f
Merge branch 'main' of https://github.com/opensearch-project/OpenSear…
bharath-techie 1be4e8b
Merge branch 'main' of https://github.com/opensearch-project/OpenSear…
bharath-techie 611a43b
Merge branch 'main' of https://github.com/opensearch-project/OpenSear…
bharath-techie f1b408c
Merge branch 'main' of https://github.com/opensearch-project/OpenSear…
bharath-techie 4ec23ca
Fixing rest client tests
bharath-techie 66b0ca7
Merge branch 'main' of https://github.com/opensearch-project/OpenSear…
bharath-techie 2e97a58
Merge branch 'main' of https://github.com/opensearch-project/OpenSear…
bharath-techie 7796ace
Changes to make security granular for PIT Ids for delete and get pits…
bharath-techie 40ac831
Fixing build
bharath-techie fab586c
Merge branch 'main' of https://github.com/opensearch-project/OpenSear…
bharath-techie 1c714c7
Merge branch 'main' of https://github.com/opensearch-project/OpenSear…
bharath-techie 6412c08
addressing review comment
bharath-techie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
changing action name for delete
Signed-off-by: Bharathwaj G <bharath78910@gmail.com>
- Loading branch information
commit dce02c22b855b6b06835e007166b89607d3eebff
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@bharath-techie why it was moved to
cluster:admin
? It does not look right, the semantics of PIT should be kept under "indices:data/read", likescroll
feThere 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.
we initially went with "indices:read" , but then during testing, we found out that the user needs " all indices : read" permission to delete PITs. Same case with list all PITs. This is because the API does not have indices as part of request.
We initially went with a scroll model but scroll does not have 'clear scroll' permission assigned to any role other than kibana_server.
For more details : please refer to opensearch-project/security#2033
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.
It'll be great if you can review the overall security model as well @reta @Bukhtawar :
#3960 --- please review "Security model" section and the examples provided.
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.
@bharath-techie why
all indices : read" permission
is a problem? it does make sense because PIT could be created for any set of indices (same for delete). Having "indices:data/read/point_in_time/create" for create and "cluster:admin/point_in_time/delete" for delete does not look logical to me :(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.
okay i understand. but also on the flipside, thing to note is that 'pit search' and 'pit create' has indices as part of the request. So user only needs permission to that particular index.
But if user wants to delete pits or list all pits, user will need 'all indices read' permission.
Are we okay with that ?
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.
@reta @Bukhtawar
I have made the changes in security plugin and opensearch to make PIT security model more granular as discussed which filters PITs based on underlying indices and associated permissions.
https://github.com/opensearch-project/security/pull/2053/files
TransportNodesGetAllPITsAction - this will be the parent action ( not user / rest facing - transport only ) which will belong to 'cluster/admin' action type which initially gets all the active PITs from the cluster.
For Delete all , Delete list of PITs and Get All PITs APIs, security plugin will intercept the request and validate and permit the PITs based on underlying indices permission.
We have a 'custom privilege evaluator' to handle above point in time requests.
Please refer to security PR https://github.com/opensearch-project/security/pull/2053/files to know more about how each API filters the PITs.
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.
thanks @bharath-techie , this approach looks much better and cleaner (to me at least)
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.
@reta Here is my understanding, the current implementation does
REST layer -> security plugin -> Transport(cluster:admin/point_in_time/read_from_nodes), where the security plugin evaluates what PITs should be accessible to the current user, with the caveat that security plugin doesn't have the original request's response listener as a result it requires to block on a latch/interrupt ultimately blocking the request handler thread. While I am not sure how could we implement a callback without blocking threads with security plugin specifically.
Note : the
cluster:admin
is still a proxy just that security plugin kicks in earlier before cluster:admin is hit with the earlier approach.An alternative that was also discussed was somewhat similar(with few minor modification), which avoids the blocking nature of call made from the security plugin altogether.
Thoughts?
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.
Please refer to this commit for latch usage , we've made changes to ensure that this is avoided , so latest changes don't have it @reta
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.
Yeah, already saw it, thanks @bharath-techie