org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException:
Scripts not permitted to use method groovy.lang.GroovyObject
getProperty
java.lang.String (com.cccis.telematics.build.Templates.run_jgitflow_template)
at org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.StaticWhitelist.rejectMethod
(StaticWhitelist.java:180)
Asked
Active
Viewed 1.2k times
5

Community
- 1
- 1

Jeff Maass
- 3,632
- 3
- 26
- 30
1 Answers
7
What happened here is that the property didn't exist as named on the object in question, so Groovy began introspecting the object looking for it. I suppose that allowing introspection could lead to security vulnerabilities.
reproduce:
class Foo
{
String fooProperty
}
def someMethod()
{
Foo f = new Foo()
f.fooProperty.replace("x", "y")
}

Neuron
- 5,141
- 5
- 38
- 59

Jeff Maass
- 3,632
- 3
- 26
- 30
-
Not sure why this was downvoted, it seems to be absolutely correct. I had the exact same problem but with `setProperty`, from trying to set a property that I hadn't declared. Once declared, the error went away. – ken Jul 14 '20 at 19:02