Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Panel
borderColor#C3CCD7
bgColor#FCFCFC

Table of Contents

Table of Contents
indent16px


Encryption is mostly used to remove clear passwords from settings (database or SCM credentials for instance). The implemented solution is based on a symetric key algorithm. The key point is that the secret key is stored in a secured file on disk. This file must owned by and readable only by the system account that runs the SonarQube server, the analysis with SonarQube Runner암호화(encryption)은 대부분 환경설정에서 비밀번호를 제거하기 위해 (데이터베이스 혹은 SCM 인증 등) 사용합니다. 구현된 솔루션은 대칭 키 알고리즘(symetric key algoithm)에 기반합니다. 핵심 포인트는 비밀 키가 디스크의 보안 파일에 저장된다는 점입니다. 이 보안 파일은 SonarQube Server를 기동했거나, SonarQube Scanner, SonarQube Ant Task, Maven or from the Continuous Integration server.

The algorithm is AES 128 bits. Note that 256 bits cipher is not used because it's not supported by default on all Java Virtual Machines (see this article).

1. Generate the secret key

A unique secret key must be shared between all parts of the SonarQube infrastructure (server and analyzers). To generate it, go to Administration > Configuration > Encryption and click on Generate Secret Key:

Image Removed

2. Store the secret key on the SonarQube server

Copy the generated secret key to a file

SonarQube Maven Task 혹은 지속적인 통합(continuous integration) 서버로부터 분석을 실행한 시스템 계정의 사용자가 소유하며, 해당 사용자만 그 내용을 읽을 수 있습니다.

AES 128 bit 알고리즘을 사용하며, 자바 가상 머신에서 제공하지 않는 256 bit 암호화는 지원하지 않습니다(링크 참고(영문))

1. 비밀 키 생성

고유한 비밀 키는 SonarQube 인프라스트럭처(서버 및 분석기)에서 모두 공유합니다. 비밀 키를 생성하려면 Administration > Configuration > Encryption 메뉴에서 Generate Secret Key를 클릭합니다:

Image Added

2. SonarQube  서버에 비밀 키 저장

  1. 생성한 비밀 키를 파일에 복사합니다:

    Code Block
    languagebash
    titlesonar-secret.txt
    bIOVA1TybepjqLH+uYxuNh==


  2. Store this file on the machine hosting the 비밀 키를 저장한 파일을 SonarQube server (default location호스팅 머신에 저장합니다(기본 위치:  ~/.sonar/sonar-secret.txt). If you want to store it somewhere else, set its path through the sonar.secretKeyPath property in 임의의 위치에 저장하고자 하는 경우 SONARQUBE_HOME/conf/sonar.properties 파일의 sonar.secretKeyPath에 해당 저장소의 경로를 입력합니다:

    Code Block
    languagebash
    titleSONARQUBE_HOME/conf/sonar.properties
    ...
    # On Linux
    sonar.secretKeyPath=/path/to/my/secure/location/my_secret_key.txt
    # On Windows
    # (use / or \\ as directory separator)
    sonar.secretKeyPath=C:/path/to/my/secure/location/my_secret_key.txt
    ...


  3. Restrict its access to the system account running the SonarQube server (ownership and 해당 파일의 접근 권한을 SonarQube server 실생 계정으로 제항합니다(파일 소유(ownership) 및 읽기-전용(read-access only) 설정).
  4. Restart your SonarQube serverserver를 재시작합니다.

3.

Generate the encrypted values of your settingsGo back to 

사용자 설정의 암호화 값 생성

Administration > Configuration > Encryption and generate the encrypted values of your settings:Image Removed 메뉴에서 사용자 설정에 대한 암호화 값을 생성합니다:

Image Added

4.

Use these encrypted values in

SonarQube server

configurationSimply copy these encrypted values into 

환경 설정에서 암호화 한 사용자 설정값 사용

암호화 된 값을 복사하여 SONARQUBE_HOME/conf/sonar.properties에 입력합니다:

Code Block
languagebash
titleSONARQUBE_HOME/conf/sonar.properties
sonar.jdbc.url=jdbc:oracle:thin:@172.16.199.130/XE
sonar.jdbc.username=sonar
sonar.jdbc.password={aes}CCGCFg4Xpm6r+PiJb1Swfg==     # Encrypted암호화 password for데이터베이스 the접속 database비밀번호
...
sonar.secretKeyPath=C:/path/to/my/secure/location/my_secret_key.txt

Restart your 이후 SonarQube serverserver를 재시작합니다.