Skip to content

elastic user password reset CLI tool #70113

@jkakavas

Description

@jkakavas

It would be beneficial for our users to offer a simple solution for resetting the password of the elastic built-in user.

Requirements

  • Easy to use
  • Should be generally available
  • Allow to set the password to a specific value of automatically generate one
  • Need not cover other built-in users, as access to elastic credentials would allow to set the password of any other built-in (or otherwise) user, via the change password API
  • Should not change our existing threat model
  • Should not depend on external services or personal information ( email based flows etc )

Suggested Solution

We can offer a CLI tool for this purpose. The tool can depend on the file realm and codify the suggested approach we have even now for these kinds of situations where users have lost the password for the elastic user. The flow can be similar to:

  1. User runs bin/elasticsearch-tool-name, optionally specifying the requested password value
  2. The CLI tool verifies that the file realm is enabled, generates an entry for a file realm temp user with a role of superuser and adds that to the file realm.
  3. CLI tool uses the newly created user credentials to query the ES cluster and verify that it's health ( and possibly some more nuanced tests around the security index availability/state )
  4. CLI tool calls the change password API and sets the password of the elastic user to the requested value
  5. CLI tool deletes the temp user from the file realm and verifies its deletion
  6. CLI tool exits.
Requirements satisfied
  • Easy to use ✔️
  • Should be generally available: 👍 👎 Currently file realm is enabled by default but disabled implicitly when other realms are explicitly defined. We are deprecating and changing this behavior for 8.0.0 though, which means that we can expect the file realm to be generally available in the most cases this tool is used.
  • Allow to set the password to a specific value of automatically generate one: ✔️
  • Need not cover other built-in users, as access to elastic credentials would allow to set the password of any other built-in (or otherwise) user, via the change password API: ✔️
  • Should not change our existing threat model : ✔️ ( Users with write access to the elasticsearch config directory can already use the same process to reset the password, albeit manually )
  • Should not depend on external services or personal information ( email based flows etc ) : ✔️

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions