Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Sonar-Runner talks to the local database?

In the similar question Sonar-Runner talks to the local database "David RACODON - SonarSource" wrote:

The SonarQube Runner needs to talk to both the database and the web server.

I'm will try to understand why Sonar Runner talks do sonar database, because somebody who use sonar runner will known database user and password and do anything on it, for example change admin password and take control on Sonar instance.

On the other hand, at sonar runner docs (http://docs.sonarqube.org/display/SONAR/Installing+and+Configuring+SonarQube+Runner) I see info:

The SonarQube Runner is recommended as the default launcher to analyze a project with SonarQube.

So, it means that I should give database password to each developer of my team? This is inconsistent. Could somebody explain it?

like image 930
Marek Berkan Avatar asked Apr 22 '14 19:04

Marek Berkan


People also ask

How to run SonarQube on oracle using sonar?

The connection string consists of the jdbc driver, our server (‘localhost’) and the database JPORA11 on the default port 1521 of Oracle. Then we indicate the Oracle user and his password, to access the ‘sonar’ schema. Et voilà. To run the SonarQube Runner, you just have to launch the ‘sonar-runner.bat’ file located into the ‘..\bin’ directory.

What is the SonarQube runner?

The SonarQube Runner allows us to perform source code analyzes without using tools such as Ant or Maven.

Why install SonarQube on J2EE?

These toos are well known from J2EE (or any other new technology) development teams, but let’s remember that our objective in this serie about the installation of SonarQube, and more generally in our blog, is to allow anyone to perform code quality and applications analyzes, without requiring any knowledge of these new technologies.


2 Answers

SonarQube needs to talk to the database in order to save the results (metrics) of the analysis.

I will not talk about all the different possibilities that you can implement in order to avoid SonarQube's users to know the admin login, but here is the one I use:

  1. SonarQube + Runner
  2. Jenkins with Sonar plugin

This post (on my blog) is 1 year old http://qualilogy.com/en/install-sonarqube-the-sonarqub-jenkins-plugin/) but it will give you an idea.

You already have SonarQube + Runner installed.

  1. Install Jenkins
  2. Install SonarQube plugin for Jenkins
  3. Configure the plugin:
    • Location of Runner
    • SonarQube dashboard URL
    • Connection to the DB : password is encrypted.

Then, when configuring and running an analysis from Jenkins, no need to use any DB login as a parameter.

Hope it helps.

like image 79
Qualilogy Avatar answered Nov 03 '22 06:11

Qualilogy


As of version 5.2, this is no longer the case. Now, all DB credentials/connections are managed by Sonar itself, not the runner.

like image 35
martin Avatar answered Nov 03 '22 08:11

martin