-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Set elastic password and generate enrollment token for initial node #75310
Comments
See the first post with the updated decisions. |
I have concerns regarding behaviours 2 & 3.
In both of these cases the indexed password for the cluster's superuser would also be available (typically in plaintext) in the elasticsearch keystore. I don't think this is something we should ever do. I am happy with behaviour 1 (the password hash in the keystore is not any greater risk than a password hash in the file realm). And I am happy (from a security point of view) with behaviour 4, though I'd like to understand what happens to that auto-generated password (do we print it to console?) My pretty strong view (but we can chat if there's disagreement) is that if there is no
|
On a purely technical note: I think it needs to be
and since the elasticsearch.keystore is an extension of the yaml based settings into an encrypted store, it won't like it either. |
Final note (for now),
I find it strange that there are cases where we write a password (hash) to the keystore, and will tell admins that it is the password for the I don't think it's a blocker, but we need to at least be aware that it's a potential trap for admins, and document clearly that this password will not work until there is a healthy cluster. The other option is to have the node respect this hashed password. I think that means it has to be accepted in addition to the plaintext password ( |
Thanks for raising these Tim! As we discussed, I'm in favor of :
I think this added functionality makes sense and it is a much less surprising behavior. It will also allow us to make our existing password bootstrapping process in Docker much more secure, even for 7.x Regarding your other points:
Keeping in mind that we will try to clear the password from the keystore whenever we can, after we set it cluster-wide, and mostly for the sake of discussion: We would not be adding a cleartext We would now take this node-only valid password for elastic user and we would make it cluster-wide valid. If a malicious user would get access to the keystore to read the password, it means they have read access to the local filesystem so presumably network connectivity to the local node. If they wanted to run a malicious command against the cluster, they can already do that by authenticating to the local node. I would understand the difference in the attack surface perception if we could assume that the users that already set I'm also happy for us to reconsider our support for
++
yes, this will be printed in the console when there is a console attached. The current WIP for how to print this in the console is in #74516. |
Couple of things I would like to clarify...
@jkakavas Which process has to take care of it? I thought that if we manage to reset the password and generate the enrollment token, we are good to go and clear the bootstrap password. Thoughts? |
Thank you @tvernum for the input! Running the risk of restating a point already made clear, we don't plan on storing plaintext password values in the node's keystore, beyond what docker already does today. Actually, the point of introducing the new If we generate and show (for package installs) or accept (for docker runs - currently) a password for BUT, I think this requires that we move the action to put the password hash from the keystore to the .security index inside the node. That is because an outside-the-node request must be authenticated, and there's only the I'll have to think it over some more. I'm not sure anymore what are the step by steps. |
Our documentation tells people to run setup-passwords after their cluster starts. If they do that, then the bootstrap password is no longer useful for authenticating to the cluster. Our design & risk assessment was predicated on most people doing what we advised them to do. And, I think our obligations to our users are greater if they follow our documentation - if you do what we recommend then you will have a risk profile that we think is generally acceptable. Doing your own thing, outside of the documentation might increase that risk, and we try to avoid those situations, but they're inevitable and very hard to combat. I don't think we've done a good enough job on that with our docker instructions, but the answer is to do better, not to make everything worse.
If an admin actively tries to change the
However, in a typical package install, we know we can't, because the keystore is read-only to the user running ES.
That's my sense as well, though I'm not as close to the detail as the rest of the team, so I might be missing things. My feeling is that this is probably easier if we think about packages and archives separately. For archives:
For packages:
I think we've been trying to make those processes the same, but they're not, and I suspect it's easier if we accept that and embrace the differences. |
I have updated #75310 (comment) to reflect our current design.
I agree we can ( and maybe should ) think about these differently, but I think we can merge the approaches into one :
Since we won't be doing this, this is pretty much a theoretical discussion, but an interesting one so I'll add a bit:
I think ( and I acknowledge that this is a hunch as I don't have hard evidence ) that the use cases of the users who set |
In this particular case I think we're going to be more confident with different solutions for archives and packages. For archives, an external "helper" process, as laid out latest by Tim in #75310 (comment), and as has been proposed and discussed before, is the best thing we can achieve. For packages, we "promise" a password and we don't output enroll token. As discussed, to me, the promised password is a standalone sub-feature. In general, we can not have at the same time:
Therefore, I like how you renamed the setting to So I'm +1 on the latest flow as described by Tim, where the package security config runs off-process and the archive config process runs inside the node, taking care that they don't both kick off at the same time. |
It still makes more sense to me to converge the two approaches but it is a preference revolving mostly around fewer code paths, less code and the fact that I think we can handle both archives and packages in a similar way so why not do it ? Given my lack of strong arguments and that I don't dislike the proposed alternative, I don't think it's worth re-hashing the discussion for another round. Unless @BigPandaToo has strong preference/arguments to block this, I'm +1 too. Let us move in this direction. I'll summarize everything in the first post of this issue so that the decisions made are clear |
I am also in favor of a single process covering both cases for exactly the same reasons @jkakavas listed above, but I don't have strong contra arguments against the separated approaches, so +1 for the latter. |
You should take my suggestions lightly - I'm not involved in writing the code and it would be a bad outcome if you simply push ahead with my proposals despite technical obstacles. If I understand correctly, the alternate proposal would be for archives to be (changes highlighted):
The tradeoff is that this requires a bit more coordination of parts (some steps before the node startup, some steps inside the node itself, some steps after the node starts) but has more similarity to the package startup process. I don't think I'm close enough to the code to know which way that tradeoff should fall. I'm happy with whichever choice you make. |
For security on by default project, we need the functionality that would allow us to set the password of the elastic superuser ( if it has not been already set ) and to generate an enrollment token for Kibana. This functionality needs to be encapsulated in a class and that can be invoked as a CLI tool, similar to
org.elasticsearch.xpack.security.cli.AutoConfigInitialNode
and will be spawn off by the bin/elasticsearch script.Required functionality:
The expected behavior for this process is:
bootstrap.password
value in the keystore, we assume that the administrator wants to own their configuration related to the password of the elastic user. We will make no attempt to auto-config the elastic password nor attempt to "promote" this password value automatically to the security index.bootstrap.password
value, it will use thekeystore.seed
value as authenticating credentials and an auto-generated password as the value to set the password of the elastic user to, using the Change Password APIFor reference:
autoconfiguration.password_hash
: This is a value that contains the salted hash ( using the default hashing algorithm ) for the elastic user. We will be generating and setting this, during package (DEB,RPM) installation, so that we can show it to the user.bootstrap.password
: This is a value that contains the plaintext password of the elastic user. This can be set by the user manually before they start elasticsearch for the first time and/or is set in certain cases automatically by us ( In Docker, when the environment variableELASTIC_PASSWORD
is being set. The value of this setting can be used as theelastic
user password for the local node, until the time that the password of the elastic user is set in the reserved realm and the relevant document gets created in the security index.keystore.seed
: This is auto-generated on startup of the node. It's value of this setting can be used as theelastic
user password for the local node - ifbootstrap.password
is not already set - until the time that the password of the elastic user is set in the reserved realm and the relevant document gets created in the security index.The text was updated successfully, but these errors were encountered: