Issue
-
A user with System.READ is able to see all Jenkins agents even though they cannot see any jobs.
-
I would like to prevent users from seeing the details of agents connected to Jenkins unless I explicitly grant them such a permission.
Resolution
To restrict viewing of agents, two features of Jenkins are required:
-
Custom view with
Filter build queue
andFilter build executors
enabled -
Restrict jobs to agent
-
Create a new
list view
by clicking the+
icon next to the currentAll
view on the main Jenkins homepage.
-
-
Enable the options
Filter build queue
andFilter build executors
. These options will allow the build queue and build executors to show only those that are related to the jobs selected.Select the jobs that are to be shown by this view. Note, if this view is to replace the current
All
view, select all jobs or use an appropriate regular expressions to select all jobs. You may further restrict users based onrole permissions
oruser permissions
.
-
Configure jobs to be restricted on particular agents to have the view filter on only these agents.
-
Comparing this with the original
All
view above, you will see only one executor present.
-
Lastly, to remove the previous default
All
view, go toJenkins
>Manage Jenkins
>Configure System
>Default View
and select your new filtered view. This option is only available when there are more than onelist view
available. Once you have selected the new default view, you may go back to the oldAll
view andDelete view
.