-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
Do not rewrite aliases on remove-index from aliases requests #46989
Merged
jasontedor
merged 4 commits into
elastic:master
from
jasontedor:only-rewrite-aliases-on-get-alias-requests
Sep 24, 2019
Merged
Do not rewrite aliases on remove-index from aliases requests #46989
jasontedor
merged 4 commits into
elastic:master
from
jasontedor:only-rewrite-aliases-on-get-alias-requests
Sep 24, 2019
Conversation
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
When we rewrite alias requests, if there are no aliases remaining in the request after filtering down to only those that the user is authorized to see, it can be that there are no aliases remaining in the request. However, core Elasticsearch interprets this as _all so the user would see more than they are authorized for. To address this, we previously rewrote all such requests to have aliases "*", "-*", which would be interpreted when aliases are resolved as no aliases. Yet, this is only needed for get aliases requests and we were applying it to all alias requests, including remove index requests. If such a request was sent to a coordinating node that is not the master node, the request would be rewritten to include "*" and "-*", and then the master would authorize the user for these. If the user had limited permissions, the request would fail, even if they were authorized on the index that the remove index action was over. This commit addresses this by only rewriting for get aliases requests. Co-authored-by: Albert Zaharovits <albert.zaharovits@elastic.co>
jasontedor
added
>bug
:Security/Authorization
Roles, Privileges, DLS/FLS, RBAC/ABAC
v8.0.0
v7.4.0
v7.5.0
labels
Sep 23, 2019
Pinging @elastic/es-security |
tvernum
requested changes
Sep 24, 2019
...security/src/main/java/org/elasticsearch/xpack/security/authz/IndicesAndAliasesResolver.java
Outdated
Show resolved
Hide resolved
albertzaharovits
approved these changes
Sep 24, 2019
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.
@elasticmachine test this please |
albertzaharovits
changed the title
Only rewrite aliases on get alias requests
Do not rewrite aliases on remove-index from aliases requests
Sep 24, 2019
@elasticmachine test this please |
@elasticmachine update branch |
javanna
approved these changes
Sep 24, 2019
@elasticmachine test this please |
albertzaharovits
added a commit
to albertzaharovits/elasticsearch
that referenced
this pull request
Sep 24, 2019
…#46989) When we rewrite alias requests, after filtering down to only those that the user is authorized to see, it can be that there are no aliases remaining in the request. However, core Elasticsearch interprets this as _all so the user would see more than they are authorized for. To address this, we previously rewrote all such requests to have aliases `"*"`, `"-*"`, which would be interpreted when aliases are resolved as nome. Yet, this is only needed for get aliases requests and we were applying it to all alias requests, including remove index requests. If such a request was sent to a coordinating node that is not the master node, the request would be rewritten to include `"*"` and `"-*"`, and then the master would authorize the user for these. If the user had limited permissions, the request would fail, even if they were authorized on the index that the remove index action was over. This commit addresses this by ~only~ rewriting for get aliases and remove aliases request types but not for the remove index. Co-authored-by: Albert Zaharovits <albert.zaharovits@elastic.co> Co-authored-by: Tim Vernum <tim@adjective.org>
albertzaharovits
added a commit
that referenced
this pull request
Sep 24, 2019
…#47020) When we rewrite alias requests, after filtering down to only those that the user is authorized to see, it can be that there are no aliases remaining in the request. However, core Elasticsearch interprets this as _all so the user would see more than they are authorized for. To address this, we previously rewrote all such requests to have aliases `"*"`, `"-*"`, which would be interpreted when aliases are resolved as nome. Yet, this is only needed for get aliases requests and we were applying it to all alias requests, including remove index requests. If such a request was sent to a coordinating node that is not the master node, the request would be rewritten to include `"*"` and `"-*"`, and then the master would authorize the user for these. If the user had limited permissions, the request would fail, even if they were authorized on the index that the remove index action was over. This commit addresses this by rewriting for get aliases and remove aliases request types but not for the remove index. Co-authored-by: Albert Zaharovits <albert.zaharovits@elastic.co> Co-authored-by: Tim Vernum <tim@adjective.org>
albertzaharovits
added a commit
that referenced
this pull request
Sep 24, 2019
…#47018) When we rewrite alias requests, after filtering down to only those that the user is authorized to see, it can be that there are no aliases remaining in the request. However, core Elasticsearch interprets this as _all so the user would see more than they are authorized for. To address this, we previously rewrote all such requests to have aliases `"*"`, `"-*"`, which would be interpreted when aliases are resolved as nome. Yet, this is only needed for get aliases requests and we were applying it to all alias requests, including remove index requests. If such a request was sent to a coordinating node that is not the master node, the request would be rewritten to include `"*"` and `"-*"`, and then the master would authorize the user for these. If the user had limited permissions, the request would fail, even if they were authorized on the index that the remove index action was over. This commit addresses this by rewriting for get aliases and remove aliases request types but not for the remove index. Co-authored-by: Albert Zaharovits <albert.zaharovits@elastic.co> Co-authored-by: Tim Vernum <tim@adjective.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
blocker
>bug
:Security/Authorization
Roles, Privileges, DLS/FLS, RBAC/ABAC
v7.4.0
v7.5.0
v8.0.0-alpha1
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.
When we rewrite alias requests, after filtering down to only those that the user is authorized to see, it can be that there are no aliases remaining in the request. However, core Elasticsearch interprets this as _all so the user would see more than they are authorized for. To address this, we previously rewrote all such requests to have aliases
"*"
,"-*"
, which would be interpreted when aliases are resolved as nome. Yet, this is only needed for get aliases requests and we were applying it to all alias requests, including remove index requests. If such a request was sent to a coordinating node that is not the master node, the request would be rewritten to include"*"
and"-*"
, and then the master would authorize the user for these. If the user had limited permissions, the request would fail, even if they were authorized on the index that the remove index action was over. This commit addresses this byonlyrewriting for get aliases and remove aliases request types but not for the remove index.