-
Notifications
You must be signed in to change notification settings - Fork 282
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
Point in time security model #2087
Comments
@peternied @cliu123 please review this. |
Assigning this issue to @peternied to provide next steps. |
@bharath-techie Thanks for writing this up and its really useful to have available. This is a really meaty document with many questions and assumption inside it - this is making it hard for me to build up a model for how this system works. It will be faster to build on smaller scenarios first as we move towards encapsulating all scenarios you'd like to support. I am having serious issues with the REST API layout, as it isn't following a convention of an addressable resource. Creation is done via This is creating problems describing the security posture because our typically conventions are grounded in addressable objects. Can we make the access patterns look like the following, and then create straight forward permissions off of them?
|
From List all PITs Design
I'm not sure I understand the argument against writing the additional code. Using a PIT focus action filter seems like a good separation of concerns. |
List all PITs API is exposed so that user can view all PITs assigned to them. (cat indices for example ) So the need of the API is to get the IDs and additional info - so we can't pass ID to the api. For delete, Also these APIs are designed keeping opensearch dashboards use cases as well in mind, so we need all these patterns to be supported. |
Lets focus in on where PIT is closely related to scroll and set aside the Scroll has fewer permissions Looking at the capabilities of a PIT object and what warrants protection:
If the PIT does not include the index name inside of it, as the use case of PIT is tightly coupled with If this understanding of the scenario isn't accurate, please provide scenarios for why an admin would want additional permissions granularity. |
So you mean to say list all PITs should be a cluster admin operation and no need of granularity to it ? Only concern is that let's say 'user a' has access to 'index a' and created a pit for it. If 'user b' has 'list all pits' permissions ( cluster admin permission) but don't have access to any indices, still 'user b' will be able to read the PITs info 'user a' created. Is that acceptable behavior ? |
This is how search operation uses PIT as well, indices are not present as part of search operation, whenever PIT ID is used as PIT comprises of indices information. So PIT will include index information as that's per the current design. |
Thanks @bharath-techie , I think with |
No @reta if we need to use "indices:data/read/point_in_time/readall", user needs "all indices read permission", which we are trying to avoid. Because "indices:data/read" actions either needs indices as part of request or user needs all indices read permission. Only thing action filter will do is filter the permitted PITs which we will get after "cluster:admin/readpits" fetches all the pits. So we can't get rid of "cluster:admin" call if we're going for granular model. |
Perhaps naïve questions but I'll ask regardless:
|
|
I understand there are implementation considerations, but I'd like us to focus on the user scenarios - we add permission objects to protect a kind of resource/information. Can you help me align use case for applying individual permissions and their rules. Cases where no PIT permissions are needed
[Edit] From offline, this scenario is correct, because when the search is made using the PIT the indices for the search are implicitly included. User B cannot issue a search that only returns results from Index-2 with this implementation.
Driving towards closure, making sure we understand use cases@bharath-techie could you please express the permissions in the form of Use Case for each permission, like the following: Use Cases for PIT permissions
Please fill out/confirm these use cases for the remaining permissions
If there are additional scenarios please add them, or we can discuss nuanced use cases as sub-bullets of each use case |
To simplify the security model and to address the concerns about '_all' type operations, we discussed with @peternied and are proposing this new model. Granular permissions:Granular permissions will still be permitted for APIs where explicit PITs are provided by user.
Handling 'all' type operations:User will need ' * ' indices permissions for these actions for the '_all' type operations to work. To take existing pattern as an example i.e. For cat indices operation, specifying target index just requires target index permission, whereas if no target is specified, user will need ' * ' indices permission for the operation. Actions:
Action group:
Role which has access to all PIT actions :We'll add this as predefined role for Point in time.
We won't give the following role as default role but we can document the usage so that admin can provide granular permissions to perform PIT operation with the limitation of not being able to access '_all' type operations.
Use Cases for PIT permissions
If there are additional scenarios please add them, or we can discuss nuanced use cases as sub-bullets of each use case Pros:
Cons:
@reta let us know if this model works |
@bharath-techie @peternied thank you guys for clearing out the concerns and simplifyng the model. I think it looks logical and concise now, the workaround are gone. |
[CLOSE] Close in favor of the existing issue list. |
Point in time security model
Context:
What is point in time ?
User can create a Point In Time for a set of indices. A Point In Time is a set of segments which are frozen in time taken at the moment of creation. We lock the segments of those indices’ shards and create contexts to access and query only those shards.
Such point in time contexts can be reused across multiple search queries and the data that is searched upon will be on the locked segments. This solution is used with search after for pagination with data consistency.
This can be related to ‘scroll’ , whereas ‘scroll’ context gets created for each query ( cannot be reused for different search queries ) and ‘scroll’ can only move forward.
Design doc : opensearch-project/OpenSearch#3960
Meta issue: opensearch-project/OpenSearch#3959
Point in time APIs
Permission model
Action group:
Role which has access to all PIT actions :
Requirement
In order to meet the above requirements, we are making changes in security plugin to evaluate permissions of PITs.
Following two items need review:
1. Proposed security model
We need to handle two cases for the APIs
When is a PIT permitted ?
A PIT is made of one ore many indices. If the user has access to all the indices of a PIT, then PIT is permitted.
This is common for all APIs.
What if user does not have action permissions ?
Operation is denied.
a. Access for explicit PITs
b. Access for operation with ‘all’ or ‘ * ’ PITs
No PITs in cluster
2. List all PITs Design
Context
There are two options currently at discussion
Option 1 : New action filter for PITs in security plugin
We will introduce a new action filter which will be called by security filter for PIT requests to wrap the listener to call the PIT privilege evaluator to get the permitted PITs.
Check this thread : opensearch-project/OpenSearch#4388 (comment)
Pros :
No extra action / permission required
Cons :
Maintainability of additional filter code in security plugin
Option 2 : Dummy action to filter PITs
Dummy action in opensearch to filter PITs
Pros :
Simple solution, doesn't add any code to security plugin and it is already tested in the current PR
Cons :
The text was updated successfully, but these errors were encountered: