Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-61685

wrap: General Build Wrapper with class MaskPasswordsBuildWrapper not working

XMLWordPrintable

      Hi,

      The below code prints the user and password value when shell command is executed in Jenkins pipeline.

       

      wrap([$class: 'MaskPasswordsBuildWrapper', varPasswordPairs: [[password: 'id', var: 'clientid'], [password: 'secret', var: 'clientsecret']]]) {
          sh "newman run collection.json --env-var user=${id} --env-var password=${secret}"

      The whole purpose of the password masking is lost here

      NB: If one does only an echo of the above command (for instance [echo "newman run collection.json --env-var user=${id} --env-var password=${secret}"], the mask works fine. But it doesn't work in shell commands.

      Thanks!

            Unassigned Unassigned
            _peedus _peedus
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: