I am developing a backend service which exposes APIs. I have decided to use vault to store the tokens to access these APIs.
Right now I am storing and rotating the keys manually in vault. This is my sample code to read secrets from vault.
func (v *vImpl) readSecret (name string) {
secret, err := v.client.Logical().Read(path)
if err != nil {
return nil, err
}
/* process secrets*/
}
While reading the secret from vault, I would like to check if the key has been stored in vault for the past 6 months. If so, I would like to rotate it.
Is there a way to check when the key was added in vault?