マネージド ワークロード ID の仕組み
マネージド ワークロード ID は、Compute Engine と GKE のワークロードに証明された ID を付与します。また、ワークロードが相互 TLS(mTLS)を介して相互に認証するために使用する証明書とトラスト アンカーも付与します。マネージド ワークロード ID は Workload Identity プールにグループ化されます。このプールは、プール内の ID の信頼境界として機能します。
Workload Identity プールを CA Service プールにリンクすると、Google Cloud はワークロードの証明書を自動的に発行して更新します。この自動化により、認証情報の手動管理が不要になり、サービス停止を防ぐことができます。
始める前に
- Google Cloud アカウントにログインします。 Google Cloudを初めて使用する場合は、 アカウントを作成して、実際のシナリオでの Google プロダクトのパフォーマンスを評価してください。新規のお客様には、ワークロードの実行、テスト、デプロイができる無料クレジット $300 分を差し上げます。
-
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.
-
If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Compute Engine, Certificate Manager, Certificate Authority Service APIs, if any are not already enabled.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. 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.-
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.
-
If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Compute Engine, Certificate Manager, Certificate Authority Service APIs, if any are not already enabled.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. 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.- マネージド ワークロード ID を含む既存の Workload Identity プールがあることを確認します。詳細については、Compute Engine のマネージド ワークロード ID 認証を構成するまたは GKE のマネージド ワークロード ID 認証を構成するをご覧ください。
- ワークロードに証明書を発行できる既存の CA Service プールがあることを確認します。詳細については、CA プールを作成するをご覧ください。
必要なロール
ライフサイクル管理の構成に必要な権限を取得するには、プロジェクトに対する次の IAM ロールを付与するよう管理者に依頼してください。
- Certificate Manager 編集者 (
roles/certificatemanager.editor) - CA Certificate Manager (
roles/privateca.certificateManager) - Workload Identity プール管理者(
roles/iam.workloadIdentityPoolAdmin)
ロールの付与については、プロジェクト、フォルダ、組織へのアクセス権の管理をご覧ください。
必要な権限は、カスタムロールや他の事前定義ロールから取得することもできます。
マネージド ワークロードのライフサイクルを構成する
マネージド Workload Identity プールを構成して、関連付けられたワークロードが既存の CA Service プールから証明書を取得して更新する方法を指定します。
- Google Cloud コンソールで、[Certificate Manager(第 2 世代)] ページに移動します。
- ナビゲーション パネルで [ライフサイクルを管理] をクリックします。
- [マネージド Workload Identity] タブを選択します。
- 構成する Workload Identity プールを見つけて、[ライフサイクル管理を構成] をクリックします。
- リージョンのリージョンと CA プールを選択します。
- [証明書の有効期間] フィールドに、発行する証明書の有効期間を指定します。値は 21 ~ 30 日の範囲で指定してください。
- [Rotation window](回転ウィンドウ)を 50 ~ 80 の値に設定します。これは、更新をトリガーする証明書の有効期間の割合です。
- [鍵アルゴリズム] フィールドで、秘密鍵の生成に使用する暗号化アルゴリズムを選択します。
- [更新] をクリックします。