Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multi-tenant setup for Jenkins

I want to setup multi-tenant support for our Jenkins. Let, we have 5 jobs for two users (GitHub user) in Jenkins and all the 5 jobs are in a single server.

  • user_1 has j1, j2, j3 jobs
  • user_2 has j4, j5 jobs

Now,

  • user_1 can see only j1, j2 and j3 jobs (and don't see j4 or j5)
  • user_2 can see only j4 and j5 jobs

when they come in Jenkins.

How can we setup Jenkins for multi-tenant support?

like image 625
Sajib Khan Avatar asked May 15 '15 04:05

Sajib Khan


1 Answers

For the quickest approach to accomplish what you are describing, follow these steps:

  1. Go to "Configure Global Security" and navigate to the "Authorization" tab
  2. Use "Role Based Strategy"
  3. Give desired access to users
  4. Provide desired job level access for users

You can utilize some type of naming convention for your jobs and you can use regular expression to provide access for a set of jobs.

Another option would be to check out some of the Authentication/Authorization plugins available for Jenkins. A popular plugin in this realm is the Matrix Authorization Strategy Plugin (often combined with Active Directory), though I have not personally used this.

like image 161
lax1089 Avatar answered Sep 29 '22 03:09

lax1089