I want to setup a role (based on ldap security group) that ONLY has access to folders based on a pattern.
Jenkins version: Version 2.426.3
role-strategy: 689.v731678c3e0eb_
configuration-as-code: 1775.v810dc950b_514
Let's say I have these folders set up:
Folder1/app1/deploy
Folder1/app1/build
Folder1/app2/deploy
Folder1/app2/build
...
I want all users in the app1_build_team to be able to access all jobs defined under Folder1/app1/.*
hence the pattern.
My issues:
if I don't define "build_execute" in Global the user gets access denied on main dashboard after login.
If I do add "build_execute" to global part of the config the user in that group can see all folders, all jobs but can only run what is defined in the pattern line.
We will be host a wide variety of folders/jobs for a large user base and need to have only the folders and jobs visible and accessible to specific teams.
I am populating all the permissions using CasC. I got as far as it mostly working with #2 above. User can run jobs assigned to their group but can see EVERYTHING once logged in.
I have tried so many permutations of configs below, that I do not want to paste here as it will just make this post messy.
How can I write the config for user of below group to only see folders as per the defined pattern?
I have gone into th manage roles and assign roles in the GUI configured to how I think it should be, exported the casc config but as I said either the user gets access denied to all or can see all folders/jobs based on if I use "Job/Read" is global configs.
Here is a chunk of my configuration with "Job/Read" not defined in a global scope.
authorizationStrategy:
roleBased:
permissionTemplates:
- name: "build_execute_perm_template"
permissions:
- "Job/Cancel"
- "Run/Delete"
- "Job/Build"
- "Run/Update"
- "Job/Discover"
- "Job/Read"
- "View/Read"
- "Run/Replay"
- "Folder/Read"
roles:
global:
- entries:
- group: "devops_team"
name: "admin"
pattern: ".*"
permissions:
- "Overall/Administer"
items:
- entries:
- group: "app1_build_team"
name: "build_execute"
pattern: "Folder1/app1/.*"
templateName: "build_execute_perm_template"
- entries:
- group: "app2_build_team"
name: "build_execute"
pattern: "Folder1/app2/.*"
templateName: "build_execute_perm_template"
Assuming you're using the Role Strategy plugin, here's how you can separate teams into roles with different folder access (I will be using the GUI for simplicity reasons).
Folder1(/app1.*)?
andFolder2(/app2.*)?
.Global roles
Item roles