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


권한 관리

SonarQube의 권한 관리 메커니즘은 일반적인 표준을 따릅니다. (Authorization) 관리 매커니즘은 매우 표준적입니다. 관리자는 필요한 만큼 자유롭게 사용자 및 그룹을 (User) 및 그룹(Group)을 추가할 수 있습니다. 있으며, 사용자들은 하나 혹은 그 이상의 그룹의 그룹에 속하거나 또는 속하지 않을 수 있습니다. SonarQube는 사용자 및 그룹에 그룹은 하나 혹은 그 이상의 권한을 부여합니다. 가지며, 이 권한에 따라 프로젝트, 소비스 서비스 및 기타 기능에 대한 접근을 제한합니다접근이 제한됩니다.

그룹 및 사용자를 관리하려면, Administration > Security 메뉴를 사용합니다

User (

사용자

)

권한은 다양한 방법을 조합하여 다양한 방법으로 권한을 설정하여 사용자에게 위임할 수 있습니다(Plugin Library 및 Ohter Plugins 플러그인 라이브러리기타 플러그인 참조). 다만 먼저 우선 Settings > Security > Users 메뉴에서 수동으로 사용자를 생성하거나 기존 사용자를 수정해야 합니다상요자를 생성하거나, 기본 사용자 정보를 수정합니다. 수동으로 사용자를 생성하는 경우, 로그인 계정 및 비밀번호를 계정과 함께 생성할 수 있습니다. 사용자는 있으며, 이후 해당 계정의 정보를 수정할 수 있습니다.

사용자 생성 및 정보 수정 단계에서 , 해당 혜당 계정의 화면상 사용자 인터페이스 표시 이름과 이메일 주소를 설정할 수 있습니다, 서용자의 로그인 계정과 이메일 주소는 . 로그인 계정 및 이메일 주소는 가능한 경우 SCM 계정과 동일하게 간주되어 이슈 할당 기능에서 SCM 계정으로 활용됩니다. 다만 이 경우 추가적으로 이를 위해서는 추가적인 SCM 계정 설정을 수행해야 합니다설정이 필요합니다.

Group (

그룹

)

그룹은 사용자의 집합입니다.

신규 그룹을 생성하려면, Administration > Security > Groups > Add new group을 선택합니다group 메뉴를 사용합니다.

그룹의 구성원을 수정하려면, membership total 옆의 아이콘을 클릭합니다.

다음의 2개 그룹은 특별한 의미를 가집니다:

  • Anyone: 이 그룹은 시스템에는 존재하나 관리를 할 수는 없습니다. Anonymous user를 포함한 모든 사용자는 기본적으로 이 그룹에 속합니다.
  • sonar-users: 이 그룹은 모든 사용자가 자동으로 소속되는 기본 그룹입니다. 이 그룹을 변경하려면 Settings > General Settings > Security 메뉴에서 Default user group 속성을 변경합니다.

글로벌 권한

글로벌 권한을 설정하려면, System administrator 계정으로 접속한 후 Administration > Security > Glogal Global Permissions 메뉴를 사용합니다.

  • Administer System: SonarQube 인스턴스의 모든 관리 기능(global configuration)을 사용합니다.
  • Administer Quality Profiles: 품질 프로파일과 관련된 모든 기능을 사용합니다.
  • Administer Quality Gates: 품질 게이트와 관련된 모든 기능을 사용합니다.
  • Execute Analysis: 분석을 실행하고, 분석을 수행하는 데 필요한 모든 정보에 접근합니다(이 정보에는 SCM 계정 비밀번호와 같은 보안 정보도 포함됩니다).
  • Create Projects: 분석 수행 전 분석 대상인 신규 프로젝트의 구조를 생성합니다. SonarQube GUI를 통해 생성하지 않은 프로젝트를 처음으로 분석하는 경우에도 이 권한이 필요합니다.

프로젝트 권한

프로젝트 권한은 프로젝트 레벨의 Administration 메뉴(Administration > Permissions)에서 사용합니다. Administration > Projects > Management > Actions(특정 프로젝트 선택) > Edit Permissions 메뉴에서 프로젝트 권한을 수정할 수 있습니다.

프로젝트 레벨 자원(projects, views, developers)에 대해 다음과 같은 5가지 권한을 설정할 수 있습니다:

  • Browse: 프로젝트에 접속해 다양한 지표들을 확인하고, 이슈를 생성/ 수정합니다. 
  • See Source Code: 프로젝트의 소스 코드를 확인합니다.
  • Administer Issues: 이슈의 고급 정보를 수정합니다. 이슈를 False Positive로 설정하거나, 이슈의 심각도 등을 변경합니다.
  • Administer: 프로젝트 설정 메뉴에 접근하고 관리 태스크를 수행합니다.
  • Execute Analysis: 분석을 실행하고, 분석을 수행하는 데 필요한 모든 정보에 접근합니다(이 정보에는 SCM 계정 비밀번호, jira 계정 비밀번호 등과 같은 보안 정보도 포함됩니다).
주의!
Warning

권한들은 누적되어 적용되지 않습니다. 예를 들어, 프로젝트를 관리해야 하는 경우, 프로젝트에 접근하기 위해서는 Browse 권한도 함께 가지고 있어야 합니다.

각 프로젝트에 대한 권한은 사용자 혹은 그룹에 수동으로 부여하거나, 프로젝트에 권한 템플릿(Permission Templates)을 적용해 부여할 수 있습니다.

기본 프로젝트

권한의

권한 부여를 위한 권한 템플릿

SonarQube는 기본 권한 템플릿을 템플릿(Permission Template)을 제공하며, 프로젝트(혹은 developer, view) 생성시 자동적으로 생성 시 자동으로 특정한 프로젝트 권한을 특정 그룹에게 부여합니다. 권한 템플릿은 자유롭게 수정하거나 수정/생성할 수 있으며, 일부 일부의 신규 프로젝트에만 템플릿을 적용할 수도 있습니다.

권한 템플릿을 사용하려면, Administration > Secutity Security > Permission Templates 메뉴로 이동합니다.

권한 템플릿 생성하기

새로운 템플릿을 생성하려면 Administration > Security > Permission Templates 메뉴에서 "Create" 버튼을 클릭합니다. Project key 패턴을 Key Pattern입력해 새롭게 생성하는 프로젝트들이 특정한 권한 템플릿을 자동 적용하도록 할 수 있습니다.

Image Added

프로젝트 템플릿 수정하기

신규 템플릿 생성 시 해당 템플릿은 생성시 기본적으로 아무런 정보도 가지고 있지 않습니다. 템플릿 이름을 클릭하면 권한 수정 인터페이스로 이동합니다.

프로젝트 생성자 권한

프로젝트 생성자(Project

Creators) 권한

프로젝트 생성자는 Creator)는 매우 특별한 그룹으로, 이 그룹은 프로젝트 템플릿 권한 수정 인터페이스에서만 나타납니다. 이 그룹에 부여된 권한은 인터페이스에만 표시됩니다. 프로젝트 생성시 해당 프로젝트를 생성한 사용자에게 부여됩니다. 이 권한은 부여되는 권한으로, 글로벌 레벨의 Project Creation 권한이 필요한 사용자에게 유용합니다. SonarQube 관리자는 사용자 그룹이 특정 사용자들이 자율적으로 프로젝트를 생성하고 관리할 수 있도록 자동적으로 권한을 부여할 수 있습니다.

프로젝트를 생성한 이후 별도로 프로젝트 템플릿을 적용할 수 있지만, "Project Creators" 권한을 포함한 템플릿을 기존 프로젝트에 적용하는 경우, 적용하더라도 해당 프로젝트를 최초로 생성한 사용자에게 해당 관련 권한을 부여하지는 않습니다.

템플릿에 설정된 프로젝트 권한 초기화

프로젝트에 권한 템플릿을 적용하려면 Projects > Management 메뉴를 사용합니다. 프로젝트의 Actions > Apply Permission Template 옵션을 사용해 옵션에서 특정한 프로젝트에 권한 템플릿을 적용하거나, Bulk Apply Permission Template를 Template활용해 복수의 프로젝트에 권한 템플릿을 적용할 수 있습니다.

프로젝트와 권한 템플릿 사이에는 아무런 연관성이 없습니다. 즉:

  • 프로젝트와 관련된 권한은 해당 프로젝트에 권한 템플릿을 적용한 이후 수정 가능합니다.
  • 권한 템플릿을 수덩하더라도 흐로젝트의 권한은 변경되지 않습니다.

FAQ

제가 제 계정의 권한을 잠궜습니다.

System administrator를 다시 생성합니다:

Code Block
languagebash
INSERT INTO user_roles(user_id, role) VALUES ((select id from users where login='mylogin'), 'admin');

The way authorization is implemented in SonarQube is pretty standard. It is possible to create as many users and groups of users as required in the system. The users can then be attached (or not) to (multiple) groups. Groups and / or users are then given (multiple) permissions. The permissions grant access to projects, services and functionalities.

To administer groups and users, choose Administration > Security, and use the sub-menu items.

User

Multiple integrations that allow the delegation of authentication are available (see Plugin Library and Other Plugins), but you can manually create and edit users at Settings > Security > Users. For manually-created users, login and password can be set at creation. Manually-created users can edit their passwords.

During both user creation and edit, you can set an account's screen name, email address. User login and email address will be implicitly recognized by the Issue Assignment feature as SCM accounts if applicable, but you can set additional SCM accounts explicitly. 

Group

A group is a set of users.

To create a new group, go to Administration > Security > Groups > Add new group.

To edit the membership of a group, click the icon next to the membership total.

Two groups have a special meaning:

  • Anyone is a group that exists in the system, but that cannot be managed. Every user belongs to this group, including Anonymous user.
  • sonar-users is the default group to which users are automatically added. To change it, go to Settings > General Settings > Security and set the Default user group property.

Global Permissions

To set global permissions, log in as a System administrator and go to Administration > Security > Global Permissions

  • Administer System: All administration functions for the instance: global configuration.
  • Administer Quality Profiles: Any action on quality profiles.
  • Administer Quality Gates: Any action on quality gates
  • Execute Analysis: Execute analyses (project, view, report, developer), and to get all settings required to perform the analysis, even the secured ones like the scm account password, and so on.
  • Create Projects: Initialize the structure of a new project before its first analysis. This permission is also required when doing the very first analysis of a project that has not already been created via the GUI. 

    Project Permissions

    Project permissions are available from the project-level Administration menu: Administration > Permissions. You can also access the project permission editing interface from Administration > Projects > Management > Actions (selected on a specific project) > Edit Permissions.

    Five different permissions can be set on project-level resources (projects, views, developers):

    • Browse: Access a project, browse its measures, and create/edit issues for it.
    • See Source Code: View the project's source code.
    • Administer Issues: Advanced editing on issues: marking an issue False Positive or changing an Issue's severity.
    • Administer: Access project settings and perform administration tasks.
    • Execute Analysis: Execute analyses (project, view, report, developer), and to get all settings required to perform the analysis, even the secured ones like the scm account password, the jira account password, and so on.

    Note that permissions are not cumulative. For instance, if you want to be able to administer the project, you also have to be granted the Browse permission to be able to access the project.

    You can either manually grant permissions for each project to some users and groups or apply permission templates to projects. 

    Permission Templates for Default Project Permissions

    SonarQube ships with a default permissions template, which automatically grants specific project permissions to certain groups when a project (or developer, or view) is created. It is possible to edit this template, to create additional templates, and to have a template apply only to a subset of new projects.

    This is done through permission templates. Go to Administration > Security > Permission Templates.

    Creating permission templates

    To create a new template, use the "Create" button on Administration > Security > Permission Templates. It is possible to provide a Project key pattern. By default, every new project matching this key pattern will have the permissions described by the template.

    Editing Project Templates

    Templates are empty immediately after creation. Clicking on the template name will take you to its permission editing interface.

    Project Creators permissions

    Project Creators is a special group that appears only in the project template permission editing interface. Any permissions assigned to this group will at the time of project creation be granted to the single user account used to create the project. This is only useful for users who are granted the Global-level Project Creation permission. This allows SonarQube administrators to let a group of users create and administer projects autonomously.

    While project templates can be applied after project creation, applying a template that includes "Project Creators" permissions to an existing project will not grant the relevant permissions to the project's original creator.

    Reset project permissions to a template

    To apply permission templates to projects to to Projects > Management. You can  either apply a template to a specific project using the project-specific Actions > Apply Permission Template option or use the Bulk Apply Permission Template to apply a template to all selected projects.

    Note that there is no relation between a project and a permission template, meaning that:

    • the permissions of a project can be modified after a permission template has been applied to this project
    • none of the project permissions is changed when a permission template is modified

    FAQ

    I have locked myself out

    To recreate a System administrator다음 데이터 베이스 명령어를 실행하여 System administrator를 다시 생성합니다:

    Code Block
    languagebash
    INSERT INTO user_roles(user_id, role) VALUES ((select id from users where login='mylogin'), 'admin');