Skip to content
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

Support display_name in mysql db plugin query map #8246

Open
bigman3 opened this issue Jan 27, 2020 · 1 comment
Open

Support display_name in mysql db plugin query map #8246

bigman3 opened this issue Jan 27, 2020 · 1 comment

Comments

@bigman3
Copy link

bigman3 commented Jan 27, 2020

Is your feature request related to a problem? Please describe.
Map mysql generated username to an entity display name. As Far as I understand this mapping is not available anywhere, and no way to correlate randomly generated user name to the entity.

Describe the solution you'd like
Add display name as a parameter available for prepared statement.
With this supported, we would be able to manage a mapping/metadata table outside of Vault, by adding creation statement using the displayName parameter.

Append displayName derived from usernameConfig to the queryMap in mysql.go plugin implementation:
queryMap := map[string]string{ "name": username, "password": password, "expiration": expirationStr, }

Describe alternatives you've considered
External wrapping api, which will forward database/creds/role request, and also manage the mapping.

@pcman312
Copy link
Contributor

pcman312 commented Feb 24, 2021

Hi @bigman3 ! If I understand your request correctly, you would like to apply the DisplayName provided via Vault somewhere within the creation statements. The display name comes from the Vault token and is usually something like token, token-displayname, userpass, etc. Is this the data you would like to see, or do you want the name of the role created in the database engine?

In Vault 1.7 (coming soon) we are introducing the idea of username_template to some* of our secret engines. This will give the ability to fully customize how a username is generated prior to passing that username to the appropriate statements run in the database. Each engine will default to the current behavior, but this will allow for customization if that default does not suit their needs.

This will give users the ability to specify all aspects of a username, including where (or if) the DisplayName and RoleName is used. This was designed to give users more control over matching a dynamic username to a particular group/person/entity within their organization, however it also can also be used to match unusual requirements for usernames that are not handled by the default username generation.

There will be docs available through https://www.vaultproject.io once 1.7 is released will describe this in more detail but I wanted to give you a heads up for this new feature coming soon!

Does this help solve your problem? If not, please let us know.

* - engines supported in 1.7: PostgreSQL, MSSQL, MySQL, MongoDB (not MongoDB Atlas), Cassandra, Oracle, Couchbase, and OpenLDAP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants