Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where Jenkins stores SVN credentials

Started to play around with Jenkins. Created new job and entered SVN repository URL. Pressed build and jenkins successfully checked-out my repository. My repository has not got anonymous access. No clue, how Jenkins managed to checked-out repository.

Running on Windows XP + Tomcat6 + Jenkins war file.

Probably Jenkins managed to read password from system properties ? Right now trying to find this configuration file, where it store password-s or settings

UPDATE

Not sure, but looks like, Jenkins read SVN credentials from tortoise svn cache. When i cleaned cache, can't access repository anymore from Jenkins

like image 435
user12384512 Avatar asked Feb 02 '12 10:02

user12384512


People also ask

Where are SVN credentials stored?

Windows can be found either in : C:\Users\%USERNAME%\AppData\Subversion\auth\svn. simple C:\Users\%USERNAME%\AppData\Roaming\Subversion\auth\svn.

How do I set SVN credentials in Jenkins?

Next to the Repository URL text box click the question mark. In that box will be the following text: "click this link and specify different credential". Click on that link to open the Subversion Authentication page. On that page enter the root of the repository URL, enter the login and password to use and click OK.

How does Jenkins work with SVN?

The Jenkins Subversion plugin uses SvnKit as the subversion client and doesn't require a native client to be available on the host. Setting up a CI server with Jenkins and Subversion is limited to a very minimal installation process: just run the Jenkins WAR and you're done.

Can Jenkins pull code from SVN?

Now create a Jenkins build job. Select New Item, give the build project a name such as svn-tomcat-demo, select Maven project, and click OK. Under source code management, select Subversion and enter your SVN repository URL and credential. Please download the sample code and check the code into your SVN server.


3 Answers

Indeed, it takes it from Subversion cache. At least, right now I know, that it's not good idea, to save passwords

Subversion will look in the $HOME/.subversion file for credentials, but it also stores the password under each job in a file called subversion.credentials.

Usually, your Jenkins machine isn't accessible to mere mortals and you can make the Jenkins $HOME directory owned by another user. This way, you can use your OS's security features to prevent people from peeking in at your Jenkins credentials.

Another possibility is to make the Subversion checkout user for Jenkins a read-only user. That will allow Jenkins to checkout the code, but if someone snags the Jenkins Subversion account, they won't be able to make changes.

If you also use Jenkins to tag your Subversion builds, you can use a pre-commit hook to allow Jenkins to create a tag, but not be able to do anything else.

That should ease your security concerns. If you think about it, Jenkins has to be able to store its subversion account and password, or else it won't be able to automatically checkout the code for a build.

like image 185
David W. Avatar answered Sep 27 '22 20:09

David W.


credentials.xml, in default, it's under ~/.jenkins/

like image 25
Isa Wang Avatar answered Sep 27 '22 20:09

Isa Wang


Indeed, it takes it from Subversion cache. At least, right now I know, that it's not good idea, to save passwords

like image 38
user12384512 Avatar answered Sep 27 '22 18:09

user12384512