Info |
---|
SQ Official Doc Link: https://docs.sonarqube.org/display/SONAR/Authorization |
Panel | ||||
---|---|---|---|---|
| ||||
Table of Contents
|
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권한 관리
SonarQube의 권한(Authorization) 관리 매커니즘은 매우 표준적입니다. 관리자는 필요한 만큼 사용자(User) 및 그룹(Group)을 추가할 수 있으며, 사용자들은 하나 혹은 그 이상의 그룹에 속하거나 속하지 않을 수 있습니다. 각 사용자 및 그룹은 하나 혹은 그 이상의 권한을 가지며, 이 권한에 따라 프로젝트, 서비스 및 기타 기능에 대한 접근이 제한됩니다.
그룹 및 사용자를 관리하려면, Administration > Security 메뉴를 사용합니다
사용자
다양한 방법으로 권한을 설정하여 사용자에게 위임할 수 있습니다(플러그인 라이브러리 및 기타 플러그인 참조). 우선 Settings > Security > Users 메뉴에서 수동으로 상요자를 생성하거나, 기본 사용자 정보를 수정합니다. 수동으로 사용자를 생성하는 경우, 로그인 계정 및 비밀번호를 함께 생성할 수 있으며, 이후 해당 계정의 정보를 수정할 수 있습니다.
사용자 생성 및 정보 수정 단계에서 혜당 계정의 사용자 인터페이스 표시 이름과 이메일 주소를 설정할 수 있습니다. 로그인 계정 및 이메일 주소는 가능한 경우 SCM 계정과 동일하게 간주되어 이슈 할당 기능에서 활용됩니다. 이를 위해서는 추가적인 SCM 계정 설정이 필요합니다.
그룹
그룹은 사용자의 집합입니다.
신규 그룹을 생성하려면, 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:
그룹의 구성원을 수정하려면, membership total 옆의 아이콘을 클릭합니다.
다음의 2개 그룹은 특별한 의미를 가집니다:
- Anyone: 이 그룹은 시스템에는 존재하나 관리를 할 수는 없습니다. Anonymous user를 포함한 모든 사용자는 기본적으로 이 그룹에 속합니다.
- sonar-users: 이 그룹은 모든 사용자가 자동으로 소속되는 기본 그룹입니다. 이 그룹을 변경하려면 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글로벌 권한
글로벌 권한을 설정하려면, System administrator 계정으로 접속한 후 Administration > Security > Global Permissions 메뉴를 사용합니다.
- Administer System: All administration functions for the instance: global configurationSonarQube 인스턴스의 모든 관리 기능(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- 분석을 실행하고, 분석을 수행하는 데 필요한 모든 정보에 접근합니다(이 정보에는 SCM 계정 비밀번호와 같은 보안 정보도 포함됩니다).
- Create Projects: 분석 수행 전 분석 대상인 신규 프로젝트의 구조를 생성합니다. SonarQube GUI를 통해 생성하지 않은 프로젝트를 처음으로 분석하는 경우에도 이 권한이 필요합니다.
프로젝트 권한
프로젝트 권한은 프로젝트 레벨의 Administration 메뉴(Administration > Permissions)에서 사용합니다. Administration > Projects > Management > Actions(특정 프로젝트 선택) > Edit Permissions 메뉴에서 프로젝트 권한을 수정할 수 있습니다.
프로젝트 레벨 자원(projects, views, developers)에 대해 다음과 같은 5가지 권한을 설정할 수 있습니다:
- 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이슈의 고급 정보를 수정합니다. 이슈를 False Positive로 설정하거나, 이슈의 심각도 등을 변경합니다.
- Administer: 프로젝트 설정 메뉴에 접근하고 관리 태스크를 수행합니다.
- 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- 분석을 실행하고, 분석을 수행하는 데 필요한 모든 정보에 접근합니다(이 정보에는 SCM 계정 비밀번호, jira 계정 비밀번호 등과 같은 보안 정보도 포함됩니다).
Warning |
---|
권한들은 누적되어 적용되지 않습니다. 예를 들어, 프로젝트를 관리해야 하는 경우, 프로젝트에 접근하기 위해서는 Browse 권한도 함께 가지고 있어야 합니다. |
각 프로젝트에 대한 권한은 사용자 혹은 그룹에 수동으로 부여하거나, 프로젝트에 권한 템플릿(Permission Templates)을 적용해 부여할 수 있습니다.
기본 프로젝트 권한 부여를 위한 권한 템플릿
SonarQube는 기본 권한 템플릿(Permission Template)을 제공하며, 프로젝트(혹은 developer, view) 생성 시 자동으로 특정한 권한을 특정 그룹에게 부여합니다. 권한 템플릿은 자유롭게 수정/생성할 수 있으며, 일부의 신규 프로젝트에만 템플릿을 적용할 수도 있습니다.
권한 템플릿을 사용하려면, 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 메뉴에서 "Create" 버튼을 클릭합니다. Project Key Pattern을 입력해 새롭게 생성하는 프로젝트들이 특정한 권한 템플릿을 자동 적용하도록 할 수 있습니다.
프로젝트 템플릿 수정하기
신규 템플릿 생성 시 해당 템플릿은 아무런 정보도 가지고 있지 않습니다. 템플릿 이름을 클릭하면 권한 수정 인터페이스로 이동합니다.
프로젝트 생성자 권한
프로젝트 생성자(Project Creator)는 매우 특별한 그룹으로, 이 그룹은 템플릿 권한 수정 인터페이스에만 표시됩니다. 프로젝트 생성시 해당 프로젝트를 생성한 사용자에게 부여되는 권한으로, 글로벌 레벨의 Project Creation 권한이 필요한 사용자에게 유용합니다. SonarQube 관리자는 특정 사용자들이 자율적으로 프로젝트를 생성하고 관리할 수 있도록 권한을 부여할 수 있습니다.
프로젝트를 생성한 이후 별도로 프로젝트 템플릿을 적용할 수 있지만, "Project Creators" 권한을 포함한 템플릿을 기존 프로젝트에 적용하더라도 해당 프로젝트를 최초로 생성한 사용자에게 관련 권한을 부여하지는 않습니다.
템플릿에 설정된 프로젝트 권한 초기화
프로젝트에 권한 템플릿을 적용하려면 Projects > Management 메뉴를 사용합니다. 프로젝트의 Actions > Apply Permission Template 옵션에서 특정한 프로젝트에 권한 템플릿을 적용하거나, Bulk Apply Permission Template를 활용해 복수의 프로젝트에 권한 템플릿을 적용할 수 있습니다.
프로젝트와 권한 템플릿 사이에는 아무런 연관성이 없습니다. 즉:
- 프로젝트와 관련된 권한은 해당 프로젝트에 권한 템플릿을 적용한 이후 수정 가능합니다.
- 권한 템플릿을 수덩하더라도 흐로젝트의 권한은 변경되지 않습니다.
FAQ
제가 제 계정의 권한을 잠궜습니다.
다음 데이터 베이스 명령어를 실행하여 System administrator를 다시 생성합니다:
Code Block | ||
---|---|---|
| ||
INSERT INTO user_roles(user_id, role) VALUES ((select id from users where login='mylogin'), 'admin'); |