[JIRA] (JENKINS-61344) Api call with a token lead to a 403 but the user has "overall read" via "authenticated user" group

10 views
Skip to first unread message

gregoire.waymel@decathlon.com (JIRA)

unread,
Mar 5, 2020, 6:44:02 AM3/5/20
to jenkinsc...@googlegroups.com
greg oire created an issue
 
Jenkins / Bug JENKINS-61344
Api call with a token lead to a 403 but the user has "overall read" via "authenticated user" group
Issue Type: Bug Bug
Assignee: Daniel Beck
Components: matrix-auth-plugin
Created: 2020-03-05 11:43
Environment: Jenkins 2.204.2 JDK Oracle 8 (202)
Labels: jenkins api matrix-auth
Priority: Minor Minor
Reporter: greg oire

I use "Project-based Matrix Authorization Strategy ".

I set the group "Authenticated Users" with permission overall read, job read, credential view, view read.

If a user try to call an api with a token like: `curl -u myuser:123456 -v -H 'Accept: application/json' https://jenkins/api/json` then the response is 403 with a HTML body in which I have "myuser is missing the Overall/Read permission"

If I add a "overall read" permission on the "myuser" itself, then the api is working (200 + data)

Does this mean that authenticating via a token do not add the 'authenticated' group ? Is this wanted? if so why not a "tokens" group ?

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

dbeck@cloudbees.com (JIRA)

unread,
Mar 5, 2020, 7:02:03 AM3/5/20
to jenkinsc...@googlegroups.com
Daniel Beck closed an issue as Not A Defect
 

Overall/Read grants basic access to Jenkins. Nothing more. Users without that basically cannot do anything, except in very limited circumstances.

Users have a group or don't, the method of authentication doesn't change what they're authorized to do.

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

gregoire.waymel@decathlon.com (JIRA)

unread,
Mar 5, 2020, 7:39:03 AM3/5/20
to jenkinsc...@googlegroups.com
greg oire commented on Bug JENKINS-61344
 
Re: Api call with a token lead to a 403 but the user has "overall read" via "authenticated user" group

From your answer, Jenkins do have a bug. If I set Overall/Read to "authenticated" user, then I expect even with a token, such policy is executed hence a user without other permission would be able to call jenkins api. It is not the case.

dbeck@cloudbees.com (JIRA)

unread,
Mar 5, 2020, 7:45:02 AM3/5/20
to jenkinsc...@googlegroups.com

greg oire Adding the authenticated pseudo-group is the responsibility of the plugin providing authentication (i.e. security realm). So there seems to be a bug here, I agree, but not in matrix-auth.

gregoire.waymel@decathlon.com (JIRA)

unread,
Mar 5, 2020, 7:49:02 AM3/5/20
to jenkinsc...@googlegroups.com

Is there a generic specific handler for token somewhere or each authentication handler duplicate the token authentication management ?

gregoire.waymel@decathlon.com (JIRA)

unread,
Mar 5, 2020, 8:03:02 AM3/5/20
to jenkinsc...@googlegroups.com

OK, I found the code, but will need to debug as at first sight it seems correct...

Thank you.

Reply all
Reply to author
Forward
0 new messages