How to approve Groovy script?

Issue

  • You have a message saying “A Jenkins administrator will need to approve this script before it can be used.”

Environment

Resolution

Unlike on a classical/on premise Jenkins instance, DEV@cloud administrators don’t have all privileges. For security reasons, you can’t run arbitrary script because your account don’t have Overall / RunScripts permission.

To overcome this limitation, it is recommended to use the Groovy sandbox (there’s a checkbox in the template UI to use the sandbox). The Groovy sandbox is a special system allowing untrusted Groovy code to run on Jenkins. The accessible Jenkins API in the script are limited, but are usually more than enough.

If you need a non accessible API, you can open a support ticket us and we will allow it in the sandbox after review.

You can find here a documentation explaining the rational behind sandboxing.

Have more questions? Submit a request

4 Comments

  • 0
    Avatar
    David Caudill

    So effectively, ONLY things that can run in the groovy sandbox are allowed on Dev@Cloud Jenkins, correct?

  • 0
    Avatar
    Arnaud Heritier

    Hi David,

    Sorry we missed your comment.
    Yes only scripts running in the sandbox are allowed if you want to be independent.
    If you need to write some code that doesn't run in the sandbox you'll have to open a ticket to ask to dev@cloud administrators to review and validate the script.

    I hope it helps

  • 0
    Avatar
    Kavya Pandian

    Can you please help me to create whitelist with some predefined code to avoid this approval process

  • 0
    Avatar
    Arnaud Heritier

    What is your usecase Kavya ?

    This is to configure the whitelist on several masters ?

Please sign in to leave a comment.