-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Deprecate and replace old Index privileges related to indexing documents #47333
Comments
Pinging @elastic/es-security |
Pinging @elastic/es-distributed |
Pinging @elastic/es-core-features |
Hi @ywelsch I have added your suggestions to split the |
UI currently uses
|
@bizybot The whole point of creating new names is so that we can make breaking changes. We explicily don't want the new names to be exact replicas of the old names.
|
@tvernum Thank you for your comment.
Agreed, we are making breaking changes here as with the new names.
Agreed, this will be similar to
The But with this new privilege the behavior that I observed:
|
I am proposing the following privileges (a little different from an earlier attempt):
thoughts? |
I still maintain that People will expect that "index_doc" is the privilege that they want if they're ingesting data (and can't guarantee that it will be new docs only). |
I see your point, in that case, I propose the following:
|
Do we see much demand for update without script? But, is it valuable enough to build & maintain? |
I think we need a privilege that allows the full Happy to be convinced otherwise though. |
I wonder if we should even have an |
Thank you @tvernum and @ywelsch for your comments.
I think decomposing update privilege might not be that easy to achieve due to the current privilege model. Our privileges work on the action patterns and given that we can do a combination of operations like create, delete, update on the documents via scripts, it would be a trivial task to achieve this as we would need to authorize not just based on action names but also looking at the request object. We would need to think about changes to the authorization engine/model and we would not want to visit this just with this use case in mind.
It's hard to tell and it might depend on the use case. If the use case has frequent updates
Scripts, if not used properly, could have a performance impact and maybe the reason that we have kept update action separate. If we say that update with scripts as an advanced option available for users then I agree we should consider it as a separate privilege. Following is what I propose based on the discussions:
We are not considering granular As discussed above, From the migration point of view, the following is the mapping:
|
My main qualm with the API-oriented privileges (create/index/update, with all the variations of what update can do) is that they allow the user to restrict what APIs they might call. This is unrelated however to the effects that those APIs have. I find it more interesting to limit what changes the users can do to the data (with the basic ones being: only allows creations of new documents / allow overriding of documents / allow reading documents / allow deletion of documents).
An update is internally already a "get" + "index". Perhaps we could internally use transport actions for those steps so that they can be captured by the action patterns. The
I might still be convenient to have this "all things allowed privilege". Perhaps we can just call it |
Thank you @ywelsch for the comments.
This is interesting as it did come up during my discussion with @tvernum and we did think that if internally we used the transport actions, then it becomes easier from a security perspective and we can enforce granular model. But it seemed that we have avoided using transport actions maybe for other reasons (like performance), pardon my knowledge here. We are trying to target these changes for the upcoming release, do you think we would be okay to modify the current behavior, how big of this change would be to start using transport actions?
Yes, we can consider adding such privilege as a convenience. |
Just an update, I talked to @ywelsch offline and seems like we might be able to use transport actions internally for the steps that update action does in a way such that there are no performance degradation or missing functionality. I have started to explore the approach and with help from Yannick will come up with a draft PR where we can discuss. |
@elastic/es-security is anyone going to be picking this up for 7.6? We're dependent on the ES API to determine which index privileges are deprecated in elastic/kibana#46609 |
I'm checking in to see if this is still something we eventually want. I'm grooming Kibana's backlog, and I'd like to know if we should keep our associated issue open |
@legrego We discussed this in the ES Security team weekly sync on the 4th of Aug . Overall we do not plan to rename or remove any of the doc index-related privileges. If we sometimes decide we want to phase out some privileges, there is the |
Pinging @elastic/es-security (Team:Security) |
Thanks for the update, @albertzaharovits. I'll close out our associated issue since there are no plans at this time to move forward with index privilege deprecations. I am happy to re-open if the need arises in the future. |
Existing Index privilege names fail to convey the meaning properly and a few like
create
have their own unexpected semantics (it allows indexing document only via Index API). Since we are adding a newcreate_doc
privilege, we want to take this opportunity to clean up the existing privileges and either provide replica privilege if the semantics are correct or provide an alternative that is semantically correct. Also, the naming can be explicit about the operation that is performed.Following are the existing Index privileges related to documents indexing lifecycle:
create
: The privilege allows for indexing documents but only via Index/Bulk API but no update via Update API. It also allows update mapping actions. This one does not prevent document updates when using Index APIs.index
: The privilege allows indexing documents via Index/Bulk API, also allows for update action and mapping actions.delete
: The privilege allows deletion of documentswrite
: This privilege allows all write operations (index, deletes, updates) along with update mapping actions.read
: Read-only access to actions like count, explain, get, mget, get indexed scripts, etc.Following are the proposed new Index privileges:
create_doc
: This one is with changed semantics, allowing only indexing new documents but no updates. Plus this one removes the unexpected semantics of restricting this operation via Index API only. This will allow indexing new documents via Index/Bulk API and allows update mapping action. Add 'create_doc' index privilege #45806index_doc
: This will be similar toindex
privilege.delete_doc
: This will be similar todelete
privilege.write_doc
: This will be similar towrite
privilege.read_doc
: This will be similar toread
privilege.create_doc
index_doc
delete_doc
write_doc
read_doc
Additional considerations:
During the discussion of naming of
create_doc
we had a proposal to split theindex
privilege into:index_doc
: Privilege to index documents. It also includescreate_doc
privilege.I think this would be a breaking change but adding it to discuss this.
update_doc
: Privilege to update documents. Not sure how this would work, for example, an upsert case allows update of an existing document or index new document if it does not exist.If we want to support this splitting of
index
privilege into two with above semantics then it would be a breaking change and might not be possible other than to modify the index engine to handle it.read_doc
privilege: We could consider some more granular approach. I see an enhancement request: https://github.com/elastic/enhancements/issues/5470 which talks about providing a way to restrict users to certain search types?Proposed path forward:
Introduce these new index privileges in v8.0.0 and start logging deprecated warnings.
We have an issue opened to discuss this possibility to enhance the deprecation info API Allow Deprecation Info API to check for deprecated security configuration #47714
We could consider providing a tool for migration but it might not be possible to migrate all the role descriptors using the deprecated privilege names.
The problem exists for the privilege which does not have the exact alternative or would change the behavior if we use the alternative, eg.
create
with possible alternativecreate_doc
.roles.yml
).(If an alternative exists for the privilege we can update the role definitions in the file. This option is less likely as we would want to avoid file mutations)index
privilege or more granular privileges forread
?This issue exists to gather feedback on the path forward and comments around introducing/removing/updating index privileges in relation to indexing documents.
The text was updated successfully, but these errors were encountered: