PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 19th of July, 2020

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[19:02:44] <cyrus_mc_> Wondering if anyone here has ever configured mongodb in HashiCorp Vault. Specifically trying to create a static role that rotations the root/master password (https://learn.hashicorp.com/vault/secrets-management/db-creds-rotation). In this situation you need to supply the rotation statements. Everything I try results in "The database field must be
[19:02:44] <cyrus_mc_> set on Operation"
[19:03:31] <cyrus_mc_> In my attempts I have tried [ "db = db.getSiblingDB('admin')"; "db.changeUserPassword("root", "NEWPASSWORD")" ] but always get the same error
[19:05:18] <cyrus_mc_> I believe the statements might have to be in JSON format (as creating a role works vault write database/roles/my-role db_name=vault creation_statements='{ "db": "admin", "roles": [{ "role": "readWrite" }, {"role": "read", "db": "foo"}] }' default_ttl="1h" max_ttl="24h")
[19:05:29] <cyrus_mc_> not sure how to run the above change password in that type of format
[19:11:53] <cyrus_mc_> https://docs.mongodb.com/manual/reference/method/db.updateUser/ - seems to be what I want, but how do I set the database field to operator on
[19:18:26] <cyrus_mc_> Figured it out. When adding the connection to vault you have to specify the db in the connection string. As it runs m.runCommandWithRetry(ctx, cs.Database, changeUserCmd) reading the database from the connectionString