How to set 'UpdateCauses ' user permission on Jenkins - jenkins

I am trying to use the build failure analyzer plugin for Jenkins.
https://wiki.jenkins-ci.org/display/JENKINS/Build+Failure+Analyzer
In the documentation it says
The link is shown only if the permission UpdateCauses is set for the current user.
But it doesn't give any information on how what that is or how to set it.
I'm the only user for my Jenkins.
Thanks!

Go to Manage Jenkins > Configure Global Security and under the Access Control section on Authorization there will be the users and their permissions (if you use matrix base security) you will see the Build Failure Analyzer permissions:
So short answer, you configure the plugin permissions using Jenkins configurations.

Related

Can I stop Jenkins jobs per the user who triggered it?

I have Jenkins CI/CD dry run job that each developer can trigger. The question is, can each developer have permissions to stop/abort only his flows which he triggered or Jenkins doesn't support it?
The lowest level of authorization is project-based security via the Matrix Authorization Strategy plugin with Job: Build/Cancel and Run: Delete/Replay/Update.
You could use the build user vars plugin together with the Build Name and Description Setter plugin to add the ${BUILD_USER} to the build's name and/or description (with ☑️ Set build name before build starts) so that each dev knows which build to abort in case.
See also How to get the BUILD_USER in Jenkins when job triggered by timer?.
To restrict the build history to the currently logged on user set the build name to #$BUILD_NUMBER - Started by $BUILD_USER and see my user script Jenkins - Restrict build history to current user:

Jenkins Plugin Development - how to log in as a user

I'm trying to work on a plugin for Jenkins that requires access to the logged in user. It appears that when i'm running the mvn hpi:run, the Jenkins server that is spun up appears to have a user called 'Anonymous' without the option to login/logout etc.
As per the documentation on developing a plugin, i'm using the following settings export MAVEN_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n". Is there any way to enable user authentication on this spun up Jenkins Server?
This ended up being more of an administration task. Had to manually allow authentication on the server (i got a warning on the Manage Jenkins page). This allowed me to create users.

How to allow only specific credential for project in jenkins?

I need to prevent using credentials by every projects. I.e. test1 project should be able to access only test1-cred and only if it is started by user1 from Gitlab or directly in Jenkins. Also this should be supported by Jenkins declarative pipeline. If you use specific credentials in Jenkinsfile which are not allowed for current project - Jenkins shouldn't allow to use them.
How can I implement such a behavior?
As far as I know there are three common places to configure credentials in Jenkins: by user, by folder or globally
It seems that the folder plugin would suit your use case. It allows to organize your projects in folders. For each folder you can configure access rights and credentials.
More informations on credentials: https://plugins.jenkins.io/credentials

Jenkins project-based security

In jenkins you can enable a project-based security matrix.
Unfortunatly I can't find any documentation the option Credentials.
The documentation of the matrix based security describes these options:
Job: Create, start, cancel a Job
Run: Delete or update builds in build history
SCM: Create tags in repository
But I've found no documentation for Credentials:
Why should I manage Credentials per project? I thought it's a global configuration.
I confirm it's to configure the global credentials, there is no credentials per project.
By checking the option "Enable project-based security", this will allow you to customize the permissions per job (but not the credentials).
I hope it help :)

anonymous access to jenkins workspaces

I am using Jenkins installed on CentOS release 6.3 and Jenkins 1.474. I am using Project-based Matrix Authorization Strategy so that only users in specific AD groups are allowed to log in to Jenkins and view particular jobs.
However I am trying to give anonymous access to workspaces for jobs so I can do a wget and specify the http URL. This is so the hosts I am managing via Jenkins can get certain hosts.
I have added Anonymous to the Project-based Matrix Authorization Strategy section and ticked workspaces but this isn't working. When doing a wget I can access forbidden and when I put the URL in to a browser, I am asked to login. I have also configured Anonymous to have access to the workspace on the job itself, but still get access forbidden.
Has anyone got any ideas as to why his is not working?
We are using Jenkins version 1.475
We have the following enabled for anonymous access:
Overall:
Read -> Enabled
Job:
Read -> Enabled
Workspace -> Enabled
This allows access to anonymous users to view the Dashboard and the Jobs and also to the workspace...
As of Jenkins ver. 1.609.1, the changes can be made under
Configure Global Security | Configure Global Security (or htTps://<your jenkins host>/configureSecurity/).
Similar to sdmythos_gr's answer just set Overall Read and Job Read for Anonymous.

Resources