Skip to content
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

_all and * resolves to system indices and causes WARN deprecation logs #81345

Closed
rudolf opened this issue Dec 3, 2021 · 6 comments
Closed

_all and * resolves to system indices and causes WARN deprecation logs #81345

rudolf opened this issue Dec 3, 2021 · 6 comments
Labels
>bug :Core/Infra/Core Core issues without another label Team:Core/Infra Meta label for core/infra team

Comments

@rudolf
Copy link
Contributor

rudolf commented Dec 3, 2021

Examples (affects 7.16 and main):

curl -IX GET "elastic:changeme@localhost:9200/_all/_rollup/data" -H 'Content-Type: application/json' 
HTTP/1.1 200 OK
X-elastic-product: Elasticsearch
Warning: 299 Elasticsearch-7.16.0-SNAPSHOT-34fb605e5a51f9ecbf4a6ad3d3b910402c5b2121 "this request accesses system indices: [.security-7], but in a future major version, direct access to system indices will be prevented by default"
content-type: application/json; charset=UTF-8
content-length: 2
kibana % curl -IX GET "http://elastic:changeme@localhost:9200/*/_search?pretty" -H "x-elastic-product-origin: kibana"
HTTP/1.1 200 OK
X-elastic-product: Elasticsearch
Warning: 299 Elasticsearch-8.1.0-SNAPSHOT-838597e18e0495a2239a71187df0b49b69c17f77 "this request accesses system indices: [.security-7], but in a future major version, direct access to system indices will be prevented by default"
content-type: application/json
content-length: 2385

I couldn't find any existing issues but found the following related issues/comments:
#50251 (comment)
#78850

Related: elastic/kibana#120043

@rudolf rudolf added the >bug label Dec 3, 2021
@rudolf rudolf changed the title _all resolves to system indices and causes WARN deprecation logs _all and * resolves to system indices and causes WARN deprecation logs Dec 3, 2021
@idegtiarenko idegtiarenko added the :Core/Infra/Core Core issues without another label label Dec 7, 2021
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Dec 7, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@williamrandolph
Copy link
Contributor

I merged a PR into master that changes this behavior there: #79512

The behavior is intended in the 7.x line.

@rudolf
Copy link
Contributor Author

rudolf commented Dec 7, 2021

For Kibana we will hide this deprecation warning from users by specifying the x-elastic-product-origin: kibana header.

But stepping back and thinking about other users that integrate directly with Elasticsearch. If they use _all or * I don't see a way for them to resolve this deprecation message in 7.x so that they can gain confidence to upgrade?

@williamrandolph
Copy link
Contributor

Our guidance would be to change their query pattern to avoid using those wildcard queries. At a bare minimum, I believe they could use the pattern *,-.security-7 to avoid the warning. If they have a use case where they really need to access system resources, we would like to know about it so we can provide that access through a plugin.

We already downgraded this warning from CRITICAL to WARN. I think it's an important warning. We really do hope to be able to remove all direct access to these indices some day, but we just couldn't get there in time for 8.0.

@rudolf
Copy link
Contributor Author

rudolf commented Jan 11, 2022

@williamrandolph thanks, that makes sense. I think the challenge for our users is how to track down the source of this deprecation warning and it isn't obvious that a * wildcard is the reason they're triggering a deprecation warning. Also .security-7 isn't the only system index, so they would need to use something like *,-.* which would also exclude hidden indices which might or might not be what they want.

this request accesses system indices: [.security-7], but in a future major version, direct access to system indices will be prevented by default

If we could change this message to something like the following I think it would help users a lot in tracking down the problem query: "This request uses an index pattern [*] that expands to include system indices. In a future major version wildcards will no longer expand to match system indices." Ideally we'd have something actionable like "To prevent this deprecation warning..." too.

@gwbrown
Copy link
Contributor

gwbrown commented Jan 11, 2022

If we could change this message to something like the following

I agree that it would be very helpful, but unfortunately due to how Security is designed we don't reliably have access to the index patterns the user supplied at that time - they're basically overwritten by Security with expanded versions that are guaranteed to only fall within the indices that user has permissions to access. That means that the "pattern" that matched that index at the time we emit the warning is very likely different from what the user supplied.

We actually investigated this when we first implemented the warning, explicitly to special case _all/*, and while we ended up not going that route for other reasons, it was quite painful to communicate all the necessary information from Security to Elasticsearch core. We've talked about architectural changes that would allow us to resolve this, but won't have bandwidth to implement them any time in the immediate future.

It's worth noting that while this is an issue in 7.x, this typically won't be an issue post-8.0, as system indices will be restricted to users with allow_restricted_indices permissions, which most users will not have.

Given that we won't really have bandwidth to address this for the next 7.x release, and the reduced impact in 8.0, I'm going to close this, at least for now. Once we decide the long-term path for system indices (specifically, to what degree we're going to lock them down above what's in 8.0 right now) we'll likely need to reevaluate some things here anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Core/Infra/Core Core issues without another label Team:Core/Infra Meta label for core/infra team
Projects
None yet
Development

No branches or pull requests

5 participants