Users and their necessary permissions on the Jenkins instance can be configured in Jenkins. By default, you will not want everyone in Jenkins to be able to define jobs or other administrative duties. As a result, Jenkins can have a security setup in place.
Follow the steps below to configure Security in Jenkins.
Step 1 − Click on Manage Jenkins, choose ‘Configure Global Security’.
Step 2 − Select the Enable Security option. Assume, for example, that we want Jenkins to keep its user database, thus in the Security Realm, select the option 'Jenkins' user database'.
Because you want a central administrator to define users in the system by default, leave the 'Allow users to sign up' option unchecked. You can leave the rest alone for the time being and click the Save button.
Step 3 − You'll be asked to add your first user. As an example, we are creating administrator users for the system.
Step 4 − It's now time to add users to the system. Select the 'Manage Users' option available on selecting ‘Manage Jenkins’
Step 5 − Begin generating other users for the system like you specified in your admin account. As an example, let's make another user named 'user’.
Step 6 − It's now time to configure your authorisations or who has access to what. Navigate to Manage Jenkins and select Configure Global Security.
Click on 'Matrix-based security' in the Authorisation section now.
Step 7 − If the user cannot be found in the user group list, type the user's name into the search box and add it to the list. Then provide the user the necessary permissions.
Once you've defined the necessary authorisations, click the Save button.
Jenkins security is now configured.
It is important to note that the Active Directory plugin must be installed in Jenkin to use Windows AD authentications.