The Ops Community

Cover image for Manage Jenkins Users Authentication and Authorization
Nurul Ramadhona
Nurul Ramadhona

Posted on • Updated on

Manage Jenkins Users Authentication and Authorization

Alright! We've done so many things with Jenkins by using admin credential which it means we can do everything without any restrictions. But what if let's say we want to create open-source project that should be viewable by everyone. We can create user as authentication and manage roles as authorization. Well, this step can be done at begin actually but it's OK to discuss about it now.

By default or I can say from the begin, the first user we created right after Jenkins installation has admin credential. What we have to do now is create new user with restricted access and guest user for anonymous user.

1. Create New User
Go to Manage Jenkins => Manage Users.

Jenkins User 1

Jenkins User 2

Jenkins User 3

Now, I'll login using the new user.

Jenkins User 4

2. Enable Anonymous User
Go to Manage Jenkins => Configure Global Security.

Jenkins User 5

On the Authorization section, checklist the Allow anonymous read access.

Jenkins User 6

Then, I try to logout and here what anonymous user can see. On the left hand side, there are list of menus. You can see the different with when we login as user. Anonymous users should be only able to view, not execute right?

Jenkins User 7

3. Role-Based Authorization
In the section above, we only have two options to manage users. New user created always be admin and another one when we're not logged in is anonymous. But what if we want to customize the permission to access for each user. Maybe a user only needs to build job, global access is not needed. So, we can use plugin available on Jenkins and we need to install it first.

Jenkins User 8

After that, back to Global Security menu. Now we can see Role-Based Strategy option on the Authorization section.

Jenkins User 9

We also see new menu appear with the name Manage and Assign Roles.

Jenkins User 10

Here we'll add some roles with its own permission for each. You can customize based on what you want.

Jenkins User 11

Then, let's assign role to each user. You can add if it's not already displayed by typing the user's name manually.

Jenkins User 12

Jenkins User 13

Jenkins User 14

It's a wrap! We already reached to the end of this series. But it's possible for me to add more parts to this series when I learn something new about Jenkins or maybe I'll create new series. So, stay tuned for more updates!

Anyway, what I learned about Jenkins so far is from here.

Alright, that's it for now! Any feedback are very welcome and thank you for coming. Follow me to get notified when new post is published by me! Thank you.

Discussion (2)

Collapse
patrick_londa profile image
Patrick Londa

Wow, @nurulramadhona, this series is so awesome. Definitely gonna be super helpful for others learning about Jenkins! Thank you for writing it :)

Collapse
nurulramadhona profile image
Nurul Ramadhona Author

I'll be so glad if it's helpful for others.