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

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

Related

Make Jenkins show dashboard without account

I would like anyone to go to the server's home page and just see the dashboard—without having an account or logging in. They would have to log in if they wanted to see/do anything else.
Is this even possible?
If it's possible use some plugin based on Matrix Authorization Strategy for example this. Then add read permission for Anonymous Users.

Issue with jenkins security

I installed a fresh copy of jenkins 1.609 and configured one job (I had multiple instances of previous jenkins versions earlier). I wanted to protect this instance, in particular protect the jobs and everything, since it runs on the internet.
When I activate security, and check jenkins-own user database checkbox as well as logged-in users can do everything checkbox and save it, it seems to have no effect, as anonymous user is still able to access the job and the workspace of the job.
When I active use-matrix-based security and give my user admin (actually all) rights, the job isn't visible anymore, but I lose all privileges and I see
<username> is missing the Overall/Administer permission
immediately. After that I have no access to administration overview anymore.
So question from my side, what should I choose if I want the anonymous user to see a blank page, and logged in user to do everything.
The solution is choose the "Matrix-based security" option with the configuration below:
Then, you just have to set the relevant permissions to authenticated users.
Anonymous users will not be able to access your Jenkins server :)

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

Add machine and/or actual user name on changing status in JIRA

My JIRA is mapped to AD and users are normally using their windows login to log into JIRA. However, there are certain group emails too which have access to log into JIRA. So if someone using the group email ID logs in and changes the status, the user name in history section contains only the group's name.
I want to add the machine name from which the group ID was used and/or the actual windows user name who logged into JIRA. Is there a way to do it?
Don't think you can do that without develop a rather complicated plugin.
The plugin basically need to either change username upon login, or display extra info in history tab.
Can you just remove permission on these group emails, so they can't change status?

Setting up a private beta for a website

I'm trying to setup a "private beta" for a site that I'm working on. The site uses open id. I don't want anyone to even browse the pages if they aren't part of the beta. What's the best way to implement this? Any suggestions?
For example:
When the site goes live, users will go to http://www.mydomain.com which will not require them to log in.
For the beta I want to restrict access. Users that go to http://www.mydomain.com will be redirected to a login page. Anyone attempting to access ANY PART OF THE SITE who is not authenticated will be redirected back to the login page.
I could stick [Authorize] attributes all over my controller actions, but that seems stupid.
If you're using ASP.NET MVC, it comes with authentication/authorization out of the box. You should be able to use that to setup authentication on your site.
Alternatively you could setup app server settings - IIS lets you setup username/password on a specific site it's serving, regardless of what the actual application may do. If you have access to the app server this might be the best solution.
If you're using IIS6, you can setup authorization easily. Right-click on your site > Properties > Directory Security Tab > Authentication and Access Control > Edit, and enter a username/pwd of your choice. Done.
The real question is how are they being invited to the private beta?
You could setup a password which drops a cookie much like serverfault.com does.
OR
If you know who you are inviting: you could add them to the system before hand using the email/login information that you already know about them (assuming you are inviting them via email)
I have implemented a function in a web application a while ago where we go the possibility to block access to the full website unless the user was an administrator (which in our case meant that the user account was a member of a specific group in Active Directory).
It was based on two things. First, all pages in the web application inherited not directly from the Page class, but from a custom page class in our web application. Second, we had a value like this in the appSettings section of web.config file:
<add key="adminaccessonly" value="0" />
The custom page class would check that value when loading. If it was not 0 it would redirect to a page (that did not inherit the same custom page class, though) informing the user that "the site is not available right now". If the value was 0 the page would load as usual.
In that application we used this to be able to take the site "offline" when we deployed a new version, giving us some time to verify that all was good before we let in the users again.
Best way are invitation system (based on invitation code) or manually confirmation access after create profile in your system. imho
Or you could host the site on a private server, and set up a VPN to use it. Depending on your resources and needs this may be the easiest and most secure way to do what you want without modifying your codebase.
OR alternatively you could use Apache or IIS to force authentication on access to the website directory. Keeping the authentication info in .htaccess for a while.
Even though you use open id authentication, you may still need some form of authorization mechanism. The simplest form would be a user-roles system in your database that assigns different roles to users
In your case, just assign the private_beta role to your private beta invitees and ensure you your authorization mechanism that all users have private_beta privilege before they may continue.
If you don't want to provide authorization for the public site (where everyone can do everything, once authenticated), then, you may only need to do a quick-and-dirty post-processing (for private beta only) on your open_id authenticated users to check them off a short list (which you can store on a text file.

Resources