Hello,
I’m testing HashiCorp Vault integration with Jenkins by running it with Docker in Dev mode.
Currently I can retrieve secrets from engines with simple path name like,
- secret/userpass
- mysecret/userpass
Further testing, I started to have my engines with a bit more complex path name like,
- kv/somecred/google/db/userpass (This reflects from my production version usage)
However, I cannot retrieve the one with complex path “kv/somecred/google/db/userpass” as normally.
Here is my Jenkins pipeline
node {
def secrets = [
[
path: ‘secret/userpass’,
engineVersion: 2,
secretValues: [
[envVar:‘passwdd’, vaultKey: ‘user’]
]
],
[
path: ‘mysecret/userpass’,
engineVersion: 2,
secretValues: [
[envVar:‘passv2’, vaultKey: ‘user’]
]
],
[
path: ‘kv/somecred/google/db’,
engineVersion: 2,
secretValues: [
[envVar:‘passwddd’, vaultKey: ‘user’]
]
],
]
def configuration = [vaultUrl: ‘http://vault:8200’,
vaultCredentialId: ‘vault-jenkins-role’,
engineVersion: 2,
skipSslVerification: true,
timeout: 60]
withVault([configuration: configuration, vaultSecrets: secrets]) {
sh ‘echo $passwdd’
sh ‘echo $passv2’
sh ‘echo $passwddd’
}
}
And my jenkins role policy
While on Jenkins I cannot retrieve it, on CLI, it can be retrieved normally, with AppRole generated token logged in.