I’m using Jenkins Vault plugin, and I want to get the value of authentication and Secret in a way other than Approle.
I want to specify the Policy of KV to get the Secret of Userpass and specify Credentails in Jenkins.
I thought that if “Vault Username-Password Credential” is used as Credentails, Userpass setting is possible, but I’m currently facing a problem.
First, my Credentail setting is as follows.
My Userpass
Username:admin Password:admin
Here is my pipeline setup:
def secrets = [
[path: 'kv-v2/data/jenkins/naver', engineVersion:1, secretValues: [
[envVar: 'naverdm', vaultKey: 'naverdm']]],
]
def configuration = [vaultUrl: 'http://127.0.0.1:8200', vaultCredentialId: 'vault-kv', engineVersion: 1]
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '20'))
disableConcurrentBuilds()
}
stages{
stage('Vault') {
steps {
withVault([configuration: configuration, vaultSecrets: secrets]) {
sh "date"
sh "ls"
sh "echo $naverdm"
sh "curl -v $naverdm"
}
}
}
}
}
My jenkins console error is as follows:
Is there something wrong with my settings?