-
Notifications
You must be signed in to change notification settings - Fork 175
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
sensuctl does not provide a way to get the value of a password for a user #1437
Comments
CC: @treydock |
Exposing the bcrypt hash could be sufficient and something we can use in Ruby and thus Puppet. Not having to rely on bcrypt in Puppet would be super handy but looks like sensu-go stores passwords hashed with bcrypt.
|
We don't actually store the user's password, only the hash, as you note. I don't think we would consider storing plaintext passwords, but we could report the hash for admins. I think from a security standpoint it might be more desirable to consider the password "changed" no matter what the current state is, but I suppose in this case, exposing the hash for admin is pretty low-risk. |
To be clear, we agree that plain text passwords should not be stored. We are looking for a hash that we can both read and easily generate. When you say |
In the very rare use case where the sensu administrator does not have read access to the etcd store, retrieving the password hash, or even reporting if the password has not changed, could be seen as a security vulnerability. Exposing the hash could in theory allow someone to crack the password of a user. Right now, that can be locked down by making sure that the sensu admin user doesn't have access to the raw etcd store. To be clear: I highly doubt this will actually be the case, so I'm in favour of exposing the hash. |
Let me know if this warrants a new issue but would be handy if |
@echlebek Passing the hash with |
@treydock I see. What would be the ideal mechanism here? A parameter for |
@echlebek we also need a sensuctl subcommand to create and output a password hash for a password string for consistency across platforms. |
@portertech yep, see #1768 |
@echlebek Ideally we could do something like
|
Sensu Engineering has a few ideas:
|
Puppet operates on state so the only one that would work with Puppet is 2, testing the credentials passed to Puppet actually work. The issue with 2 is that one trick we use in Puppet is prefetching where a single command fetches the state for all objects before evaluating the puppet resources that are defined. This saves time and allows for purging, meaning unmanaged resources can be removed. This is actually very attractive for users resource, allowing Puppet to remove unmanaged sensu users from an instance of sensu-backend. The only way to do this would be to expose all users and their attributes similar to things like checks. So to summarize, we can make 2 work but it's far from ideal. For Puppet the most ideal solution is exposing the bcrypt hash. |
I built sensu-go from source and tested some prototype Puppet code and #2278 will work for Puppet and still allow helpful features like removing unmanaged users. |
Configuration management tools need both get and set methods to ensure idempotency. We do a get to see if the system is in the desired state and if not, then do a set. If there is no get, then the set always runs, which is not idempotent.
sensuctl user list
does not have a way to get the password, so there is no idempotent way to set the password.Expected Behavior
sensuctl user list
has a way of showing the actual password or a hashed password. This way it can be matched against desired state and the configuration management tool can decide if the password needs to be updated.Current Behavior
sensuctl user list
does not allow you to see the current state with regards to a user's password.Possible Solution
Output a sha256 hash of the password.
Only allow the
admin
role to do so.Context
This is needed for configuration management tools to act in an idempotent way.
Your Environment
sensu-ctl version dev-nightly#cc2ded6, build cc2ded623f0646610c0d3135430544dc2993169b, built 2018-05-03T09:26:06+0000
Installation method (packages, binaries, docker etc.): packages
Operating System and version (e.g. Ubuntu 14.04): EL7
The text was updated successfully, but these errors were encountered: