[JIRA] (JENKINS-60508) Nodes Patterns

10 views
Skip to first unread message

nahuel.cassinari@jamf.com (JIRA)

unread,
Dec 16, 2019, 10:53:02 AM12/16/19
to jenkinsc...@googlegroups.com
Nahuel Cassinari created an issue
 
Jenkins / Bug JENKINS-60508
Nodes Patterns
Issue Type: Bug Bug
Assignee: Oleg Nenashev
Attachments: Screenshot 2019-12-16 at 16.41.23.png, Screenshot 2019-12-16 at 16.41.43.png, Screenshot 2019-12-16 at 16.42.06.png, Screenshot 2019-12-16 at 16.42.13.png
Components: authorize-project-plugin, role-strategy-plugin
Created: 2019-12-16 15:52
Labels: plugin jenkins
Priority: Minor Minor
Reporter: Nahuel Cassinari

Hello,

Im trying to restrict the nodes in jenkins but doesn't matters what i do, always shows me that the user has lack of permission.

Jenkins v2.190.3

Role-based Authorization Strategy v2.15

Authorize Project v1.3.0

 

So for this example is:

Acces Control:

  • Role-Based Strategy 

Access Control for Builds:

  • Project default Build Authorization
       - Strategy Run as anonymous

(the idea is make it work with Run as the user who triggered the build)

 

Later, I have this configuration:

  • A global role called general which just have view
  • A Slave role which the pattern is "gradle-.* (I tested with gradle*, gradle.* and even with .*)
  • Both roles assigned to anonymous

 

So when i run a pipeline with a dynamic agent in kubernetes shows me:

Started by user XXXXXX
Running as anonymous

which is ok, after this, the agent is created, connected to jenkins but the job is waiting forever for the agent and if the agent is already connected shows:

‘anonymous’ lacks permission to run on ‘gradle-xxxxxx’

 

The only way to fix this is run as SYSTEM or add build privileges to "general" global role.

 

From jenkins logs, nothing relevant is showed up.

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

nahuel.cassinari@jamf.com (JIRA)

unread,
Dec 18, 2019, 4:10:21 AM12/18/19
to jenkinsc...@googlegroups.com
Nahuel Cassinari commented on Bug JENKINS-60508
 
Re: Nodes Patterns

One important thing.

The agent is created in kubernetes using the plugin. But i guess that in the end has not influence because jenkins see the pod in kubernetes as a physical node which is an agent.

faucher.benp@gmail.com (JIRA)

unread,
Apr 27, 2020, 8:38:05 PM4/27/20
to jenkinsc...@googlegroups.com
Ben Faucher updated an issue
Change By: Ben Faucher
Priority: Minor Major
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

faucher.benp@gmail.com (JIRA)

unread,
Apr 27, 2020, 8:49:03 PM4/27/20
to jenkinsc...@googlegroups.com
Ben Faucher commented on Bug JENKINS-60508
 
Re: Nodes Patterns

I am also seeing this exact issue with a non-kubernetes deployment. Jenkins master is running out of a docker container on an Ubuntu host, agent is an Ubuntu VM permanently connected over SSH.

Jenkins v2.222.1 (alpine docker image)
Role-strategy v2.16
Authorize-project v1.3.0

  1. Agent is named "foo"
  2. Create a user with global read-only access called "builder"
  3. In Security > Manage and Assign Roles > Mange roles, create a node role
    • Name: "foo-access"
    • Pattern: "foo"
  4. In Security > Manage and Assign Roles > Assign Roles, assign the role to "builder"
  5. Create a new pipeline job set to use agent "foo"
  6. Configure pipeline to run as user "builder"
  7. Run pipeline. Build stalls indefinitely with this error:
    19:34:07  Started by user Ben Faucher
    19:34:07  Running as builder
    19:34:07  Running in Durability level: PERFORMANCE_OPTIMIZED
    19:34:09  [Pipeline] Start of Pipeline
    19:34:22  [Pipeline] node
    19:34:37  Still waiting to schedule task
    19:34:37  ‘builder’ lacks permission to run on ‘foo’; ‘build-1’ doesn’t have label ‘foo’
    
Reply all
Reply to author
Forward
0 new messages