Secure Source Manager インスタンスを作成する

Secure Source Manager は単一テナントのサービスです。複数の企業が契約関係にあり、共同作業のために単一のインスタンスを使用する必要がある場合を除き、1 つの Secure Source Manager インスタンスには 1 つの Google Cloud 顧客のユーザーのみを含める必要があります。

複数の企業と連携してソースコードを共同作業する場合は、企業ごとに個別のインスタンスを作成することをおすすめします。

VPC Service Controls を有効にしてインスタンスを作成するには、 VPC Service Controls の境界で Secure Source Manager を構成するをご覧ください。

始める前に

  1. ログイン Google アカウントにログインします。

    Google アカウントをまだお持ちでない場合は、 新しいアカウントを登録します

  2. 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 the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Enable the Secure Source Manager API.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the API

  4. Google Cloud CLI をインストールします。

  5. 外部 ID プロバイダ(IdP)を使用している場合は、まず連携 ID を使用して gcloud CLI にログインする必要があります。

  6. gcloud CLI を初期化するには、次のコマンドを実行します:

    gcloud init
  7. 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 the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  8. Enable the Secure Source Manager API.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the API

  9. Google Cloud CLI をインストールします。

  10. 外部 ID プロバイダ(IdP)を使用している場合は、まず連携 ID を使用して gcloud CLI にログインする必要があります。

  11. gcloud CLI を初期化するには、次のコマンドを実行します:

    gcloud init

必要なロール

Secure Source Manager インスタンスの作成に必要な権限を取得するには、プロジェクトに対するSecure Source Manager インスタンス オーナー roles/securesourcemanager.instanceOwner)IAM ロールの付与を管理者に依頼してください。 Google Cloud

Secure Source Manager ロールは、プリンシパルに付与されるまで、 Google Cloud コンソールに表示されません。Secure Source Manager ロールを初めて付与する場合は、 IAM ロールの付与と取り消しをご覧ください。

データ暗号化

デフォルトでは、 Google Cloud は、Google が管理する暗号鍵を使用して、保存されているデータを自動的に 暗号化しますデータを保護する鍵に関連する具体的なコンプライアンス要件や規制要件がある場合は、顧客管理の暗号鍵(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 です。

Secure Source Manager サービス エージェントを作成したら、プリンシパル service-PROJECT-NUMBER@gcp-sa-sourcemanager. に Secure Source Manager サービス エージェント ロール(roles/securesourcemanager.serviceAgent)を付与する必要があります。そうしないと、インスタンスの作成に失敗します。iam.gserviceaccount.com

インスタンスの作成

インスタンスを作成するには、次の手順に従います。

gcloud CLI

  1. 次のコマンドを実行して、インスタンスを作成します。gcloud CLI への認証を求められる場合があります。

    gcloud source-manager instances create INSTANCE_ID \
        --region=LOCATION \
        --project=PROJECT_ID \
        --kms-key=projects/KEY_PROJECT/locations/KEY_LOCATION/keyRings/KEYRING_NAME/cryptoKeys/KEY
    

    ここで

    • INSTANCE_ID は、インスタンスの永続的な ID です。 ID に使用できる文字は英小文字、数字、ハイフンのみです。先頭を英字にする必要があり、作成後に変更することはできません。

    • LOCATION は、インスタンスを作成するリージョンです。サポートされているロケーションについては、 ロケーションをご覧ください。