Re: Pipeline Multibranch and Security questions

2017-01-12 Thread Daniel Beck

> On 12.01.2017, at 15:03, Kristian  wrote:
> 
> Sorry, this was the false link. This is the correct one:
> https://groups.google.com/forum/#!topic/jenkinsci-users/1mtr7Av4zJI

IIRC archiving artifacts follows symlinks, so you can just create symbolic 
links inside the workspace to the actual artifacts and archive those.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/B246CA03-0690-41C0-BFF4-C251541AEF78%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline Multibranch and Security questions

2017-01-12 Thread Daniel Beck

> On 12.01.2017, at 17:01, 'Björn Pedersen' via Jenkins Users 
>  wrote:
> 
> manager.hudson

Specific to unsandboxed Groovy Postbuild, doesn't work in Pipeline.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/05FB1C10-C10A-4F09-8FCD-60B62F1556D9%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline Multibranch and Security questions

2017-01-12 Thread 'Björn Pedersen' via Jenkins Users
try:
 
   echo manager.hudson.getNode(NODE_NAME).getRootPath().toString()
 
to get the current nodes rootPath (or pass a suitable nodename).

Björn

Am Donnerstag, 12. Januar 2017 15:03:12 UTC+1 schrieb Kristian X:
>
> Sorry, this was the false link. This is the correct one: 
> https://groups.google.com/forum/#!topic/jenkinsci-users/1mtr7Av4zJI 
>
> 2017-01-12 15:00 GMT+01:00 Kristian : 
>
> > The function comes originally from this question: 
> > https://groups.google.com/forum/#!topic/jenkinsci-users/L9yP2df9Fz4 
> > 
> > 
> > 2017-01-12 14:50 GMT+01:00 Daniel Beck : 
>
> >> What are you trying to accomplish? Pipeline is not intended to perform 
> system management tasks. 
> >> 
> >>> On 12.01.2017, at 14:30, Kristian  
> wrote: 
> >>> 
> >>> 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 
> >>> project. Suddenly I got an error message like this: 
> >>> 
>  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 this 
> >>> at "Manage Jenkins -> In-process Script Approval". I had to do this 
> >>> several times, so now I have this white list: 
> >>> 
>  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 Security 
> >>> 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-use...@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-use...@googlegroups.com . 
> >> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/5CB3C56B-46AC-4C86-9A17-81C5BBEBEA8F%40beckweb.net.
>  
>
> >> 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/4abb3a74-18a4-493a-b605-e4914de198b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline Multibranch and Security questions

2017-01-12 Thread Kristian
Sorry, this was the false link. This is the correct one:
https://groups.google.com/forum/#!topic/jenkinsci-users/1mtr7Av4zJI

2017-01-12 15:00 GMT+01:00 Kristian :
> The function comes originally from this question:
> https://groups.google.com/forum/#!topic/jenkinsci-users/L9yP2df9Fz4
>
>
> 2017-01-12 14:50 GMT+01:00 Daniel Beck :
>> What are you trying to accomplish? Pipeline is not intended to perform 
>> system management tasks.
>>
>>> On 12.01.2017, at 14:30, Kristian  wrote:
>>>
>>> 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
>>> project. Suddenly I got an error message like this:
>>>
 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 this
>>> at "Manage Jenkins -> In-process Script Approval". I had to do this
>>> several times, so now I have this white list:
>>>
 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 Security
>>> 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+unsubscr...@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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/5CB3C56B-46AC-4C86-9A17-81C5BBEBEA8F%40beckweb.net.
>> 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAO5HUhPKHHffXyXJPcqHeOarsTTR%2BwVn1rhgWDSb5bPTx%3DdYZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline Multibranch and Security questions

2017-01-12 Thread Kristian
The function comes originally from this question:
https://groups.google.com/forum/#!topic/jenkinsci-users/L9yP2df9Fz4


2017-01-12 14:50 GMT+01:00 Daniel Beck :
> What are you trying to accomplish? Pipeline is not intended to perform system 
> management tasks.
>
>> On 12.01.2017, at 14:30, Kristian  wrote:
>>
>> 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
>> project. Suddenly I got an error message like this:
>>
>>> 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 this
>> at "Manage Jenkins -> In-process Script Approval". I had to do this
>> several times, so now I have this white list:
>>
>>> 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 Security
>> 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+unsubscr...@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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/5CB3C56B-46AC-4C86-9A17-81C5BBEBEA8F%40beckweb.net.
> 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAO5HUhMrD8-Gz5GOTSt9OysV3jrtGjN1846%2B%2BD1YjEEbha%2BUpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline Multibranch and Security questions

2017-01-12 Thread Daniel Beck
What are you trying to accomplish? Pipeline is not intended to perform system 
management tasks.

> On 12.01.2017, at 14:30, Kristian  wrote:
> 
> 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
> project. Suddenly I got an error message like this:
> 
>> 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 this
> at "Manage Jenkins -> In-process Script Approval". I had to do this
> several times, so now I have this white list:
> 
>> 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 Security
> 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+unsubscr...@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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5CB3C56B-46AC-4C86-9A17-81C5BBEBEA8F%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Pipeline Multibranch and Security questions

2017-01-12 Thread Kristian
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
project. Suddenly I got an error message like this:

> 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 this
at "Manage Jenkins -> In-process Script Approval". I had to do this
several times, so now I have this white list:

> 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 Security
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+unsubscr...@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.