Search code examples
hashicorp-vaultvault

Can you tell when the secret_id will expire in Vault


I recently updated an AppRole secret_id using the following command

vault write -tls-skip-verify auth/approle/role/my-super-role-name/secret-id secret_id_ttl=4320h

How can I know when that secret-id will expire?

Since I ran the command I know that it will expire in 4320h hours, but is there a way to check the expiration if you didn't create it?

I know you can check secret_id_ttl using

vault read -tls-skip-verify auth/approle/role/my-super-role-name/secret-id-ttl

Key              Value
---              -----
secret_id_ttl    4320h

But that only shows how much it was set to initially it doesn't serve as a count down.


Solution

  • This will print info about creation_time, expiration_time, last_updated_time of specified secret-id: https://www.vaultproject.io/api/auth/approle#read-approle-secret-id