[JIRA] (JENKINS-61785) REST API requires Job/Build permission

13 views
Skip to first unread message

juanpablo.santos@gmail.com (JIRA)

unread,
Apr 3, 2020, 6:29:02 AM4/3/20
to jenkinsc...@googlegroups.com
Juan Pablo Santos Rodríguez updated an issue
 
Jenkins / Bug JENKINS-61785
REST API requires Job/Build permission
Change By: Juan Pablo Santos Rodríguez
Summary: REST API requires Task Job /Build permission
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

alexhraber@gmail.com (JIRA)

unread,
Apr 6, 2020, 3:28:03 PM4/6/20
to jenkinsc...@googlegroups.com
Alex Raber commented on Bug JENKINS-61785
 
Re: REST API requires Job/Build permission

I have the same issue, 403's from github webhooks to jenkins api, which were previously succeeding (on 2.204.5). Failing on 2.222.1.

https://issues.jenkins-ci.org/browse/JENKINS-59105

alexhraber@gmail.com (JIRA)

unread,
Apr 6, 2020, 3:29:03 PM4/6/20
to jenkinsc...@googlegroups.com
Alex Raber edited a comment on Bug JENKINS-61785
I have the same issue, 403's from github webhooks to jenkins api, which were previously succeeding (on 2.204.5). Failing on 2.222.1.

I posted on JENKINS-59105 too just in case it's caused by that.

https://issues.jenkins-ci.org/browse/JENKINS-59105

alexhraber@gmail.com (JIRA)

unread,
Apr 6, 2020, 3:29:04 PM4/6/20
to jenkinsc...@googlegroups.com

juanpablo.santos@gmail.com (JIRA)

unread,
Apr 7, 2020, 7:24:03 AM4/7/20
to jenkinsc...@googlegroups.com

Hi,

we were able to locate what's happening, seems that efectively there's a bug introduced in latests LTS / role-strategy-plugin versions:

  • The user id we were using on our API calls was "INETIC" (uppercased, as it is how it is set up on the active directory); this could be seen while debugging curl's request headers: "* Server auth using Basic with user 'INETIC'".
  • Response headers told something a bit different, though: "< X-You-Are-Authenticated-As: inetic" (note user id is lowercased here).
  • The "Manage Roles" screen assigns roles to INETIC no matter how you introduce the ID. Most probably, the user id is being fetched from the AD, which makes sense.
  • From within the API call, being authenticated as inetic, there are no roles assigned to it, as they are assigned to INETIC. Seems that this lowercasing wasn't happening before.
  • We've changed the API user (with its associated token) to another with a lowercased user id and our problems are gone.

This wasn't happening on our previous Jenkins instance (2.204.2 LTS with role-strategy-plugin 2.14, IIRC). The issue seems to happen with newer Jenkins LTS instances + role-strategy plugin 2.15 and 2.16, don't know specifically where the bug / regression is lying..

alexhraber@gmail.com (JIRA)

unread,
Apr 7, 2020, 3:17:04 PM4/7/20
to jenkinsc...@googlegroups.com

Thanks Juan Pablo Santos Rodríguez for the info.

I also updated JENKINS-59105 with how I'm reproducing and what I've done to try to fix locally:
https://issues.jenkins-ci.org/browse/JENKINS-59105?focusedCommentId=388706&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-388706

I suppose I could just create a new ticket, but it sounds like the issue is a split between these 2 tickets.

Reply all
Reply to author
Forward
0 new messages