Kristian
2017-01-12 13:30:49 UTC
Hi all,
I am new to Pipeline and Multibranch. I just wrote a small test
pipeline script for a project of me and started it in a Multibranch
at "Manage Jenkins -> In-process Script Approval". I had to do this
Plugin, because this function "may have introduced a security
vulnerability". I am using the getInstance() function in this
function:
// **********
@NonCPS
def nodeRootDir(nodeName) {
for (node in Jenkins.instance.nodes) {
println node.name
if (!nodeName.equals('master') &&
node.name.compareTo(nodeName) == 0 ) {
return node.getRootPath()
break
}
}
}
// **********
The function retrieves the root path of a slave. The question is: Is
there another way to get the root path of a slave in a non-problematic
way?
I am new to Pipeline and Multibranch. I just wrote a small test
pipeline script for a project of me and started it in a Multibranch
org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod jenkins.model.Jenkins getInstance
After a quick look at Google, I found out, that I can whitelist thisat "Manage Jenkins -> In-process Script Approval". I had to do this
field hudson.model.Slave name
method hudson.model.AbstractCIBase getNodes
method hudson.model.Node getRootPath
staticMethod jenkins.model.Jenkins getInstance
The last function is a problem due to Jenkins / Script Securitymethod hudson.model.AbstractCIBase getNodes
method hudson.model.Node getRootPath
staticMethod jenkins.model.Jenkins getInstance
Plugin, because this function "may have introduced a security
vulnerability". I am using the getInstance() function in this
function:
// **********
@NonCPS
def nodeRootDir(nodeName) {
for (node in Jenkins.instance.nodes) {
println node.name
if (!nodeName.equals('master') &&
node.name.compareTo(nodeName) == 0 ) {
return node.getRootPath()
break
}
}
}
// **********
The function retrieves the root path of a slave. The question is: Is
there another way to get the root path of a slave in a non-problematic
way?
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO5HUhPS0Tj65VwwWkTQfA0hRSEXLuYDODf0PesPUXXLiJw%3DAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO5HUhPS0Tj65VwwWkTQfA0hRSEXLuYDODf0PesPUXXLiJw%3DAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.