-
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
Bad request thrown when alias points to a closed index and security enabled #32238
Comments
Pinging @elastic/es-security |
This is essentially the same as #29948. A little over a year ago, I proposed a change that had the following description:
@javanna reviewed the change and raised issues with this change. This is just an excerpt of what was said:
Ultimately, we ended up saying that the short-term fix should be #29952. That is to create a custom instance of indices options that is lenient (meaning ignore_unavailable set to true and allow_no_indices set to true) but that forbids closed indices. Longer term we wanted to make some under the cover changes #29874 that require permissions on indices even when accessed using an alias. |
What's the disposition of this? It causes an unrecoverable issue in Kibana when users have aliases pointed at closed indices. |
@bmcconaghy is this something Kibana can handle? We do not have a clear way forward on our end and it has been a longstanding issue |
@jaymode Not really, no. We can just swallow the exception, but that means that you can't create an index pattern at all when you've got this situation. If you already had an index pattern that matches the alias before this situation came up, you would get fatal errors in discover and visualize. Again, we could swallow the exception, but then you would be shown no data. |
@javanna do you think adding forbid_closed_indices as a valid request parameter is an option? |
Would that mean that Kibana would have to pass that with every request? That would be a pain to trace through all the places we would need to add it. |
Or reading this again, maybe it is the reverse, that you would have to pass that to get the current behavior? |
One thing I don't understand is why this comes up now, as this issue existed for a very long time. Not saying it's good, but it's a known limitation of our security model that allows for document based security through filtered aliases. I will follow-up with Jay to try and see if there's something we can actually do to address it. |
@javanna and I talked and he reminded me where the real issue lies. Security allows authorization on aliases even if the user is not granted permission to an underlying index. This conflicts with how the default elasticsearch wildcard resolution works which resolves the alias to only the open indices, but security keeps the alias in the request. Essentially there is no good way forward until we remove support for authorizing on aliases #29874 |
This issue also impacts the |
I just ran into the same issue that @not-napoleon described. The fact that closing indices breaks |
This also seems to affect a number of other API calls including:
|
I have observed this in an exact scenario for |
I also have the same issue. As I have closed indices referenced by aliases, I cannot use the |
I just ran into the same issue and I am trying some solutions. I can understand we need to keep aliases to cover the following case: Users may have roles configured against aliases but not against their corresponding concrete indices. However, can we separate the indices list used to Or, I think we can add and IndicesOptions : |
Is this issue a problem on 7+ versions too I have a self-managed client who is complaining about this and they are on version 7.11 |
Passes a permissive `IndicesOptions` to the indices stats request used within `GET _cat/shards` so that it retrieves stats for hidden indices by default. Also passes the same `IndicesOptions` to the cluster state request so that the two requests get consistent sets of indices. Also parallelises the two requests since there's no dependency between them. Closes elastic#84656 Also relates elastic#32238 since the more permissive `IndicesOptions` used here permits closed indices, which means `GET _cat/shards` will not throw an exception in security-enabled clusters containing closed indices behind aliases.
Passes a permissive `IndicesOptions` to the indices stats request used within `GET _cat/shards` so that it retrieves stats for hidden indices by default. Also passes the same `IndicesOptions` to the cluster state request so that the two requests get consistent sets of indices. Also parallelises the two requests since there's no dependency between them. Closes #84656 Also relates #32238 since the more permissive `IndicesOptions` used here permits closed indices, which means `GET _cat/shards` will not throw an exception in security-enabled clusters containing closed indices behind aliases.
The problem also affects Data Streams.
Note:
|
Core interprets explicitly mentioned aliases differently from the ones covered by wildcards (for the former, in some APIs, it throws an error when they point to closed indices). Security can technically plug into the Core algorithm, such that the plugged-in Core algorithm can deal with wildcards. The nub is that we need to do some for of wildcard expansion in the Security filter, but still plug into the Core's algorithm to let it know for which alias names it should error if they point to closed indices. |
Pinging @elastic/es-security (Team:Security) |
@albertzaharovits @slobodanadamovic none of the recent work around authz improvement address this right? Am I correct in saying that this remains an issue and that we currently haven't prioritized working on it? |
Hello @n1v0lg @albertzaharovits @slobodanadamovic |
Yes, none of the recent authz improvements has addressed this yet. This
issue is still standing as described.
Le mer. 15 mars 2023, 10:42, Mariana ***@***.***> a écrit :
… Hello @n1v0lg <https://github.com/n1v0lg> @albertzaharovits
<https://github.com/albertzaharovits> @slobodanadamovic
<https://github.com/slobodanadamovic>
Would you any update on this, please? Thanks
—
Reply to this email directly, view it on GitHub
<#32238 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABC3KZFDTGSSRBYE5ZWNKB3W4HIOHANCNFSM4FLAC5GQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Elasticsearch version (
bin/elasticsearch --version
): 6.3.0 and earlierPlugins installed: none
JVM version (
java -version
):java version "10" 2018-03-20
Java(TM) SE Runtime Environment 18.3 (build 10+46)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10+46, mixed mode)
OS version (
uname -a
if on a Unix-like system):Darwin 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64
Description of the problem including expected versus actual behavior:
_search/* throws a 400 bad request when an alias points at a closed index and security is enabled. I expect this not to happen.
Steps to reproduce:
POST test1/test1 { "test":"test" }
POST test2/test1 { "test":"test" }
POST /_aliases { "actions" : [ { "add" : { "index" : "test1", "alias" : "alias1" } }, { "add" : { "index" : "test2", "alias" : "alias1" } } ] }
3. do a search
POST _search { "size":0, "aggs": { "indices":{"terms":{"field":"_index","size":200}}}}
response:
{ "error": { "root_cause": [ { "type": "index_closed_exception", "reason": "closed", "index_uuid": "OO462ue0QQCUQ_lS1SvHTA", "index": "test1" } ], "type": "index_closed_exception", "reason": "closed", "index_uuid": "OO462ue0QQCUQ_lS1SvHTA", "index": "test1" }, "status": 400 }
This issue causes an error in Kibana: elastic/kibana#20920
The text was updated successfully, but these errors were encountered: