직원 ID 제휴에 대한 자세한 내용은 직원 ID 제휴를 참고하세요.
Secure Source Manager의 직원 ID 제휴 제한사항에 대한 자세한 내용은 ID 제휴: 제품 및 제한사항을 참고하세요.
Secure Source Manager는 단일 테넌트 서비스입니다. 계약 관계가 있는 여러 회사가 공동작업을 위해 단일 인스턴스를 사용해야 하는 경우가 아니면 단일 Secure Source Manager 인스턴스에 한 Google Cloud 고객의 사용자만 포함해야 합니다.
여러 회사와 협력하고 소스 코드에 대해 공동작업하려는 경우 각 회사에 대해 별도의 인스턴스를 만드는 것이 좋습니다.
시작하기 전에
-
로그인하여 Google 계정을 사용하세요.
아직 계정이 없으면 새 계정을 등록하세요.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
Enable the Secure Source Manager API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.-
Google Cloud CLI를 설치합니다.
-
외부 ID 공급업체(IdP)를 사용하는 경우 먼저 제휴 ID로 gcloud CLI에 로그인해야 합니다.
-
gcloud CLI를 초기화하려면, 다음 명령어를 실행합니다.
gcloud init -
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
Enable the Secure Source Manager API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.-
Google Cloud CLI를 설치합니다.
-
외부 ID 공급업체(IdP)를 사용하는 경우 먼저 제휴 ID로 gcloud CLI에 로그인해야 합니다.
-
gcloud CLI를 초기화하려면, 다음 명령어를 실행합니다.
gcloud init
데이터 암호화
기본적으로는 Google Cloud 자동으로 저장 데이터를 사용하여 Google-owned and Google-managed encryption keys암호화합니다. 데이터를 보호하는 키와 관련된 특정 규정 준수 또는 규제 요구사항이 있으면 고객 관리 암호화 키 (CMEK)로 암호화된 Secure Source Manager 인스턴스를 만들면 됩니다.
인스턴스 ID 또는 라벨 키-값 쌍은 CMEK로 암호화되지 않으므로 민감한 정보를 저장하지 마세요.
프로젝트에서 첫 번째 Secure Source Manager 인스턴스를 만드는 경우 다음 명령어를 실행하여 Secure Source Manager 서비스 에이전트를 수동으로 만들어야 합니다.
gcloud beta services identity create \
--service=securesourcemanager.googleapis.com \
--project=PROJECT_ID
여기서 PROJECT_ID는 Secure Source Manager 인스턴스를 만드는 프로젝트의 프로젝트 ID입니다.
제품별, 프로젝트별 서비스 계정 (P4SA)을 만든 후에는 보안 주체 서비스-PROJECT-NUMBER@gcp-sa-sourcemanager.iam.gserviceaccount.com에 Secure Source Manager 서비스 에이전트 역할(roles/securesourcemanager.serviceAgent)을 부여해야 합니다. 그렇지 않으면 인스턴스 생성이 실패합니다.
직원 ID 제휴 설정
인스턴스를 만들기 전에 직원 ID 제휴 풀 및 공급업체를 설정해야 합니다.
인스턴스 만들기
gcloud
아래의 명령어 데이터를 사용하기 전에, 다음을 바꿉니다.
- INSTANCE_ID: 만들려는 인스턴스의 이름입니다.
- LOCATION: 인스턴스를 만들려는 리전입니다. 지원되는 위치에 대한 자세한 내용은 위치를 참고하세요.
- PROJECT_ID: 인스턴스를 만들려는 프로젝트의 프로젝트 ID입니다.
다음 명령어를 실행합니다.
Linux, macOS 또는 Cloud Shell
gcloud source-manager instances create INSTANCE_ID --region=LOCATION --project=PROJECT_ID --enable-workforce-identity-federation
Windows(PowerShell)
gcloud source-manager instances create INSTANCE_ID --region=LOCATION --project=PROJECT_ID --enable-workforce-identity-federation
Windows(cmd.exe)
gcloud source-manager instances create INSTANCE_ID --region=LOCATION --project=PROJECT_ID --enable-workforce-identity-federation
장기 실행 인스턴스 만들기 작업이 시작됩니다. 출력은 다음과 같이 표시됩니다.
Create request issued for [my-instance].
done: false
metadata:
'@type': type.googleapis.com/google.cloud.securesourcemanager.v1.OperationMetadata
apiVersion: v1
createTime: '2023-02-27T20:57:52.315609549Z'
requestedCancellation: false
target: projects/my-project/locations/us-central1/instances/my-instance
verb: create
name: projects/my-project/locations/us-central1/operations/operation-1234567894561-5ec69948c0f2b-60dd727f-a9b97a2e
여기서 projects/my-project/locations/us-central1/operations/operation-1234567894561-5ec69948c0f2b-60dd727f-a9b97a2e는 OPERATION_NAME입니다.
작업 상태를 확인하는 데 사용해야 하므로 OPERATION_NAME을 기록합니다.
인스턴스를 만드는 데 최대 60분이 걸립니다.
API
이 명령어를 실행하기 전에 다음 값을 바꿉니다.
- INSTANCE_ID: 만들려는 인스턴스의 이름입니다.
- LOCATION: 인스턴스를 만들려는 리전입니다. 지원되는 위치에 대한 자세한 내용은 위치를 참고하세요.
- PROJECT_ID: 인스턴스를 만들려는 프로젝트의 프로젝트 ID입니다.
다음 명령어를 실행합니다.
curl \
-X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
https://securesourcemanager.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/instances?instance_id=INSTANCE_ID \
-H "Content-Type: application/json" \
-d "{workforce_identity_federation_config: {enabled: true}}"
장기 실행 인스턴스 만들기 작업이 시작됩니다. 다음과 유사한 결과가 출력됩니다.
{
"name": "OPERATION_NAME",
"metadata": {
"@type": "type.googleapis.com/google.cloud.securesourcemanager.v1.OperationMetadata",
"createTime": "2022-11-01T14:31:32.420469714Z",
"target": "projects/PROJECT_ID/locations/LOCATION/instances/INSTANCE_ID",
"verb": "create",
"requestedCancellation": false,
"apiVersion": "v1"
},
"done": false
}
이 예시 출력에는 다음 값이 포함됩니다.
OPERATION_NAME: 작업 이름(예:projects/my-project/locations/us-central1/operations/operation-1234567894561-5ec69948c0f2b-60dd727f-a9b97a2e)PROJECT_ID: 프로젝트 Google CloudLOCATION: 인스턴스가 배치된 리전
작업 상태를 확인하는 데 사용해야 하므로 OPERATION_NAME을 기록합니다.
인스턴스를 만드는 데 최대 60분이 걸립니다.
Terraform
다음 예시에서는 직원 ID 제휴가 사용 설정된 Secure Source Manager 인스턴스를 만듭니다.
resource "google_secure_source_manager_instance" "instance" {
instance_id = "INSTANCE_ID"
location = "LOCATION"
project = "PROJECT_ID"
workforce_identity_federation_config {
enabled = true
}
}
작업 상태 확인
gcloud
아래의 명령어 데이터를 사용하기 전에, 다음을 바꿉니다.
- OPERATION_NAME: 만들기 명령어 응답의 작업 이름입니다.
- LOCATION: 인스턴스 리전입니다.
다음 명령어를 실행합니다.
Linux, macOS 또는 Cloud Shell
gcloud source-manager operations describe OPERATION_NAME --region=LOCATION
Windows(PowerShell)
gcloud source-manager operations describe OPERATION_NAME --region=LOCATION
Windows(cmd.exe)
gcloud source-manager operations describe OPERATION_NAME --region=LOCATION
인스턴스가 준비되면 응답은 다음과 유사하게 표시됩니다.
"name": "projects/my-project/locations/us-central1/operations/operation-123456789012-5ec69948c0f2b-60dd727f-a9b97a2e",
"metadata": {
"@type": "type.googleapis.com/google.cloud.securesourcemanager.v1.OperationMetadata",
"createTime": "2022-11-01T14:31:32.420469714Z",
"endTime": "2022-11-01T14:48:34.140378114Z",
"target": "projects/my-project/locations/us-central1/instances/my-instance",
"verb": "create",
"requestedCancellation": false,
"apiVersion": "v1"
},
"done": true,
"response": {
"@type": "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance",
"name": "projects/my-project/locations/us-central1/instances/my-instance",
"createTime": "2022-11-01T14:31:32.416413630Z",
"updateTime": "2022-11-01T14:31:32.416413630Z",
"labels": {
"ldap": "user",
"source": "manual"
},
"state": "ACTIVE",
"hostConfig": {
"html": "my-instance-098765432109.us-central1.sourcemanager.dev",
"api": "my-instance-098765432109-api.us-central1.sourcemanager.dev",
"gitHttp": "my-instance-098765432109-git.us-central1.sourcemanager.dev"
}
}
여기서 my-instance-098765432109.us-central1.sourcemanager.dev는 인스턴스 HTML URL입니다.
API
요청 데이터를 사용하기 전에 다음을 바꿉니다.
- OPERATION_NAME: 만들기 명령어 응답의 작업 이름입니다.
HTTP 메서드 및 URL:
GET https://securesourcemanager.googleapis.com/v1/OPERATION_NAME
요청을 보내려면 다음 옵션 중 하나를 펼칩니다.
인스턴스가 준비되면 응답은 다음과 유사하게 표시됩니다.
"name": "projects/my-project/locations/us-central1/operations/operation-123456789012-5ec69948c0f2b-60dd727f-a9b97a2e",
"metadata": {
"@type": "type.googleapis.com/google.cloud.securesourcemanager.v1.OperationMetadata",
"createTime": "2024-10-28T15:37:39.009812863Z",
"endTime": "2024-10-28T16:10:58.416640259Z",
"target": "projects/my-project/locations/us-central1/instances/my-instance",
"verb": "create",
"requestedCancellation": false,
"apiVersion": "v1"
},
"done": true,
"response": {
"@type": "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance",
"name": "projects/my-project/locations/us-central1/instances/my-instance",
"createTime": "2024-10-28T15:37:39.004550840Z",
"updateTime": "2024-10-28T15:37:39.867857246Z",
"state": "ACTIVE",
"hostConfig": {
"html": "my-instance-326202322590.us-central1.sourcemanager.dev",
"api": "my-instance-326202322590-api.us-central1.sourcemanager.dev",
"gitHttp": "my-instance-326202322590-git.us-central1.sourcemanager.dev",
"gitSsh": "my-instance-326202322590-ssh.us-central1.sourcemanager.dev"
},
"workforceIdentityFederationConfig": {
"enabled": true
}
}
여기서 my-instance-098765432109.us-central1.sourcemanager.dev는 인스턴스 HTML URL입니다.
성공적인 상태 확인 응답에서 HTML URL을 복사합니다. 웹 인터페이스를 통해 인스턴스에 액세스하려면 이 URL이 필요합니다.
인스턴스 액세스
인스턴스가 생성된 후 브라우저를 사용하여 웹 인터페이스를 통해 액세스할 수 있습니다.
-
웹 인터페이스를 통해 Secure Source Manager 인스턴스에 액세스하려면 다음 URL을 브라우저 주소 표시줄에 복사합니다.
INSTANCE_ID-PROJECT_NUMBER.LOCATION.sourcemanager.dev다음을 바꿉니다.
- INSTANCE_ID을 인스턴스 이름으로 바꿉니다.
- PROJECT_NUMBER를 인스턴스의 Google Cloud 프로젝트 번호로 바꿉니다. 프로젝트 식별에 대한 자세한 내용은 프로젝트 식별을 참고하세요.
- LOCATION을 인스턴스의 리전으로 바꿉니다.
공급업체 이름을 요청하는 OAuth 화면이 나타납니다.
다음 형식으로 직원 ID 공급업체의 이름을 입력합니다.
locations/global/workforcePools/POOL_ID/providers/PROVIDER_ID다음을 바꿉니다.
POOL_ID를 직원 ID 제휴 풀 ID로 바꿉니다.PROVIDER_ID를 직원 ID 제휴 공급업체 ID로 바꿉니다.
직원 ID 제휴 풀 및 공급업체에 대한 자세한 내용은 직원 ID 제휴 ID 풀 및 공급업체 관리를 참고하세요.
공급업체 사용자 인증 정보를 사용하여 로그인하라는 메시지가 표시됩니다.
공급업체 사용자 인증 정보를 사용하여 로그인합니다.
Secure Source Manager 웹 인터페이스가 열립니다. 여기에서 저장소, 문제, pull 요청을 만들고 볼 수 있습니다.
직원 ID 제휴 풀의 세션 시간 이 만료된 후 웹 인터페이스를 통해 다시 로그인해야 합니다.
gcloud CLI 로그인 구성 만들기
gcloud CLI 명령어 또는 Git 명령어를 사용하여 직원 ID 풀 사용자 인증 정보로 Secure Source Manager 인스턴스를 인증하려면 직원 ID 풀로 로그인 구성을 만들어야 합니다.
직원 ID 풀 로그인 구성을 만들려면 직원 ID 제휴를 위한 단기 토큰 가져오기의 안내에 따라 gcloud CLI로 브라우저 기반 로그인을 만듭니다.
인증 후 Git 명령어를 사용하여 Secure Source Manager 인스턴스와 상호작용할 수 있습니다. Git을 시작하려면 Git 소스 코드 관리를 참고하세요.