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

mass password plugin revealing dynamic secret in pipeline view mode

XMLWordPrintable

      Is there currently any way to mask a variable value in pipeline?
      credentials plugin is static, only viable option is mask password plugin
      But there is catch, the variables masked by this plugin if used inside lets say a sh step is still revealed as plain text in pipeline view.

      Example:
      #!/usr/bin/env groovy
      pipeline {
      stages {
      stage('1') {
      steps {
      script {
      def a = 'hello'
      def b = 'world'
      wrap([$class: 'MaskPasswordsBuildWrapper',
      varMaskRegexes: [
      [value: "${a}", key: 'USR'],
      [value: "${b}", var: 'PSW']
      ]
      ])
      {
      sh "./test.sh -Pusername=${a} -Ppassword=${b}"
      }
      }
      }
      }
      }
      }

            Unassigned Unassigned
            abmaster AB S
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: