-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Running Kibana Upgrade assistant from 6 to 7 makes security index non-restricted #39284
Comments
Pinging @elastic/es-security |
Ping: @gwbrown @tylersmalley @joshdover |
This also has implications for 7.0 as (unlike 6.x) 7.x will have a migration assistant from day one to prepare for upgrade to version 8. elastic/kibana#30849 details a vaguely similar problem that affects the ML and Watcher indices in 7.0. Logically extending the proposal in this issue description:
|
Thanks @droberts195 That sounds like an issue. The 7.x upgrade assistant breaks the security index (#39018), we shouldn't be shipping with that enabled. |
Special handling for I ask due to the discussion about special system indices that may happen in 8.0. Are we just creating more work for ourselves by allowing |
As an aside, should we restrict reindexing of the security index in general? While unlikely, it's possible a user could reindex this index and use aliases and get their cluster into a broken or insecure state. |
Great, I'll work on making the necessary changes to ES to treat @albertzaharovits, since you've most recently worked on restrict indices, can you get up to speed on this issue and be ready to review my PR when it's up?
Yes, for 2 reasons
Typically we don't, because sometimes it's what's needed in order to fix a broken index, or simply as a backup of their security index. |
@tvernum thanks for picking this up. To summarize the plan and make sure I don't miss anything:
@tvernum do I miss anything? also, I'm concerned about the type change to @joshdover does this makes sense from your end of things? do you have a kibana issue to track it? |
The
Do we have any problem with just not showing any deprecation warning for |
good one. works from my perspective. |
Yes. The ES side of this is #39337 which is about ready to merge (I just want a 2nd review on it given the impact).
Yes. The issue is not so much the naming issue (though there is one) but that (per your comment below) current security code can't handle a reindex to
That's fine (and could be helpful) as long as it doesn't change the name of the
No, I don't think so.
It is certainly the case that security isn't using typeless APIs. Do you have specific concerns? We'd like to get rid of the security index (convert it to a special internal index) before ES8, so we haven't prioritised any work on migrating it to typeless APIs. |
Security indices are whitelisted and it has been decided to stick with the naming convention introduced in the 5.6 Upgrade Assistant. Related elastic/elasticsearch#39337 Related elastic/elasticsearch#39284 Signed-off-by: Tyler Smalley <[email protected]>
I have a PR up to make this change in Kibana for 6.7: elastic/kibana#31996 Tomorrow I will take care of excluding security from being upgradeable in 7.0+, unless @gwbrown you think that should be handled in the deprecations API? |
@gwbrown can you please chase/test/evaluate where we stand on the other internal indices? I would look at everything that starts with a
@tvernum Good question. I need to understand more. I'll reach out to discuss via another channel. |
@bleskes @gwbrown @tvernum - I have been working through the internal indexes see #38637 WIP PR for Logstash Central monitoring: #38653 I haven't done anything with the .security templates/indexes yet. The goal here is to have these ready by next week and asses how much risk merging these into 7.0 would introduce. I am also working with Kibana to move to the typeless API's. I will to ask for any changes beyond adoption of the typeless API (e.g. changing types or index patterns) that those be merged to a feature branch and assess the risk next week as well. Ping me directly for additional information. |
After digging through the code and talking to some experts:
I still need to do more thorough manual (and if possible, automated) testing - I'll continue to work on that. One consistent theme I've seen is that by and large, the features that depend on these indices are not ready to use a typeless index. It may be that we want to disable the reindex assistant for all internal indices in 7.0 until we've made some progress on that front. The PRs Jake linked to above should address this for those features, but they may not make it into 7.0, and they require some pretty significant changes. |
Given that we'll already need special cases Kibana side for |
Security indices are whitelisted and it has been decided to stick with the naming convention introduced in the 5.6 Upgrade Assistant. Related elastic/elasticsearch#39337 Related elastic/elasticsearch#39284 Signed-off-by: Tyler Smalley <[email protected]> * Always match against .security-{6,7} * Use constant for security source index name Signed-off-by: Tyler Smalley <[email protected]>
@gwbrown, we had a meeting today about it and the decision was that:
|
I am going to close this issue and I believe the specific problem is now resolved with #39337 and elastic/kibana#31996 The conversation here has crossed into other related issues, but I believe all of them are covered by other tracking issues. If there's something on this thread that hasn't made it to another issue/PR, please open one. |
The Kibana upgrade assistant has the ability to upgrades 5.x format indices by reindexing them into a new name and then aliasing the old name to the new name.
It includes the ability to do this for
.security-6
and the intent was that this would be the recommended way to upgrade a security index from 5.x to work on 7.xHowever, this has some unintended consequences.
Scenario
.security
index into.security-6
with a.security
alias..watches-6
and.security-6
Result:
This is all in keeping with how the upgrade assistant is designed to work. We now have
.reindexed-v6-security-6
index, and the.security
and.security-6
aliases point to it.Issue
The problem is that the protections we have to prevent users from getting accidental access to the security index rely on a strict naming convention.
Since Elasticsearch security knows nothing of the Kibana migration assistant, it does not apply any special access restrictions to the
.reindexed-v6-security-6
index.Consequently a user with this role (or many others like it)
can read from the security index, and a user with write privileges would be able to do much more (e.g. reset passwords).
Solution
Broadly, there's 2 options
.reindexed-v6-security-6
is another possible name for the security index. This is not particularly hard, we just need to make sure we cover everywhere it's needed (e.g.RestrictedIndicesNames
, but alsoXPackUser
and maybe others).security-6
. It already has some knowledge about special indices - for example it stops Watcher before reindexing.watches-6
I also have a concern about the risk associated with having more than 1 possible name for the security index. As it stands, clusters that were originally upgraded from 5.x will have the
.reindexed-v6-security-6
but clusters that upgraded from 6.x only, and clusters that were fresh 7.x installs will have.security-6
.Experience has shown that having too many variables like this leads to mistakes, which in the case of security can be mean quite significant problems.
Based on that, my preference would be something like:
.security-6
to.security-7
.security-6
and.security-7
as restricted indices.security-7
whenever it needs to be created.That seems to leave us in the lowest-risk end state (but I'm naturally cautious about such matters).
The text was updated successfully, but these errors were encountered: