Feature request: improve password hygeine / security
- Dominant language
- C++
- Stars
- 4.4k
- Forks
- 658
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 10
Description
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/kvrocks/issues) and found no similar issues.
### Motivation
Improve handling of cleartext passwords, keeping them out of version control in particular, and to follow industry recommended practices.
### Solution
Please add an option to configure kvrocks with a sha256 hash of the actual password, rather than using cleartext. Though similar to the Redis `#` [ACL option](https://redis.io/docs/latest/commands/acl-setuser/), it could be implemented separately from any ACL functionality, as an alternative to using the *requirepass* directive, perhaps with a kvrocks.conf *requirepass_sha256* directive, and/or by setting an environment variable, eg: KVROCKS_SECRET_SHA256=e3b0c442...etc... When a client connects and provides its pass, kvrocks would compare the sha256 of that value if enabled, rather than use the cleartext.
Related, it would helpful for kvrocks to support the file-based convention recommended for secrets used in containers. It's often hard to keep regular environment variables out of version control, and they can leak during runtime too. Instead, one environment variable (eg, KVROCKS_PASSWORD_FILE) holds a path to a file in .ini format (key=value pairs just like env vars) which the app loads and uses for its config.
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing how the requirepass directive is configured and checked, including the proposed kvrocks.conf and environment-variable entry points. Compare the requested SHA-256 and password-file behaviors with the Redis ACL option described in the issue. Done means the design is agreed and both secret-handling approaches have defined configuration, runtime behavior, and tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- redis
- Domain
- backend, databases, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100