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

withCredential in Snippet Generator disrespect global credential settings

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

      The builder user has only job/build level permissions ( as below )

      but this account `user` has "vew" permission in `Snippet Generator` -> `withCredential` ( as below )

          [JENKINS-72320] withCredential in Snippet Generator disrespect global credential settings

          Daniel Beck added a comment -

          Could you clarify what behavior you expected to see?

          Users do not need Credentials/View permission to be offered a list of credentials for (job) configuration. Having Job/Configure here is enough.

          Daniel Beck added a comment - Could you clarify what behavior you expected to see? Users do not need Credentials/View permission to be offered a list of credentials for (job) configuration. Having Job/Configure here is enough.

          Marslo Jiao added a comment -

          Hmmm, right, currently Job/Configuration permission can list 'all' available credentials ( since Jenkins 1.0 by using freestyle jobs ).

           

          So, is there any solution to help "keep credential in permission" ? means some of credential can share with Job/Configuration, but some only available for Jenkins admin.

          Marslo Jiao added a comment - Hmmm, right, currently Job/Configuration permission can list 'all' available credentials ( since Jenkins 1.0 by using freestyle jobs ).   So, is there any solution to help "keep credential in permission" ? means some of credential can share with Job/Configuration, but some only available for Jenkins admin.

          Daniel Beck added a comment -
          • Set the Scope of the credential to System (instead of Global) to make the credentials only available to system level configuration (e.g. to connect agents).
          • Define the credentials on a folder than no non-admin user has access to and put the jobs using them in there.

          Anyway, closing, as there doesn't seem to be a bug here.

          Daniel Beck added a comment - Set the Scope of the credential to System (instead of Global) to make the credentials only available to system level configuration (e.g. to connect agents). Define the credentials on a folder than no non-admin user has access to and put the jobs using them in there. Anyway, closing, as there doesn't seem to be a bug here.

          Marslo Jiao added a comment -

          Thanks danielbeck ,

           

          so my case is, some of git ssh credential  ( accounts can push directly ), I'd like it only allow to using for Jenkins Admin, and some of git ssh credential ( accounts can only clone ) allows using for non-admin users in Jenkins pipelines.

          any advise on this ?

           

          marslo

          Marslo Jiao added a comment - Thanks danielbeck ,   so my case is, some of git ssh credential  ( accounts can push directly ), I'd like it only allow to using for Jenkins Admin, and some of git ssh credential ( accounts can only clone ) allows using for non-admin users in Jenkins pipelines. any advise on this ?   marslo

          Daniel Beck added a comment -

          Not currently a supported use case.

          Daniel Beck added a comment - Not currently a supported use case.

            Unassigned Unassigned
            marslo Marslo Jiao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: