Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefixPath : Generalization to other usages and Secret Parameter configuration #84

Closed
lenaing opened this issue Mar 6, 2020 · 1 comment · Fixed by #106
Closed

prefixPath : Generalization to other usages and Secret Parameter configuration #84

lenaing opened this issue Mar 6, 2020 · 1 comment · Fixed by #106

Comments

@lenaing
Copy link
Contributor

lenaing commented Mar 6, 2020

Hello,

Thanks to #67 we can (finally !) request secrets from non-at-root mounted KVs. And that's great ! 👍

Now we can do this in a scripted pipeline :

def secrets = [
    [path: 'test/nonrootkv/secret', secretValues: [[envVar: 'result', vaultKey: 'secretkey']]]
]

def configuration = [
    vaultUrl: 'https://vault.example.com',
    prefixPath: 'test/nonrootkv/',
    vaultCredentialId: 'credentialID'
]

pipeline {
    agent {
        node {
            label 'default'
        }
    }
    stages {
        stage('Test get Secret'){
            steps {
                script {
                    withVault([configuration: configuration, vaultSecrets: secrets]) {
                        sh 'if [ -n "${result}" ]; then echo "variable is defined" && echo "test${result}"; else exit 1 ; fi'
                    }
                }
            }
        }
    }
}

However :

  • This isn't documented in the README.md
  • It would be nice to enable the prefixPath parameterization at many levels. On the top of my head I think about non-at-root mounted authentication endpoints. This would enable tidying of users' Vault mount points rather than requiring them to have everything mounted at the Vault root.
  • The Vault Secret UI config parameter does not enable a user to set a prefixPath for a non-root KV (and fails to read such secrets) :
    vault_secret

Kind regards

@jetersen
Copy link
Member

jetersen commented Mar 6, 2020

Feel free to submit a PR your halfway there anyhow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants