Sanitize private_key from returned db plugin config #10416
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If you go through the docs for setting up mongodbatlas-database-plugin, and then run
vault read database/config/my-mongodbatlas-database
, you'll get the following:vault read database/config/my-mongodbatlas-database Key Value --- ----- allowed_roles [my-role] connection_details map[private_key:ea6acbc7-8a30-4a3f-812e-6f869c08bcd1 project_id:4f96cad208574fd14aa8dda3a public_key:jmskfortvf] password_policy n/a plugin_name mongodbatlas-database-plugin root_credentials_rotate_statements []
The
private_key
is a sensitive value that should not be printed back out.We already sanitize
password
for all DB plugins, including in the connection URL, and that covers the sensitive information for all other builtin database plugins. The only exception is hashicorp/vault-plugin-database-mongodbatlas. While we should provide a mechanism for non-builtin plugins to specify config fields as sensitive, this one-liner fix at least shores up the last of the builtin plugins.