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

Dynamic role names collisions #23

Closed
timduan opened this issue Feb 3, 2021 · 1 comment
Closed

Dynamic role names collisions #23

timduan opened this issue Feb 3, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@timduan
Copy link

timduan commented Feb 3, 2021

Hi team,

We've been using the vault mongo database plugin for dynamic secret for a while and it all works fine. However after we migrated some to mongo atlas and started to use mongo atlas database plugin, we started to run into dynamic role name creation collisions. We are getting errors: 409 (request "Conflict") A user with username v-xxxxxxxxxxxxxxx-a9 already exists

Comparing with mongo database plugin which username it generated can be as long as 65 chars, the current mongo atlas plugin capped it at 20 chars. While if all 20 chars are used for randomization is probably ok to avoid some level of potential collision, however with the current code design of role name capped at 15 chars long, plus credsutil's leading v and the separating -s, this leaves only 2 chars left for a dynamic username to be different. And with a high number of replica pods requirement we have, this collision will happen quite often.

Could you help to resolve this by either:

  1. Adding the pre-validation within vault to check if any username already been created before calling Atlas to create user.
  2. Reduce the capped role name number from 15 chars to a smaller number.
  3. Bump up the max length from 20 to a larger number.

For now, we have to cut our role name shorter to a non human readable name to overcome the issue, we'd like to see this get fixed for the long term as the fix looks straightforward to do for now before you introducing the function allowing user to customize username length. Thank you!

@pcman312 pcman312 added the enhancement New feature or request label May 24, 2021
@fairclothjm
Copy link
Contributor

@timduan Hello!

We now support username customization for mongodb atlas in Vault 1.8. Support was added to the plugin in this PR: #26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants