hashicorp / hashicorp/vault-plugin-database-couchbase
Admin password rotation could be achieved using less privileges
- Dominant language
- Go
- Stars
- 7
- Forks
- 3
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 4
Description
Hello,
When following the instructions to set up Vault-Couchbase configuration, we granted roles "Cluster Admin" and "Security Admin" to the vault admin user, and saw the following error when trying to rotate the password:
```
~ » vault write -force database/rotate-root/my-couchbase-database
Error writing data to database/rotate-root/my-couchbase-database: Error making API request.
URL: PUT http://127.0.0.1:8200/v1/database/rotate-root/my-couchbase-database
Code: 500. Errors:
* 1 error occurred:
* failed to update user: {"message":"Forbidden. User needs one of the following permissions","permissions":["cluster.admin.security.admin!write"]} | {"unique_id":"7e84bc10-ba53-427e-a103-73c48b441e34","endpoint":"http://127.0.0.1:8091"}
```
We did some experiments and found that it seems [the Full Admin role](https://docs.couchbase.com/server/current/learn/security/roles.html#full-admin) is a must to achieve password rotation.
We have verified roles "Cluster Admin" and "Security Admin" are enough to change user passwords by using this [changePasswod](https://docs.couchbase.com/server/6.6/rest-api/rest-node-set-username.html#changing-password) API. While currently, the couchbase plugin is using [this one](https://github.com/couchbase/gocb/blob/353be08499ac7febd8a1274c7c4ca990f37a4d5c/cluster_usermgr.go#L466) (correct me if I am wrong).
It's definitely better if we could minimize the permissions needed by this vault db admin user. Please suggest if missed anything or is it possible to fix it? Thank you in advance for any help!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.