Jenkins - restrict which nodes can be selected by user when creating jobs I have a situation where I have a Jenkins installation that is used by multiple teams. Each team gets their own Jenkins node, which has access to certain parts of the organization that the team is responsible of.
I want to allow the teams to create their own Jenkins jobs, but they should only be allowed to set those jobs to run on their respective Jenkins node. So I need a way to allow users to create jobs, but restrict the nodes they can choose.
The only thing we found is Job Restrictions plugin, which is no longer maintained at this time and up to adoption. And we had some trouble with it.
What are my options?
You could use Project-based Matrix Authorization Strategy for user authorisation in Jenkins.
Works well with Folders plugin, then you have each project in a separate folder and permissions on each folder are set to a team that looks after the project.
Each node/slave can have access permissions specified. For example, for node A you will only list Team A as users/team who can have Build and Configure permissions. Team B for node B etc. It is a pain if you have dozens of nodes though.
If integrated with AD, then groups as they are defined in AD can be used to restrict/give access without having to list all members of the team who needs access to which node/project.
Authorisation strategy is defined in
&quot;Manage Jenkins&quot; -&gt; “Configure Global Security Option&quot; -&gt; &quot;Authorisation&quot; -&gt; &quot;Project-based Matrix Authorization Strategy&quot;
This article describes it to a degree: https://www.thegeekstuff.com/2016/06/jenkins-security/
You could do the same with just Matrix Authorization Strategy, only you won't have projects. You might not need them at all (depends on how many project/teams you have) and then you will only restrict node permissions.