Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Allow anonymous access to only one specific Jenkins view or job

I am using Role Based Security in Jenkins.

All my jobs are private, require login for every permission, which is good. However, I'm adding a couple of jobs that I would like to expose to the public. I would like anyone to be able to discover and read one specific Jenkins "view" or "job".

So far, I'm unable to get this to work with Role Based Security, as it seems it doesn't have a concept of Anonymous access.

Is what I am trying to achieve possible with Role Based Security? If not, is there an alternative that I can explore that still allows me to keep certain jobs completely private (including read and discovery access), but others public?

like image 889
rdgd Avatar asked May 05 '17 23:05

rdgd


People also ask

How do I restrict access to a folder in Jenkins?

Navigate to Groups->New Group from the root Jenkins dashboard. Name the group admin-group-int and click OK to create a group internal to Jenkins for role assignment. Check the Granted checkbox for the admin role, leave Propagates checked, and click Save . Assign admin-group-ext as a member of this internal group.

How do I stop anonymous login in Jenkins?

To remove anonymous read access Right now go to your Jenkins dashboard. Click on Manage Jenkins → Configure Global Security → Remove check Allow anonymous read access.


1 Answers

I figured it out, but it wasn't intuitive, so I will leave the question up and list the steps to take here:

  1. Navigate to the "Manage and Assign Roles" view
  2. Add a new global role, "Public" for example
  3. Add only the "Overall" "Read" permission, nothing else
  4. Add a new Project Role with a relevant name and pattern that matches the job you want to filter for
  5. Add the "Job" "Read" permission to the new Project Role
  6. Navigate to the "Assign Roles" view
  7. Add user/group "Anonymous" to global roles
  8. Add Anonymous to the project role you created
like image 70
rdgd Avatar answered Sep 21 '22 18:09

rdgd