Interview Prep/Jenkins/Credentials & security

How do you restrict which jobs can run on which agents?

AdvancedConceptCredentials & security
Answer

Labels plus EXCLUSIVE node mode prevent accidental placement, but a pipeline author can always request any label. To enforce it, use the Job Restrictions plugin or Authorize Project plugin with agent permissions (Agent/Build), so that only jobs in /payments/prod-deploy can run on the agent holding prod network access. With Kubernetes, enforce at the cluster level: deploy templates use service accounts that only exist in a restricted namespace.

All Jenkins questions Roadmap: Jenkins

More on Credentials & security