We can secure Jenkins and configure global security through the following:
- Deploy Jenkins.war file to the server and start it.
- From the homepage (through URL), click on Manage Jenkins.
- On this page, click on the ‘Setup Security’ button.
- Check the ‘Enable Security’ checkbox.
- It is a good practice to have your own database for security. Select this option in the ‘Security Realm’ and check the ‘Allow users to sign up’ checkbox.
- Fill the signup form. Once the signup is successful, you can log in with the new account.
- Next, go to Manage Jenkins and ‘Configure Global Security’. Now, uncheck the ‘Allow users to sign up’ checkbox. This way, no new users can be created without permission.
- Now, you can configure the account authentication. There are two strategies: Matrix-based security&Project-based project authorization strategy. You can select the one which is suitable for you.
- Save the form and logout and then login with the new account.