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

Mask Custom Variables in Pipeline Job

    Details

    • Similar Issues:

      Description

      At the moment, I am using something like below to fetch credentials (from Jenkins Credentials store) and then use it in Pipeline jobs.

      withCredentials([string(credentialsId: 'AWS_ACCESS_KEY_ID', variable: 'AWS_ACCESS_KEY_ID'),
      string(credentialsId: 'AWS_SECRET_ACCESS_KEY', variable: 'AWS_SECRET_ACCESS_KEY')])
      

      I have a requirement where the password or any other secure string has to be fetched from somewhere else (credstash for example). I can script this out in groovy and get the secret into a variable (say env.MYSECRET), but I am not sure if it is possible to mask this variable MYSECRET.

      Can this be done with the latest version of the plugin? If not, can you pls take this as a feature request.

        Attachments

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Do you consider writing a small plugin which provides credentials from credstash using a standard Credentials API? In such case you would be able to get a secure variable in the environment using the Credentials Binding plugin.

          I would be the recommended approach.

          Show
          oleg_nenashev Oleg Nenashev added a comment - Do you consider writing a small plugin which provides credentials from credstash using a standard Credentials API? In such case you would be able to get a secure variable in the environment using the Credentials Binding plugin. I would be the recommended approach.
          Hide
          vikas027 Vikas Kumar added a comment -

          Thanks for the response Oleg Nenashev. At the moment, I have no idea about writing a custom Jenkins Plugin. Let me Google it, I believe that is the only option I have

          Show
          vikas027 Vikas Kumar added a comment - Thanks for the response Oleg Nenashev . At the moment, I have no idea about writing a custom Jenkins Plugin. Let me Google it, I believe that is the only option I have
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Sorry, I was unable to find any time to work on this plugin. I have decided to mark it for adoption, so anybody is welcome to take ownership and to work on this issue.

          Show
          oleg_nenashev Oleg Nenashev added a comment - Sorry, I was unable to find any time to work on this plugin. I have decided to mark it for adoption, so anybody is welcome to take ownership and to work on this issue.
          Hide
          navi86 Ivan Krylov added a comment -

          is there any progress related to mask custom variables ?

          Show
          navi86 Ivan Krylov added a comment - is there any progress related to mask custom variables ?
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          AFAIK no. I know it is getting worse with the recent security advisories

          Show
          oleg_nenashev Oleg Nenashev added a comment - AFAIK no. I know it is getting worse with the recent security advisories

            People

            • Assignee:
              Unassigned
              Reporter:
              vikas027 Vikas Kumar
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: