Search code examples
jenkinscontinuous-integrationjenkins-plugins

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?


Solution

  • 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