Google Cloud

GCP IAM 完全ガイド|Role 体系・Service Account・Workload Identity・Conditions

2026-05-24
NicheeLab編集部

Google Cloud IAM (Identity and Access Management) は GCP の権限制御基盤。 本記事では Role 体系、リソース階層、Service Account、Workload Identity Federation、IAM Conditions、Organization Policy まで体系的に解説します。

リソース階層

階層説明
Organization会社全体のルート (Cloud Identity / Workspace と紐づき)
Folder事業部 / 環境別 (Prod / Dev)、最大 10 階層
Projectリソースの基本単位、課金単位
Resource個別リソース (Bucket、VM、Dataset 等)

上位のポリシーは下位に継承されます (Union 結合)。

Role 体系

種別用途
Basic (旧 Primitive)roles/owner / editor / viewer本番非推奨、開発用
Predefinedroles/storage.objectViewer 等本番標準、サービス別細分化
Custom組織独自定義Predefined では足りない場合

Identity の種類

  • Google Account: 個人ユーザー (user:[email protected])
  • Service Account: アプリ / VM / Function 用 (serviceAccount:[email protected])
  • Google Group: 複数ユーザーを束ねる (group:[email protected])
  • Cloud Identity Domain: ドメイン全体 (domain:example.com)
  • allUsers / allAuthenticatedUsers: 公開 (Bucket 公開等で使用)
  • Workload Identity Pool: 外部 IdP マッピング

Service Account ベストプラクティス

  1. デフォルト SA を使わない: 専用 SA を作成
  2. キーをダウンロードしない: Workload Identity / Workload Identity Federation 利用
  3. 最小権限: Predefined Role を必要分だけ付与
  4. SA Impersonation: 一時的に他 SA の権限を借用 (gcloud auth print-access-token --impersonate-service-account)
  5. 監査ログ: Cloud Audit Logs で SA 操作を追跡
  6. キーローテーション: やむなくキー利用時は 90 日以内に更新

Workload Identity Federation

外部 IdP (AWS / Azure / Okta / GitHub Actions / Kubernetes) を Google Cloud が信頼する仕組み。SA キーなしで GCP API を呼び出せるため、CI/CD のセキュリティを大幅向上できます。

  • Workload Identity Pool 作成
  • Provider 設定 (AWS / OIDC / SAML)
  • Attribute Mapping (subject / claim から GCP プリンシパル変換)
  • Service Account に impersonate 権限付与

IAM Conditions

属性ベースの権限付与 (Attribute-Based Access Control)。例:

{
  "role": "roles/storage.objectAdmin",
  "members": ["user:[email protected]"],
  "condition": {
    "title": "Only specific bucket and during business hours",
    "expression": "resource.name.startsWith('projects/_/buckets/prod-data') && request.time.getHours('Asia/Tokyo') >= 9 && request.time.getHours('Asia/Tokyo') < 18"
  }
}

Organization Policy

  • constraints/compute.vmExternalIpAccess: 外部 IP の VM を制限
  • constraints/iam.disableServiceAccountKeyCreation: SA キー作成を禁止
  • constraints/gcp.resourceLocations: 許可リージョンを制限
  • constraints/iam.allowedPolicyMemberDomains: 信頼ドメインのみ許可 (Domain Restricted Sharing)
  • constraints/storage.uniformBucketLevelAccess: ACL ではなく IAM のみ強制

Privileged Access Manager (PAM)

  • 2024 リリース、Just-in-Time アクセス
  • 特権ロールに対する申請 → 承認 → 時限付与のワークフロー
  • 緊急時の Break-glass アクセスを安全に運用
  • 監査ログで誰がいつ何を承認したか追跡

監査・モニタリング

  • Cloud Audit Logs: Admin Activity (常時)、Data Access、System Event、Policy Denied
  • IAM Recommender: ML ベースの過剰権限提案 (90 日未使用ロール削減)
  • Policy Troubleshooter: 「なぜこのユーザーは X できない/できる」を分析
  • Policy Analyzer: 組織横断で「誰が何にアクセスできるか」検索

頻出ひっかけ問題

  • Basic Role は本番非推奨: roles/editor は ML / 課金以外ほぼ全権限
  • SA は Identity + Resource の両方: 他 SA に Token Creator を付与すれば Impersonation 可能
  • Conditions は API 対応必要: 全 API でサポートではない、要確認
  • Organization Policy は IAM より優先: 拒否ポリシーは IAM Allow より強い

Primitive / Predefined / Custom Role の違いは?

Primitive (Owner / Editor / Viewer) は粗い権限、本番では非推奨。Predefined はサービス別に細分化されたロール (例: roles/storage.objectViewer)。Custom は組織独自定義。本番は Predefined または Custom が定石。

IAM ポリシー階層は?

組織 (Organization) → フォルダ (Folder) → プロジェクト (Project) → リソース。下位は上位のポリシーを継承します。組織レベルのポリシーは全プロジェクトに波及。

Service Account のベストプラクティスは?

1. デフォルト SA を使わない、2. キーをダウンロードしない (Workload Identity 利用)、3. 必要最小権限、4. 監査ログでアクティビティ追跡、5. SA Impersonation で一時的に権限借用。

Workload Identity Federation とは?

外部 IdP (AWS / Azure / Okta / GitHub Actions 等) を信頼して、SA キーなしで GCP API 呼び出し可能にする仕組み。CI/CD パイプラインで標準化されつつあります。

IAM Conditions で何ができる?

属性ベースの権限制御。例: 「平日 9-17 時のみ許可」「特定リソース名のみアクセス可」「特定の IP からのみ」。Access Level (Context-Aware Access) と組み合わせて強力に。

Organization Policy と IAM Policy の違いは?

IAM は「誰が何をできるか」、Organization Policy は「組織として何を禁止/許可するか」(例: VM の外部 IP 禁止、許可リージョン制限)。両方を組み合わせて統制。

Privileged Access Manager (PAM) とは?

2024 リリースの新機能。特権ロールへの時間限定アクセス申請・承認ワークフロー。緊急時の Just-in-time アクセスを実現します。

Cloud Identity と Google Workspace の違いは?

Cloud Identity = ID 基盤のみ (Free / Premium)、Workspace = ID + Gmail / Drive / Meet 等の SaaS スイート。GCP 単体利用なら Cloud Identity Free で十分。

関連記事・IAM / セキュリティ

Terraform on GCP 完全ガイド|IaC・Provider・Workload Identity・GitHub Actions (2026)

Google Cloud で Terraform を使う IaC 完全ガイド。Google Cloud Provider / Beta、State 管理 (gcs バックエンド)、Workload Identity Federation、Module 設計、GitHub Actions CI、Infracost、Config Connector を 2026 年最新版で網羅。

GitHub Actions + GCP CI/CD 完全ガイド|Workload Identity・Cloud Run/GKE デプロイ (2026)

GitHub Actions で GCP CI/CD を構築する完全ガイド。Workload Identity Federation、setup-gcloud、Cloud Run / GKE デプロイ、Cloud Build 連携、Reusable Workflow、Self-hosted Runner、Secrets 管理を 2026 年最新版で網羅。

GCP Professional Cloud Developer (PCD) 完全ガイド|Cloud Run・GKE・CI/CD・APM

Google Cloud Professional Cloud Developer の試験範囲、Cloud Run / GKE / Cloud Build / Cloud Trace、AWS DVA / Azure AZ-204 比較、学習ロードマップを徹底解説。

GCP Professional Cloud Security Engineer (PCSE) 完全ガイド|IAM・KMS・BeyondCorp・SCC

Google Cloud Professional Cloud Security Engineer の試験範囲、IAM / Cloud KMS / VPC Service Controls / BeyondCorp / Security Command Center、AWS SCS・Azure SC-100 比較を詳解。

※ Google Cloud は Google LLC の商標です。最新情報は IAM 公式 をご確認ください。

この記事で学んだ内容を問題で確認しましょう

16,000問以上の問題で実力チェック

GCP 試験対策ページを見る
この記事の著者

NicheeLab編集部

データエンジニアリング・クラウド資格の専門家。Databricks・Snowflake等の認定資格を保有し、実務経験に基づいた問題作成・解説を行っています。NicheeLab運営。


関連記事
Google Cloud

Google Cloud (GCP) 認定資格ロードマップ 2026 完全版|全 15 試験を体系化

Google Cloud 認定資格 全 15 試験 (Foundational 2 + Associate 3 + Pr...

Google Cloud

Cloud Digital Leader (CDL) 完全ガイド|出題範囲・学習リソース・合格戦略

Google Cloud Cloud Digital Leader (CDL) の完全ガイド。6 ドメイン 92 bul...

Google Cloud

Generative AI Leader (GAIL) 完全ガイド|Google Cloud 生成 AI 認定

Google Cloud Generative AI Leader (GAIL、2025-05-14 リリース) の完全...

Google Cloud

Vertex AI 入門|Google Cloud 統合 ML プラットフォームの全機能

Google Cloud Vertex AI の入門解説。Vertex AI Studio / Agent Builde...

Google Cloud

GCP Associate Cloud Engineer (ACE) 完全ガイド|試験範囲・受験料・学習ロードマップ

Google Cloud Associate Cloud Engineer (ACE) の試験範囲・受験料 125 US...

Google Cloudの記事一覧 (102件)
© 2026 NicheeLab All rights reserved.