Hi,
I used the following steps to configure the AD secrets engine as per the documentation
1. vault secrets enable ad
2. vault write ad/config binddn=ad_account_01 bindpass=account_password url=ldaps://ad_url userdn="OU=Accounts,DC=xxxx,DC=yyyyy,DC=zzzzz,DC=com" insecure_tls=true ttl=86400 max_ttl=864000 (Note: max_ttl is 10 times more than ttl)
4. vault read ad/creds/account_02
Note:
1. I used 1.1 version of Vault
2. ad_account_01 has enough permission to rotate the password for ad_account_02
3. Created an AppRole that has required policy/capability to read/write the path ad/creds.
4. Attached this policy to a user testuser in userpass authentication
5. Whenever the testuser issues the command "vault read ad/creds/account_02", I can see the results as:
Key Value
--- -----
current_password ?@154mMQfatgXppPFzuhL8TFO5USgvGl66uoaic6h9AZnn8nPyfLQzzmSw+
username ad_account_02
Key Value
--- -----
current_password ?@09AZhSnppTG6YrVTNnB0xkYdzfz9T/oYESdaW9GcA8e1qwgGYdvfRCy6W
username svc_vault_test2
with different passwords. I observe that the current_password is getting different values every time. I am able to login to AD with the passwords. This means that vault is rotating the password for this account every time.
As per the documentation, the vault is supposed to rotate upon the expiry of the ttl and until then it needs to provide the old password.
Documentation excerpt: "The default password time-to-live in seconds. Once the ttl has passed, a password will be rotated the next time it's requested."
6. Tried the curl command and here is the output of my curl command:
{
"request_id":"d3b6c92c-9191-feb5-9dd7-cd8a54dc1298",
"lease_id":"",
"renewable":false,
"lease_duration":0,
"data":{
"current_password":"?@09AZvnU29pnNrHwDX1ndeoEi76oBs9wKRKOPuZrSPMJpWkyt11Qt108fc",
"username":"svc_vault_test2"
},
"wrap_info":null,
"warnings":null,
"auth":null
}
When I run the curl command with few seconds delay, I am getting
{
"request_id":"4e442bea-bf5d-ae08-d83b-827ed511d9ea",
"lease_id":"",
"renewable":false,
"lease_duration":0,
"data":{
"current_password":"?@09AZDKa/eLFBDSYtGyvLJp9F51CvaQ2M9T4M7qT4SSmP045L/zcQTOeYc",
"username":"svc_vault_test2"
},
"wrap_info":null,
"warnings":null,
"auth":null
}
The passwords are different.
As per the documentation, I expect
{
"current_password": "?@09AZnh4Q5N4O5zdLk/4F8aIMgsnpDM6te3Mz1wXcZEgZhOa6OR748F96",
"last_password": "?@09AZSen9TzUwK7ZhafS7B0GuWGraQjfWEna5/tVaKFqjXhhGV/Z0v/pBJ",
"username": "my-application"
}
There is a difference in output.
I tried with different version of Vault (1.0, 1.1)
I tried with root-token also.
Am I missing anything here?
Any help will be highly appreciated.
Thanks,
Siva