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

Active Choice Plugin - Annotation Grapes cannot be used in the sandbox

    XMLWordPrintable

Details

    Description

      If I upgrade to v2.5.1 from v2.4 my active choice parameters fail with a security issue " Annotation Grapes cannot be used in the sandbox"

      My script is a groovy scriptler script with @Grab annotation in it to pull in a library.

       

      Rollback to v2.4 fixes the issue so something in 2.5 or 2.5.1 has broken this. Maybe I am missing a parameter in my scriptler script to not run in sandbox?

       

      Full stack trace attached

      Attachments

        1. scriptapproved.png
          scriptapproved.png
          7 kB
        2. stacktrace.txt
          30 kB
        3. Uno-Choice-1.log
          389 kB

        Activity

          livelace Oleg Popov added a comment -

          It works for me! Thanks!

          livelace Oleg Popov added a comment - It works for me! Thanks!

          Under Jenkins 2.277.x the plugin does not work in connection with a Scripter script.
          New stacktrace log is attached: Uno-Choice-1.log

          it12lsp Christian Häussler added a comment - Under Jenkins 2.277.x the plugin does not work in connection with a Scripter script. New stacktrace log is attached: Uno-Choice-1.log

          it12lsp 2.6.0 had this issue in the unreleased release notes could you try again with 2.6.0, please? I've moved the issue to closed as part of the release process, but feel free to move back to reopened if the issue persists. Thanks!

          kinow Bruno P. Kinoshita added a comment - it12lsp 2.6.0 had this issue in the unreleased release notes could you try again with 2.6.0, please? I've moved the issue to closed as part of the release process, but feel free to move back to reopened if the issue persists. Thanks!
          ravikp Ravi KP added a comment -

          I tried with active choice version 2.6.0 and jenkins version 2.332.3. I tried with Grapes and a simple Grab as well. The following code doesn't work in the mentioned versions

          properties([
              parameters([
                  [$class: 'ChoiceParameter', choiceType: 'PT_SINGLE_SELECT',name: 'RELEASE_VER', description: 'Release Version to Deploy', filterLength: 1, filterable: true,
                      script: [
                              $class: 'GroovyScript',
                              fallbackScript: [classpath: [], sandbox: true, script: "return['Error']"],
                              script: [classpath: [], sandbox: true, script: '''
                                  @Grab("com.google.guava:guava:31.0.1-jre")
                                  import com.google.common.collect.Lists
                                  return Lists.newArrayList("a", "b")
                              '''
                              ]
                          ]
                  ]
              ])
          ])
          
          ravikp Ravi KP added a comment - I tried with active choice version 2.6.0 and jenkins version 2.332.3. I tried with Grapes and a simple Grab as well. The following code doesn't work in the mentioned versions properties([ parameters([ [$class: 'ChoiceParameter' , choiceType: 'PT_SINGLE_SELECT' ,name: 'RELEASE_VER' , description: 'Release Version to Deploy' , filterLength: 1, filterable: true , script: [ $class: 'GroovyScript' , fallbackScript: [classpath: [], sandbox: true , script: " return [ 'Error' ]" ], script: [classpath: [], sandbox: true , script: ''' @Grab( "com.google.guava:guava:31.0.1-jre" ) import com.google.common.collect.Lists return Lists.newArrayList( "a" , "b" ) ''' ] ] ] ]) ])
          ravikp Ravi KP added a comment -

          kinow - I recently joined in this group. I clicked "re-review" button. Let me know if that's not the right way to report on an existing issue.

          ravikp Ravi KP added a comment - kinow - I recently joined in this group. I clicked "re-review" button. Let me know if that's not the right way to report on an existing issue.

          People

            kinow Bruno P. Kinoshita
            presslej James Pressley
            Votes:
            5 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated: