Skip to content

[JENKINS-46652] Authorize Project blocks Pipeline Jobs when Computer/Build for master is lacking #22284

Closed

Description

@jenkins-infra-bot

Users may configure Authorize Build plugin with the intention to limit who can run builds on the master in a setup where just going to zero static executors is impractical (e.g. to run a periodic backup or other housekeeping).

In that case, Pipelines cannot even start if started by users lacking Computer/Build on master, as the flyweight task cannot run there (and it seems to be tied to master).

(Reproduction using role-strategy only, as matrix-auth is currently lacking per-agent configuration)

CC jglick


Originally reported by danielbeck, imported from: Authorize Project blocks Pipeline Jobs when Computer/Build for master is lacking
  • assignee: jglick
  • status: Resolved
  • priority: Major
  • component(s): authorize-project-plugin, core, workflow-job-plugin
  • label(s): permissions
  • resolution: Fixed
  • resolved: 2018-03-09T20:17:23+00:00
  • votes: 1
  • watchers: 5
  • imported: 2025-11-24
Raw content of original issue

Users may configure Authorize Build plugin with the intention to limit who can run builds on the master in a setup where just going to zero static executors is impractical (e.g. to run a periodic backup or other housekeeping).

In that case, Pipelines cannot even start if started by users lacking Computer/Build on master, as the flyweight task cannot run there (and it seems to be tied to master).

(Reproduction using role-strategy only, as matrix-auth is currently lacking per-agent configuration)

CC jglick

Activity

  1. jenkins-infra-bot commented on Sep 5, 2017

    @jenkins-infra-bot
    Author
  2. jenkins-infra-bot commented on Sep 8, 2017

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Original comment link
    • Raw content of original comment:

      It's a kind of "as designed" behavior. I workaround it by a combination of Permissive Computer.Build on any node to any user and restricting by Job Restrictions plugin: https://github.com/oleg-nenashev/demo-jenkins-config-as-code/blob/master/init_scripts/src/main/groovy/MasterComputer.groovy#L20-L42  . But it's a too complex setup, which requires manual whitelisting of classes.

      It would be great a marker interface like "OnMasterFlyweightTask" which would allow tasks even when there is no Computer.Build permission for the current authentication. But such interface requires bumping of Jenkins core. Maybe a default "boolean isOnMaster()" in FlyWeight task solves it in a more compatible way

    It's a kind of "as designed" behavior. I workaround it by a combination of Permissive Computer.Build on any node to any user and restricting by Job Restrictions plugin: https://github.com/oleg-nenashev/demo-jenkins-config-as-code/blob/master/init_scripts/src/main/groovy/MasterComputer.groovy#L20-L42  . But it's a too complex setup, which requires manual whitelisting of classes.

    It would be great a marker interface like "OnMasterFlyweightTask" which would allow tasks even when there is no Computer.Build permission for the current authentication. But such interface requires bumping of Jenkins core. Maybe a default "boolean isOnMaster()" in FlyWeight task solves it in a more compatible way

  3. jenkins-infra-bot commented on Sep 12, 2017

    @jenkins-infra-bot
    Author
    jglick:
    • Original comment link
    • Raw content of original comment:

      It is not as designed. BUILD should not be checked on flyweight tasks IMO, which is why the Node patch I proposed in JENKINS-24513 would fix this bug. I see no need for API changes.

    It is not as designed. BUILD should not be checked on flyweight tasks IMO, which is why the Node patch I proposed in JENKINS-24513 would fix this bug. I see no need for API changes.

  4. jenkins-infra-bot commented on Mar 9, 2018

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Jesse Glick
    Path:
    core/src/main/java/hudson/model/Node.java
    core/src/main/java/hudson/model/queue/MappingWorksheet.java
    http://jenkins-ci.org/commit/jenkins/9842a2795e81bbdb0aeb5039cd9953bbb0ff2531
    Log:
    JENKINS-46652 Check Computer.BUILD permission only on heayweight tasks.

  5. jenkins-infra-bot commented on Mar 9, 2018

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Jesse Glick
    Path:
    core/src/main/java/hudson/model/Node.java
    core/src/main/java/hudson/model/queue/MappingWorksheet.java
    http://jenkins-ci.org/commit/jenkins/1f4f76ffcae89938aa9b95c23c025da3706d7150
    Log:
    Merge pull request #3254 from jglick/heavyweight-JENKINS-46652

    JENKINS-46652 Check Computer.BUILD permission only on heayweight tasks

    Compare: c84cbf3...1f4f76f

  6. jenkins-infra-bot commented on Mar 11, 2018

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Original comment link
    • Raw content of original comment:

      The patch has been integrated towards 2.111

    The patch has been integrated towards 2.111

  7. jenkins-infra-bot commented on Nov 24, 2025

    @jenkins-infra-bot
    Author

    [Original relates_to from Jira: JENKINS-24513]

  8. removed
    bugFor changelog: Minor bug. Will be listed after features
    on Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions