[JIRA] (JENKINS-60300) Inheritance issues with Project-based matrix strategy

15 views
Skip to first unread message

michelzanini@gmail.com (JIRA)

unread,
Nov 27, 2019, 7:43:02 AM11/27/19
to jenkinsc...@googlegroups.com
Michel Zanini created an issue
 
Jenkins / Bug JENKINS-60300
Inheritance issues with Project-based matrix strategy
Issue Type: Bug Bug
Assignee: Daniel Beck
Attachments: Screen Shot 2019-11-27 at 09.23.09.png, Screen Shot 2019-11-27 at 09.23.25.png, Screen Shot 2019-11-27 at 09.23.52.png, Screen Shot 2019-11-27 at 09.24.14.png, Screen Shot 2019-11-27 at 09.37.33.png, Screen Shot 2019-11-27 at 09.38.41.png, Screen Shot 2019-11-27 at 09.39.24.png
Components: matrix-auth-plugin
Created: 2019-11-27 12:42
Environment: Jenkins 2.206
Matrix Authorization Strategy Plugin 2.5
Priority: Minor Minor
Reporter: Michel Zanini

Hi,

I am testing the usage of Project-based matrix using permissions inheritance.
The result of the testing is not matching the expected behaviour, I am unaware if it's a bug or something I am missing.

This are the steps I did and what happened vs what I expected:

1. On Manage Jenkins -> Configure Global Security I setup Project-based Matrix Authorization Strategy and Access Control for Builds with the Authorise Project plugin as following:

See Screen Shot 2019-11-27 at 09.23.09.png (users michel and zanini have only read permissions).
See Screen Shot 2019-11-27 at 09.23.25.png (I have configured to run all builds with the user michel).

2. I created a test project on root of Jenkins. When I run it, I get a build blocked as there is no permissions for user michel, and that works as expected. See Screen Shot 2019-11-27 at 09.23.52.png.

3. Now I open the test project and enable project based security for it. Then I change to use the inheritance strategy to not import global permissions and select that the user michel has ALL permissions for this job. See Screen Shot 2019-11-27 at 09.24.14.png.

When I run the job, I would expect michel to be able to run it, as I specified that this user can do everything with the job locally at the job level. But what happens is the same as before, user can't build the job.


 

4. I then make changes to ** global permissions to add build permission for both users, like in Screen Shot 2019-11-27 at 09.37.33.png. Now the job can build like in Screen Shot 2019-11-27 at 09.38.41.png.

 

5. I then configure for this job to run as zanini user like in Screen Shot 2019-11-27 at 09.39.24.png. 

Now I would expect the job not to run and be blocked, because I configured the job to block global inheritance, and locally is only configured for michel. But the job runs with the user fully.


 

It seems that only global permissions are being looked at and local job permissions are not.

Is this correct? What I am missing here?

 

Thanks.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

michelzanini@gmail.com (JIRA)

unread,
Nov 27, 2019, 7:46:02 AM11/27/19
to jenkinsc...@googlegroups.com
Michel Zanini updated an issue
Change By: Michel Zanini
Hi,

I am testing the usage of Project-based matrix using permissions inheritance.
The result of the testing is not matching the expected behaviour, I am unaware if it's a bug or something I am missing.

This are the steps I did and what happened vs what I expected:

1. On Manage Jenkins -> Configure Global Security I setup Project-based Matrix Authorization Strategy and Access Control for Builds with the Authorise Project plugin as following:

See _Screen Shot 2019-11-27 at 09.23.09.png_ (users _michel_ and _zanini_ have only read permissions).
See _Screen Shot 2019-11-27 at 09.23.25.png_ (I have configured to run all builds with the user _michel_).

2. I created a test project on root of Jenkins. When I run it, I get a build blocked as there is no permissions for user _michel_, and that works as expected. See _Screen Shot 2019-11-27 at 09.23.52.png_.

3. Now I open the test project and enable project based security for it. Then I change to use the inheritance strategy to not import global permissions and select that the user _michel_ has ALL permissions for this job. See _Screen Shot 2019-11-27 at 09.24.14.png_.

*When I run the job, I would expect _michel_ to be able to run it, as I specified that this user can do everything with the job locally at the job level. But what happens is the same as before, user can't build the job.*
----
 

4. I then make changes to
 **  global permissions to add build permission for both users, like in _Screen Shot 2019-11-27 at 09.37.33.png_. Now the job can build like in _Screen Shot 2019-11-27 at 09.38.41.png_.

 

5. I then configure for this job to run as _zanini_ user like in _Screen Shot 2019-11-27 at 09.39.24.png._ 

*Now I would expect the job
not NOT to run and be blocked, because I configured the job to block global inheritance, and locally is only configured only for   _michel_. But the job runs with the user fully .*
----

 

It seems that only global permissions are being looked at and local job permissions are not.

Is this correct? What I am missing here?

 

Thanks.

dbeck@cloudbees.com (JIRA)

unread,
Nov 27, 2019, 9:00:05 AM11/27/19
to jenkinsc...@googlegroups.com
Daniel Beck commented on Bug JENKINS-60300
 
Re: Inheritance issues with Project-based matrix strategy

See Screen Shot 2019-11-27 at 09.23.52.png

Read the error message carefully: It doesn't stop you from building the project, just from building on the node.

Job/Build is required to trigger the build, this is done by admin here (or whoever uses the UI). While in the queue, the build takes on the identity of the configured Authorize Project user michel, and checks Agent/Build to see where it can run.

Would that explain it?

dbeck@cloudbees.com (JIRA)

unread,
Nov 27, 2019, 9:09:02 AM11/27/19
to jenkinsc...@googlegroups.com

on the node.

Specifically the master node, whose name is "Jenkins", which could be confusing.

michelzanini@gmail.com (JIRA)

unread,
Nov 27, 2019, 9:13:03 AM11/27/19
to jenkinsc...@googlegroups.com

Ok I see. So I guess the fact that Agent/Build is only available at the top Global level, I can't change it locally at job level to block it, correct ?

dbeck@cloudbees.com (JIRA)

unread,
Nov 27, 2019, 9:14:03 AM11/27/19
to jenkinsc...@googlegroups.com

It's available for individual agents too – in their configuration. This is how you prevent your evil, untrustworthy users from building on the master node

dbeck@cloudbees.com (JIRA)

unread,
Nov 27, 2019, 9:15:02 AM11/27/19
to jenkinsc...@googlegroups.com
Daniel Beck closed an issue as Not A Defect
 

The described behavior is as designed.

Change By: Daniel Beck
Status: Open Closed
Resolution: Not A Defect

michelzanini@gmail.com (JIRA)

unread,
Nov 27, 2019, 9:48:03 AM11/27/19
to jenkinsc...@googlegroups.com
Michel Zanini commented on Bug JENKINS-60300
 
Re: Inheritance issues with Project-based matrix strategy

Thanks for the replies, I will close the issue.

Just a final question:

If have a user, lets say michel and two jobs, jobA and jobB, it does not seem to be possible to authorise the user to run jobA on a node and NOT allow jobB to run on that same node for that same user?

It's either both or none, correct?

dbeck@cloudbees.com (JIRA)

unread,
Nov 27, 2019, 10:51:02 AM11/27/19
to jenkinsc...@googlegroups.com

Yes, with Authorize Project/Matrix Auth. Something like https://plugins.jenkins.io/job-restrictions probably does that though.

If you need further assistance, I recommend you ask on the Jenkins Users mailing list.

Reply all
Reply to author
Forward
0 new messages