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

Externals With(out) additional credentials is not clear

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • subversion-plugin
    • Subversion Plugin 2.5.3

      The current way of authentification for external references in a project is not clear.
      See the extended discussion in JENKINS-22542

      We specify Credentials to use for check out. With these credentials you have complete (read-only) access to the project and its externals. (project and externals are in the same repository).
      Why do we need to specify these same credentials again just to get the change log?
      For security? but the check out is already successful.

      Dave (our evil developer) can add an external to SecretProjectC to projectA.
      Dave can no longer do a complete checkout locally as he has no access to projectC.
      When the build server has access (svn user Jenkins with global read only access)
      Now the build server can access SecretProjectC (because another external in projectA requires the additional credentials).

      So you rely on having configured exluded svn user Jenkins from secret projects.
      In which case the checkout already fails, as this requires additional credentials which Dave (hopefully) cannot configure in the build server.

      I suggest to
      1: remove the need for additional credentials when all items in a project require the same credentials.
      2: Make he selection of credentials a drop down without the need to type the realm (as the realm is already encoded in the credentials.
      Edit: second option removed as the 'encoded realm' is only a comment

          [JENKINS-29079] Externals With(out) additional credentials is not clear

          Rene Affourtit created issue -

          Daniel Beck added a comment - - edited

          1: remove the need for additional credentials when all items in a project require the same credentials.

          stephenconnolly explained somewhere in this Jira that malicious SCM committers can point externals to a server they control to syphon off the credentials used by Jenkins.

          Quoting https://wiki.jenkins-ci.org/display/JENKINS/Subversion+Plugin

          they can be a route to hijacking credentials that in most cases have full read access to the entire repository and not just the limited subset of the repository that an individual committer's credentials may have read access to. The recommended way to handle externals is to add those as additional modules directly. Thus ensuring that even if a committers machine is hacked or otherwise compromised, their credentials cannot be used to commit a modified build script and svn:external definition that allows the entire contents of the Subversion repository to be zipped up and FTP'd to a remote server)


          2: Make he selection of credentials a drop down without the need to type the realm (as the realm is already encoded in the credentials.

          I don't understand what you mean. The comment added in the 1.x to 2.x credential migration is entirely optional and has no meaning besides UI use, and the credentials domains are completely unrelated.

          Daniel Beck added a comment - - edited 1: remove the need for additional credentials when all items in a project require the same credentials. stephenconnolly explained somewhere in this Jira that malicious SCM committers can point externals to a server they control to syphon off the credentials used by Jenkins. Quoting https://wiki.jenkins-ci.org/display/JENKINS/Subversion+Plugin they can be a route to hijacking credentials that in most cases have full read access to the entire repository and not just the limited subset of the repository that an individual committer's credentials may have read access to. The recommended way to handle externals is to add those as additional modules directly. Thus ensuring that even if a committers machine is hacked or otherwise compromised, their credentials cannot be used to commit a modified build script and svn:external definition that allows the entire contents of the Subversion repository to be zipped up and FTP'd to a remote server) 2: Make he selection of credentials a drop down without the need to type the realm (as the realm is already encoded in the credentials. I don't understand what you mean. The comment added in the 1.x to 2.x credential migration is entirely optional and has no meaning besides UI use, and the credentials domains are completely unrelated.

          Rene Affourtit added a comment - - edited

          2: Make he selection of credentials a drop down...
          The comment added (...) is entirely optional and has no meaning besides UI use (...)
          During my investigations I found that out too,
          I assumed that because the comment is an exact match of the credential domain, the domain was encoded in the credential. However, this is a value which can be modified by the user and is not suitable for looking up credentials for a specific domain.


          1: My 'problem' is that in subversion 2.4.x we needed to specify only one set of credential, but now we need to re-specify the same credentials.
          in a way which is not clear enough judging by the number of issues being reported (29237, 29225, 29211, just judging by the descriptions) (Edit, I stand corrected, these are separate issues)
          The described route to hijacking still exists (and will always exist when there is a single with global read-only access).
          I'm wondering what the added security is.
          Yes, when 'dave' adds an external to DavesFakeServer he should not receive the company credentials.
          But what happens during a check-out? (the actual check out is successful)

          ...

          Rene Affourtit added a comment - - edited 2: Make he selection of credentials a drop down... The comment added (...) is entirely optional and has no meaning besides UI use (...) During my investigations I found that out too, I assumed that because the comment is an exact match of the credential domain, the domain was encoded in the credential. However, this is a value which can be modified by the user and is not suitable for looking up credentials for a specific domain. 1: My 'problem' is that in subversion 2.4.x we needed to specify only one set of credential, but now we need to re-specify the same credentials. in a way which is not clear enough judging by the number of issues being reported (29237, 29225, 29211, just judging by the descriptions) (Edit, I stand corrected, these are separate issues) The described route to hijacking still exists (and will always exist when there is a single with global read-only access). I'm wondering what the added security is. Yes, when 'dave' adds an external to DavesFakeServer he should not receive the company credentials. But what happens during a check-out? (the actual check out is successful) ...

          Daniel Beck added a comment -

          I'm wondering what the added security is.

          You can choose to not support externals in your instance and require those locations be configured in the job instead.

          I wonder whether that would be sufficient; so that any credentials configured for a location will also be used for its externals, if we're not ignoring them.

          Daniel Beck added a comment - I'm wondering what the added security is. You can choose to not support externals in your instance and require those locations be configured in the job instead. I wonder whether that would be sufficient; so that any credentials configured for a location will also be used for its externals, if we're not ignoring them.

          Daniel Beck added a comment -

          stephenconnolly Wouldn't it suffice to prevent the evil scenario of hijacked externals to just ignore externals? This way, Jenkins could reuse the same credential used for the repository for the external, making configuration less of a hassle, and paranoid users could choose to not support externals at all.

          Daniel Beck added a comment - stephenconnolly Wouldn't it suffice to prevent the evil scenario of hijacked externals to just ignore externals? This way, Jenkins could reuse the same credential used for the repository for the external, making configuration less of a hassle, and paranoid users could choose to not support externals at all.

          If we have ignoreExternals enabled by default and display a warning when you turn it off, then it might be acceptible... but better would be a check box to allow using credentials for externals and display a warning if you turn it on

          Stephen Connolly added a comment - If we have ignoreExternals enabled by default and display a warning when you turn it off, then it might be acceptible... but better would be a check box to allow using credentials for externals and display a warning if you turn it on
          Rene Affourtit made changes -
          Description Original: The current way of authentification for external references in a project is not clear.
          See the extended discussion in [JENKINS-22542|https://issues.jenkins-ci.org/browse/JENKINS-22542]

          We specify Credentials to use for check out. With these credentials you have complete (read-only) access to the project and its externals. (project and externals are in the same repository).
          Why do we need to specify these same credentials again just to get the change log?
          For security? but the check out is already successful.

          Dave (our evil developer) can add an external to SecretProjectC to projectA.
          Dave can no longer do a complete checkout locally as he has no access to projectC.
          When the build server has access (svn user Jenkins with global read only access)
          Now the build server can access SecretProjectC (because another external in projectA requires the additional credentials).

          So you rely on having configured exluded svn user Jenkins from secret projects.
          In which case the checkout already fails, as this requires additional credentials which Dave (hopefully) cannot configure in the build server.

          I suggest to
          1: remove the need for additional credentials when all items in a project require the same credentials.
          2: Make he selection of credentials a drop down without the need to type the realm (as the realm is already encoded in the credentials.
          New: The current way of authentification for external references in a project is not clear.
          See the extended discussion in [JENKINS-22542|https://issues.jenkins-ci.org/browse/JENKINS-22542]

          We specify Credentials to use for check out. With these credentials you have complete (read-only) access to the project and its externals. (project and externals are in the same repository).
          Why do we need to specify these same credentials again just to get the change log?
          For security? but the check out is already successful.

          Dave (our evil developer) can add an external to SecretProjectC to projectA.
          Dave can no longer do a complete checkout locally as he has no access to projectC.
          When the build server has access (svn user Jenkins with global read only access)
          Now the build server can access SecretProjectC (because another external in projectA requires the additional credentials).

          So you rely on having configured exluded svn user Jenkins from secret projects.
          In which case the checkout already fails, as this requires additional credentials which Dave (hopefully) cannot configure in the build server.

          I suggest to
          1: remove the need for additional credentials when all items in a project require the same credentials.
          -2: Make he selection of credentials a drop down without the need to type the realm (as the realm is already encoded in the credentials.-
          Edit: second option removed as the 'encoded realm' is only a comment
          Manuel Recena Soto made changes -
          Assignee New: Manuel Recena Soto [ recena ]
          Manuel Recena Soto made changes -
          Environment Original: subversion plugin 2.5 New: Subversion Plugin 2.5.3
          Manuel Recena Soto made changes -
          Priority Original: Minor [ 4 ] New: Major [ 3 ]

            thebro Kevin Broselge
            renea Rene Affourtit
            Votes:
            19 Vote for this issue
            Watchers:
            22 Start watching this issue

              Created:
              Updated:
              Resolved: