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

Plugin sets password to "*** Not Valid For Display ***"

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Critical Critical
    • None

      I don't understand all of the details of JENKINS-70787 so the issue below may be related to it.

      From https://community.jenkins.io/t/passing-credential-into-powershell-interpolation-challenges/28111:

      In my use, Thycotic-based passwords are not being set correctly in the variable.

      I am using this demo pipeline:

       

      pipeline {
          agent any
          stages {
              stage('Cred Test') {
                  steps {
                      withCredentials([usernamePassword(credentialsId: 'NON-SS-CREDTEST', passwordVariable: 'impersonation_userpw', usernameVariable: 'impersonation_username')]) {
      //                withCredentials([usernamePassword(credentialsId: 'SS-CREDTEST', passwordVariable: 'impersonation_userpw', usernameVariable: 'impersonation_username')]) {    
                          print 'impersonation_userpw.collect { it }=' + impersonation_userpw.collect { it }
                          powershell(returnStdout: true, script: '''
                              #. $PROFILE
                              Write-Host "Run-ScriptBlockImpersonated -Username $env:impersonation_username -Password `"$env:impersonation_userpw`" -LogonType 4"
                              
                              Write-Host $(Get-ChildItem Env: | %{
                                  $len = [Math]::Min(50,$_.Value.Length)
                                  "{0}`t{1}....`r`n" -f $_.Name,$_.Value.substring(0,$len)}
                              )
                              
                              '''
                          )
                      }             
                  }
              }
          }
      }
       

       

       

       

      Normal/Jenkins-stored username+password:
      Password's first few characters revealed if I print the variables:
      HUDSON_URL http://loc....
      impersonation_username netspar....
      impersonation_userpw S%0E-fM....
       

      Thycotic plugin password:

      The string ` "*** Not Valid For Display ***"` is in the password variable.

       

      [Pipeline] echo
      impersonation_userpw.collect { it }=[*, *, *,  , N, o, t,  , V, a, l, i, d,  , F, o, r,  , D, i, s, p, l, a, y,  , *, *, *]
      [Pipeline] powershell
      
      HUDSON_URL	http://loc....
      impersonation_username	svc-sec....
      impersonation_userpw	*** Not Va.... 

       

       

       

       
       

            thycotic_dsv Thycotic Dev
            hukel Hugh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: