hashicorp-vault-plugin icon indicating copy to clipboard operation
hashicorp-vault-plugin copied to clipboard

Wrong token re-use with multiple vault instances

Open hapeka72 opened this issue 3 years ago • 0 comments

Hi,

in our project setting we are using a single Jenkins instance to run tasks (e.g. deploy, test, etc.) against several different systems. Due to our infrastructure constraints and guidelines we have to use multiple vault instances (in fact we have two). We are using the approle authentication and we have a role with the same role id in both vaults. With the latest version of the vault plugin we have run into an issue with this setup, because it seems that the plugin caches the tokens it gets from the vault based on the credential id defined in Jenkins, but ignoring the vault instance that created it. This lead to errors because the plugin tries to use a token which it got from one vault in requests to the other vault. I was able to work around this issue by defining two credential ids, one for each vault, with both using the same role id. But I think the token caching should take the vault url into account to avoid these issues.

hapeka72 avatar Jan 20 '21 09:01 hapeka72