When it comes to securing Jenkins, both the hardening of the system and protecting the code itself are crucial. One of the cornerstone methods for achieving this is by leveraging popular Jenkins plugins. For example, during the initial Jenkins setup, you can install the recommended plugins, which include the Matrix Authorization plugin.Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
Configuring Matrix-Based Security
To configure Jenkins security using matrix-based settings, follow these steps:- In the Jenkins dashboard, navigate to Manage Jenkins, then select Configure Global Security.
- Scroll down to the authorization section and choose Matrix-based Security.
- Click to add a user and type in “Bob”.
- Assign Bob specific permissions, such as the ability to update a run or read job details, without granting him permissions to create or delete jobs.
Project-Based Matrix Authorization
Jenkins also offers Project-Based Matrix Authorization. This method applies permissions on a per-project basis, allowing you to customize access control lists for each project.
Be cautious when configuring project-based permissions. Ensure that all users have the essential permissions required to view the dashboard and access resources.
- Log in as Bob and observe that he cannot perform any actions because he lacks the general read permission.
- Log back in as an administrator.
- Navigate to Manage Jenkins > Configure Global Security.
- Under the overall permissions section, add the necessary read permission for Bob.

This granular approach to configuring security is ideal for environments that demand strict access control, ensuring that each user receives only the permissions necessary for their role.