Interview Prep/Jenkins/Credentials, permissions & script approval

`org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods execute java.lang.String`

IntermediateTroubleshootingCredentials, permissions & script approval
Answer

Likely causes → Pipeline code uses "ls".execute() to run a process; in pipelines this runs on the controller, not the agent.

Diagnose → Search for .execute().

Fix → Replace with sh(script: 'ls', returnStdout: true). Never approve this signature: it allows arbitrary commands on the controller.

Prevent → Educate pipeline authors that Groovy runs on the controller; review approvals list.

All Jenkins questions Roadmap: Jenkins

More on Credentials, permissions & script approval