limit jenkins access to users in a specific ldap group? - jenkins

I set up Jenkins to allow all users in our OU to login. I now wish to limit access to only those users who are in a particular group. How do I do that? I am able to restrict the "Group search base", but I don't think that limits who can login. I think that just makes the lookup more efficient.

We use the "Matrix Authorization Strategy" plugin to specify which groups have which permissions. https://plugins.jenkins.io/matrix-auth
It looks something like this:

Related

Jenkins LDAP authentication for specific group members

I need to setup authentication for our Jenkins via LDAP (AD). I was able to setup the authentication on a wide scale but I have to narrow it down to a certain members of a group and my LDAP filtering fails here.
This is the full DN that I want to target:
CN=jenkinsgroup,OU=App1,OU=Applications,OU=CompanyGroup,OU=Company,DC=my,DC=domain,DC=com
In the jenkinsgroup group I have the users stored as member attributes, only they should get access.
Jenkins LDAP plugin offers these fields:
Jenkis configuration
I'm not sure whether I should use a filter in on the User or the Group field, or which objectClass or category should I use for member attribute - I tried user and member as well.
Error message I get:
User lookup: user "username" does not exist.
Does the Manager Dn have permissions to perform user lookup?
Are the user search base and user search filter settings correct?
LDAP Group lookup: could not verify.
Please try with a user that is a member of at least one LDAP group.
Without the filtering, I can authenticate with a user from the group and it also confirms me its membership.
So I'm confused about how the write the proper query.
Thanks in advance!
As EricLavault commented:
(&(sAMAccountName={0})(memberOf=CN=jenkinsgroup,OU=App1,OU=Applications,OU=CompanyGroup,OU=Company,DC=my,DC=domain,DC=com))
I used this as the user search filter and worked.

How can I dasable "People" link for anonymous user on the jenkins main page?

I am new to Jenkins and my task is to allow (restricted) anonymous access but to prevent the anonymous users from seeing Jenkins users list with their names and ids. I have tried all authorization strategies in the "Global Security" option, but didn't find any solution. Is there any way to do that? Thank you in advance.

How to setup credentials for every project in Jenkins?

I have some 10 projects in my Jenkins , each for 10 different clients . So i need to create credentials for all my projects , so that each client can access only their project .
Is there any plugin to achieve my requirement .??
Please Help !!!
Select "Project-based Matrix Authorization Strategy" under Global Security
Define general users, without access to projects at this level.
Then on per-project select "Enable project-based security", and here you can give individual users addition permissions, such as ability to view and execute the job
Edit:
In Configure Global Security, under Project-based Matrix Authorization:
Make sure Anonymous and Authenticated don't have any other permissions.
Give Anonymous:
Job Discover (this will redirect non-logged in users to login page).
Give Authenticated:
Overall Read (without this permission, nothing else will work).
View Read, optional (without this, they won't see custom views, just the 'all view').
Save configuration
In Job Configuration, under Enable project-based security:
Give client1:
Job Read (this will allow to view this particular job, and nothing else).
Give additional permissions as required (build, workspace, promote, etc).
Save configuration

How to make Jenkins hide logs, history, etc on front page?

I want to remove all changes, workspace links and logs from Jenkins front page.
I do not want unauthorized people, bots, etc to have access to this kind of information.
How can I do that?
Set up your permissions to not allow unauthorized access
WARNING:
Make sure you have your own user/admin setup will all permission, otherwise you risk locking yourself out. If you do, use information here to reset [thanks Alex]
To configure anonymous users to not see anything:
Go to Manage Jenkins
Click Configure System/Configure Global Security (depending on your Jenkins/Hudson configuration)
Under Access Control -> Security Realm, you should have either Matrix-based security or Project-based Matrix Authorization Strategy. I will assume you've selected the later.
Under User/group to add: type authenticated and click Add
Now, give this group all the permissions that you want them to have.
Next, under User/group to add: type Anonymous and click Add
Make sure that none of the permissions are given to this group
Click Save
This way, anonymous (not-logged in) users will not be able to see anything, but authenticated (logged in) users will be able to see what you selected. You can drill-down into more specific user permissions by adding individual users and granting them certain permissions.
P.S. The user authentication depends on your Security Realm configuration. You can configure to use Active Directory/LDAP, or use Jenkin's own user database. The former means you don't have to create users in Jenkins, just give them permissions. The later means you've got to create Jenkins's users first through Manage Jenkins -> Manage Users

How to restrict the allowable permission-set for the OAuth 'scope' parameter (restricting scope)

I want to use Facebook as an authentication source for my application (a website) users. I do not want my application to have anything but basic and email permissions. Thus, my application must not be able to publish to a user's wall for example. In other words, I want to restrict the allowable set of values for the scope parameter and I want this restriction to occur on the application's configuration pages (on the Facebook site itself).
Normally this would be easy, just specify 'email' for the scope parameter of the OAuth URL/call.
However in this case there is another factor and this is: a hacker may gain access to the app and change the OAuth call to specify more permissions. Then an unsuspecting user will typically (or at least possibly) grant those permissions and the hacker will be able to grab the OAuth token and perform actions on behalf of that user.
I'm not interested in discussing the whys of this issue, just in finding of there is a way to specify that my application can only use a specific set of values for the scope parameter. Ideally this specification of the scope restriction be done in the application configuration page on Facebook itself.
However, I am interested in alternate solutions that involve using SAML, OpenID or some other authentication only mechanism (even if I cannot get the users email address). I'm not interested in using RPX.
Please note: this is a complex question not a simple one. I have searched far and wide for an answer and have just found what amounts to the opposite of this question.
I'm pretty sure it's not possible to restrict the scope at application configuration level.
I'd say the tidiest workaround would be to query the permissions of a user on signup, check that they match the allowed permissions, and subscribe to the (permissions realtime updates)[http://developers.facebook.com/docs/reference/api/realtime/]. Your app will be notified of any changes in permissions granted to users.
This should allow you to block any server side API calls through application logic, or (ban)[https://developers.facebook.com/docs/reference/api/application/#banned] a user which escalates permissions.

Resources