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

Document that Bitbucket Server admin token credential secures itself by forcing to SYSTEM scope




      The Bitbucket Server integration plugin expects an administrator to create a personal access token in Bitbucket Server and add it to Jenkins as a credential. The help text of this feature says:

      Providing this token will allow your users to automatically set up build triggers when creating Jenkins jobs. They won't be able to use it for anything else.

      At a first glance, this seems to fly against what is taught in Limitations of Credentials Masking and JENKINS-50242 (comment): that global credentials can be freely used by jobs.

      However, from looking at the credentials.xml file in the Jenkins master, the Bitbucket Server admin token actually has SYSTEM scope rather than GLOBAL scope, and there is no way to change the scope to GLOBAL in the user interface. I think the credential is actually secure as advertised, and the security does not depend on whether e.g. Credentials Binding Plugin can call methods of the com.atlassian.bitbucket.jenkins.internal.config.BitbucketTokenCredentialsImpl class via some interface.

      On the other hand, because the scope field does not appear in the UI for this type of credential, it is not obvious to a Jenkins administrator that the scope is SYSTEM, especially when other types of credentials in the credential store "System" and domain "Global credentials (unrestricted)" can have either GLOBAL or SYSTEM scope.

      Please edit the help text or other parts of the UI to make it clear that this type of credential always has SYSTEM scope and that is the mechanism with which the credential is protected from authors of jobs. Such an explanation would let the Jenkins administrator be more confident that the Bitbucket Server access token truly is secure, as both Jenkins administrators and plugin authors have made mistakes in this area in the past.


        Issue Links



              Unassigned Unassigned
              kon Kalle Niemitalo
              1 Vote for this issue
              2 Start watching this issue