-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Disallow mapping updates for doc ingestion privileges #58784
Disallow mapping updates for doc ingestion privileges #58784
Conversation
Separately to the implementation details, I think we need to discuss exactly which privileges this should apply to. |
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.
I like it, and it ends up not too complex. I think this is a reasonable option on how to proceed.
It's not quite how I was thinking I would do it, but I think it might be easier for me to explain my idea in code, so I'm going to whip something up.
.../src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java
Outdated
Show resolved
Hide resolved
...core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/IndexPrivilege.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java
Outdated
Show resolved
Hide resolved
https://gradle-enterprise.elastic.co/s/mxy44ehb4drbw is legit test failure, and welcomed. It's due to the deprecation logs, but I want another run. @elasticmachine test this please |
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.
LGTM. My comments are mostly about code structures and I don't think they are critical enough to block approval.
.../src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java
Show resolved
Hide resolved
deprecationLogger.deprecate("[" + indexOrAlias + "] mapping update for ingest privilege [" + | ||
privilegeName + "]", "the mapping update action [" + action + "] on the [" + | ||
indexOrAlias + "] index, is granted by the [" + privilegeName + "] privilege," + | ||
" but the privilege has been tightened to not allow it in the next major release"); |
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.
I'm not a fan of this wording - I'll propose an alternative during my day.
That would be a bad outcome. The point of this change is so that granting
That is the better result - the mirroring of privileges from data stream to backing index is a necessary detail to make data streams work, and should therefore follow the definition of how those privileges are defined for a data stream, not how they would have been defined if they were applied to an index. |
.../src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java
Show resolved
Hide resolved
@elasticmachine run elasticsearch-ci/packaging-sample-windows |
@elasticmachine run elasticsearch-ci/packaging-sample-windows |
1 similar comment
@elasticmachine run elasticsearch-ci/packaging-sample-windows |
The `create_doc`, `create`, `write` and `index` privileges do not grant the PutMapping action anymore. Apart from the `write` privilege, the other three privileges also do NOT grant (auto) updating the mapping when ingesting a document with unmapped fields, according to the templates. In order to maintain the BWC in the 7.x releases, the above privileges will still grant the Put and AutoPutMapping actions, but only when the "index" entity is an alias or a concrete index, but not a data stream or a backing index of a data stream.
This PR contains the deprecation notice that `create`, `create_doc`, `index` and `write` ingest privileges do not permit mapping updates in version 8. It also updates the docs description of said privileges. This should've been part of #58784
This PR contains the deprecation notice that `create`, `create_doc`, `index` and `write` ingest privileges do not permit mapping updates in version 8. It also updates the docs description of said privileges. This should've been part of #58784
The
create_doc
,create
,write
andindex
privileges lose the Put Mapping allowed action in the next major release.Create_doc
,create
andindex
also lose the Auto Put Mapping allowed action (mapping updates generated internally from templates).In order to maintain the bwc in the 7.x releases, the above privileges will still allow the Put and Auto Put Mapping actions, but only when the "index" entity is an alias or a concrete index, but not a data stream or a backing index of a data stream.