Jenkins part3
Class 23rd Jenkins May 14th
- User Creation and management in Jenkins
- Variables & parameters in Jenkis Project
- Pipeline structure & setup in Jenkins
- Freestyle vs Pipleline in Jenkins
- Declarative vs Scripted pipelines
- Jenkins Master-slave (controller-Agent) Setup
User Creation and management in Jenkins
Root user (admin user) has below permission
Create jobs, run jobs, pipelines, credentials , plugins, user & permissions
Rootuser -->admin user --Dev users (Build view)
--Test users (view create)
--Devops users (create build view)
Step1:Create job >Select Freestyle project
Step2:
Dashboard >Manage Jenkins >Click Users
Create three like this dev,test,prod
Step3: Create three jobs Dev jobs/Test jobs/Prod Jobs
One Job Permission (Status,changes,workspace,Build now,Configure,Delete project,Rename)
See below dev user login ,as of now , permission not defined , so showing all
Before going to give permission need to install pugins Rolebased authenications >install
Manage Jenkins >Available Plug's Rolebased Authenications >install
Step4: Select Rolebased -strategy and save
Step5:You see Manage and Assign Roles new role came to in security session Click Mange and roles
Step8: Login dev user ,you see below Access denied ,due to we did not assigned any roles to users
Check above screen shot step6
Step10:See below now all user able view ,left side new build option to exeute because only read option
Step11: You can choose appropriate role and give to the users ,for test we give Build Permission to dev role user
Step14:
Reference :Manage role Agent user ,Node it use for build will be in different instance master and Slave.Credentials service used for s3 bucket move the files get files
User Creation and Management in Jenkins (For Dev team ,members user creation and permission)
Users in Jenkins represent individual team members who need access to the system. Each user can have different levels of access based on their role
Jenkins is a CI/CD automation tool that allows multiple users to build,test and deploy software.
Managin users and role is essential to ensure security,control, and efficiency in a multi-user environment
Benefits of user management
Accountability :Track who triggered builds and made changes
Security: Restricts access to prevent unauthorized changes
Customization: Users can have personalized dashboard and preferences
Audit & Logging:Prvides logs of users actions for troubleshooting
User Authentication Options
Jenkins internal Database(default)
LDAP/Active directory
Matrix Based Role
it is for Project based not for the Job base
Step1: Dashboard >Manage Jenkins >Security
Authorization > Select Project-based Matrix Authorization strategy
Add users which is you have dev/test/prod users give read permission

Step2:
Go to particular job for dev job select Enabled project-based security, and add user which going give permission to the user ,see here i have added dev user give all permissons
See here one only showing particular job devjob not all jobs, those which we give access ,Build also success status
These are all job list in admin user
Dev user as given permission show only Project based
For Test user
For prod
That is differece Rolebase and Project Matrix based For Rolebased need to install plugins
for manage and role permision.
--Thanks
No comments:
Post a Comment