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

/ad/rotate-root API endpoint doesn't work if the ad engine was configured with "upndomain" #19028

Open
godeater opened this issue Feb 7, 2023 · 2 comments
Labels
bug Used to indicate a potential bug core/api ecosystem secret/ad

Comments

@godeater
Copy link

godeater commented Feb 7, 2023

Describe the bug
On a newly configured Vault system, I was attempting to use the "rotate-root" API endpoint after setting up a new Active Directory secrets engine. What happened was I got an error back from Vault (see below):

curl -H "X-Vault-Token: $VAULT_TOKEN" https://vault.example.com/v1/ad/rotate-root
{"errors":["1 error occurred:\n\t* LDAP Result Code 34 \"Invalid DN Syntax\": 0000208F: NameErr: DSID-03100232, problem 2006 (BAD_NAME), data 8350, best match of:\n\t'svc-vault'\n\u0000\n\n"]}

I eventually figured out that this was down to me using the optional "upndomain" parameter when I was configuring the secrets engine. If I reconfigured it without that, and passed a full distinguishedName as the binddn instead of the short form you can use with upndomain, then the rotate-root endpoint works.

To Reproduce
Steps to reproduce the behavior:

  1. Run vault write ad/config binddn='svc-vault' bindpass=$PASSWORD url=ldaps://your.ad.server userdn='some_dn_in_your_domain' upndomain='short_name_for_ad_domain'
  2. Run curl -H "X-Vault-Token: $VAULT_TOKEN" https://vault.example.com/v1/ad/rotate-root
  3. See error

Expected behavior
I expect to see no error returned, and the binddn password rotated successfully inside vault.

Environment:

  • Vault Server Version (retrieve with vault status): 1.12.2
  • Vault CLI Version (retrieve with vault version): 1.12.2
  • Server Operating System/Architecture: Linux/amd64
@godeater
Copy link
Author

godeater commented Feb 7, 2023

Referencing this issue too : hashicorp/vault-plugin-secrets-ad#84 as it seems relevant.

@heatherezell heatherezell added core/api secret/ad bug Used to indicate a potential bug labels Feb 13, 2023
@hghaf099 hghaf099 added bug Used to indicate a potential bug ecosystem and removed bug Used to indicate a potential bug labels May 4, 2023
@aram535
Copy link
Contributor

aram535 commented Oct 6, 2023

Just in case this helps someone else -- the "root" account must have OU level password rotation access in AD before it can rotate even its own password. This is not documented currently. I'll make a PR for the documentation to update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to indicate a potential bug core/api ecosystem secret/ad
Projects
None yet
Development

No branches or pull requests

4 participants