Support JobDSL without security check if called from a global pipeline lib

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      When using JobDSL in pipeline scripts [1] that are configured globally (and hence are trusted) [2], the script security should be automatically disabled [3].

      At the moment the only workaround is to globally disable the script security for the JobDSL plugin [4] (but then it can also be used in regular Jenkinsfiles!) or to manually approve all incarnations (not feasible for us, we have way too many incarnations that may come in).

      It should be possible to check in the implementation of the jobDsl command, if the caller is in trusted context already. If yes, all security checks should be skipped.

      [1]
      https://github.com/jenkinsci/job-dsl-plugin/wiki/User-Power-Moves#use-job-dsl-in-pipeline-scripts

      [2]
      https://jenkins.io/doc/book/pipeline/shared-libraries/#global-shared-libraries
      https://github.com/jenkinsci/workflow-cps-global-lib-plugin

      [3]
      https://github.com/jenkinsci/job-dsl-plugin/wiki/Migration#migrating-to-160
      https://github.com/jenkinsci/job-dsl-plugin/wiki/Script-Security

      [4]
      https://github.com/jenkinsci/job-dsl-plugin/wiki/Script-Security#disabling-script-security

            Assignee:
            Jamie Tanna
            Reporter:
            Georg Henzler
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: