Why User Management?
Security in Jenkins is all about authentication and authorization. By default, Jenkins requires a username/password, and every new user gets full access. Jenkins stores user details in the local file system by default (real projects typically use LDAP or Active Directory instead).
Authorization Strategies
- Role-based strategy — assign global roles like Developer, Tester, DevOps.
- Project-based Matrix Authorization strategy — give job-level permissions to specific users.
- Matrix-based security — an advanced, more granular concept.
A. Role-Based Strategy
Typical roles: Developer (read-only, can view builds), Tester (read, cancel, testing permissions), DevOps (full permissions).
- Add a user: Manage Jenkins → Users → Create User.
- Install the plugin: Manage Plugins → search "Role-based Authorization Strategy" → Install.
- Configure it: Manage Jenkins → Security → Authentication → select Role-Based Strategy → Save. This unlocks a new "Manage and Assign Roles" section.
- Add roles: Manage and Assign Roles → Manage Roles → add roles like Dev, Tester, DevOps and tick the relevant permission checkboxes → Save.
- Assign roles: Manage and Assign Roles → Assign Roles → Add User → give the username and tick the matching role → Save.
- Login: Log out and log back in as that user to see the restricted dashboard reflecting their role.
B. Project-Based Matrix Authorization Strategy
This gives job-level permissions — a specific user can access only specific jobs.
- Install the Role-based Authorization plugin (if not already installed).
- Manage Jenkins → Add user → Save.
- Manage Jenkins → Security → Authorization → select Project-based Matrix Authorization Strategy → add the user → give minimal read/view permissions → Save.
- Open the specific job → Configure → check "Enable project-based security" → add the user → grant the needed permissions → Save.
- Log out and log in as that user — they will now see only that specific job in the dashboard, nothing else.