IAM によるアクセス制御
このページでは、BigQuery の Identity and Access Management(IAM)のロールと権限について説明します。
このページで説明するロールと権限には、BigQuery の次のコンパニオン プロダクトに関連するものも含まれています。
- BigQuery ML
- BigQuery Data Transfer Service
- BigQuery BI Engine
BigQuery ML でのアクセス制御について詳しくは、BigQuery ML ドキュメントのアクセス制御をご覧ください。
概要
ID で Google Cloud API を呼び出す場合、BigQuery ではその ID がリソースを使用するための適切な権限を持っている必要があります。権限を付与するには、ユーザー、グループ、またはサービス アカウントにロールを付与します。
このページでは、BigQuery リソースにアクセスするために ID に付与する BigQuery IAM のロールについて説明します。
IAM のロールのタイプ
IAM には、次の 3 種類のロールがあります。
- 事前定義ロール: 特定のサービスへのアクセスを細かく制御します。また、Google Cloud により管理されます。事前定義ロールは、一般的なユースケースとアクセス制御パターンをサポートすることを目的としています。
- カスタムロール: ユーザー指定の権限リストに従って、アクセスを制御します。
基本ロール: オーナー、編集者、閲覧者のロールが含まれます。
事前定義ロール、カスタムロール、基本ロールに 1 つ以上の権限が含まれているかどうかを確認するには、次のいずれかの方法を使用します。
gcloud iam roles describe
コマンド- IAM API の
roles.get()
メソッド
ある特定のユーザーに事前定義ロールと基本ロールの両方を割り当てると、各ロールの権限が合わせて付与されます。
IAM を使用してリソースにアクセスする方法の詳細については、IAM ドキュメントのリソースへのアクセス権の付与、変更、取り消しをご覧ください。
カスタムロールの作成方法については、IAM ドキュメントのカスタムロールの作成と管理をご覧ください。
BigQuery の権限と事前定義された IAM のロール
BigQuery リソースへのアクセス権を付与するには、ユーザー、グループ、またはサービス アカウントに、1 つ以上のロールを割り当てます。アクセス権は次の BigQuery リソースレベルで付与できます。
- 組織レベルまたは Google Cloud プロジェクト レベル
- データセット レベル
- テーブルレベルまたはビューレベル
組織レベルまたは Cloud プロジェクト レベルで適用されるロール
組織レベルおよびプロジェクト レベルでロールを割り当てると、BigQuery ジョブの実行権限、またはプロジェクトに含まれる BigQuery リソースすべてに対するアクセス権限が付与されます。
データセット レベルで適用されるロール
データセット レベルでロールを割り当てると、プロジェクトのリソースへの完全アクセス権を付与しなくても、特定のデータセットへのアクセス権を付与できます。IAM ポリシー階層では、BigQuery データセットはプロジェクトの子リソースにあたります。データセット レベルでロールを割り当てる方法について詳しくは、データセットへのアクセスの制御をご覧ください。
データセット内の個々のリソースに適用されるロール
データセットのリソースへの完全アクセス権を付与しなくても、データセット内の特定の種類のリソースにロールを個別に割り当てることができます。
以下の種類の個別のリソースにロールを適用できます。
- テーブル
- ビュー
以下の種類の個別のリソースにロールを適用することはできません。
- ルーティン
- モデル
テーブルレベルまたはビューレベルでロールを割り当てる方法の詳細は、テーブルまたはビューへのアクセスの制御をご覧ください。
BigQuery の権限
次の表に、BigQuery で使用可能な権限を記載します。
権限 | 説明 |
---|---|
bigquery.bireservations.get (ベータ版) |
BI Engine の予約を読み取ります。 |
bigquery.bireservations.update (ベータ版) |
BI Engine の予約を更新します。 |
bigquery.capacityCommitments.create |
プロジェクトに容量コミットメントを作成します。 |
bigquery.capacityCommitments.delete |
容量コミットメントを削除します。 |
bigquery.capacityCommitments.get |
容量コミットメントに関する詳細を取得します。 |
bigquery.capacityCommitments.list |
プロジェクト内の容量コミットメントすべてを一覧表示します。 |
bigquery.capacityCommitments.update |
プロジェクト内の容量コミットメントすべてを更新します。 |
bigquery.connections.create |
プロジェクト内で新しい接続を作成します。 |
bigquery.connections.delete |
接続を削除します。 |
bigquery.connections.get |
接続のメタデータを取得します。認証情報は除外されます。 |
bigquery.connections.list |
プロジェクト内の接続を一覧表示します。 |
bigquery.connections.update |
接続とその認証情報を更新します。 |
bigquery.connections.updateTag |
接続のタグを更新します。 |
bigquery.connections.use |
接続構成を使用して、リモート データソースに接続します。 |
bigquery.connections.delegate |
接続を委任して、承認済みの外部テーブルとリモート関数を作成します。 |
bigquery.datasets.create |
新しい空白のデータセットを作成します。 |
bigquery.datasets.delete |
データセットを削除します。 |
bigquery.datasets.get |
データセットに関するメタデータを取得します。 |
bigquery.datasets.getIamPolicy |
データセットの IAM 権限を読み取ります。 |
bigquery.datasets.link |
リンクされたデータセットを作成します。 |
bigquery.datasets.setIamPolicy |
データセットの IAM 権限を変更します。 |
bigquery.datasets.update |
データセットのメタデータを更新します。 |
bigquery.datasets.updateTag (ベータ版) |
データセットのタグを更新します。 |
bigquery.jobs.create |
プロジェクト内でジョブ(クエリを含む)を実行します。 |
bigquery.jobs.get |
ジョブのデータとメタデータを取得します1。 |
bigquery.jobs.list |
すべてのジョブを一覧表示し、任意のユーザーが送信した任意のジョブのメタデータを取得します。 他のユーザーが送信したジョブについては、詳細とメタデータが削除されます。 |
bigquery.jobs.listAll |
すべてのジョブを一覧表示し、任意のユーザーが送信した任意のジョブのメタデータを取得します。 |
bigquery.jobs.listExecutionMetadata (ベータ版) |
ユーザーが送信したジョブに関するすべてのジョブ実行メタデータ(機密情報を除く)を一覧表示します。組織レベルでのみ適用でき、管理 UI で使用されます。 |
bigquery.jobs.delete |
ジョブのメタデータを削除します。 |
bigquery.jobs.update |
ジョブをキャンセルします1。 |
bigquery.models.create |
新しいモデルを作成します。 |
bigquery.models.delete |
モデルを削除します。 |
bigquery.models.getData |
モデルデータを取得します。モデル メタデータを取得するには、bigquery.models.getMetadata が必要です。 |
bigquery.models.getMetadata |
モデル メタデータを取得します。モデルデータを取得するには、bigquery.models.getData が必要です。 |
bigquery.models.list |
モデルとモデルのメタデータを一覧表示します。 |
bigquery.models.updateData |
モデルデータを更新します。モデル メタデータを更新するには、bigquery.models.updateMetadata が必要です。 |
bigquery.models.updateMetadata |
モデル メタデータを更新します。モデルデータを更新するには、bigquery.models.updateData が必要です。 |
bigquery.models.export |
モデルをエクスポートします。 |
bigquery.readsessions.create |
BigQuery Storage Read API を使用して新しい読み取りセッションを作成します。 |
bigquery.readsessions.getData |
Storage Read API を使用して読み取りセッションからデータを読み取ります。 |
bigquery.readsessions.update |
Storage Read API を使用して読み取りセッションを更新します。 |
bigquery.reservations.create |
プロジェクトに予約を作成します。 |
bigquery.reservations.delete |
予約を削除します。 |
bigquery.reservations.get |
予約の詳細を取得します。 |
bigquery.reservations.list |
プロジェクト内の全予約を一覧表示します。 |
bigquery.reservations.update |
予約のプロパティを更新します。 |
bigquery.reservationAssignments.create |
予約割り当てを作成します。所有者プロジェクトと割り当て先リソースには、この権限が必要です。 |
bigquery.reservationAssignments.delete |
予約割り当てを削除します。この権限は、所有者プロジェクトと割り当て先リソースに必要です。 |
bigquery.reservationAssignments.list |
プロジェクト内の予約割り当てすべてを一覧表示します。 |
bigquery.reservationAssignments.search |
特定のプロジェクト、フォルダ、または組織の予約割り当てを検索します。 |
bigquery.rowAccessPolicies.create |
テーブルに新しい行レベルのアクセス ポリシーを作成します。 |
bigquery.rowAccessPolicies.delete |
テーブルから行レベルのアクセス ポリシーを削除します。 |
bigquery.rowAccessPolicies.getFilteredData |
テーブルから、行レベルアクセス ポリシーの権限付与者リストにあるプリンシパルにのみ表示するデータを取得します。この権限は、行レベルのアクセス ポリシーにのみ付与することをおすすめします。 |
bigquery.rowAccessPolicies.list |
テーブルのすべての行レベルのアクセス ポリシーを表示します。 |
bigquery.rowAccessPolicies.overrideTimeTravelRestrictions |
行レベルのアクセス ポリシーがある、または以前に存在していたテーブルの過去のデータにアクセスします。 |
bigquery.rowAccessPolicies.getIamPolicy |
行アクセス ポリシーの IAM 権限を取得します。 |
bigquery.rowAccessPolicies.setIamPolicy |
行アクセス ポリシーの IAM 権限を設定します。 |
bigquery.rowAccessPolicies.update |
行レベルのアクセス ポリシーを再作成します。 |
bigquery.routines.create |
新しいルーティン(関数とストアド プロシージャ)を作成します。 |
bigquery.routines.delete |
ルーティンを削除します。 |
bigquery.routines.get |
ルーティンの定義とメタデータを取得します。 |
bigquery.routines.list |
ルーティンおよびルーティンのメタデータを一覧表示します。 |
bigquery.routines.update |
ルーティンの定義とメタデータを更新します。 |
bigquery.routines.updateTag |
ルーティンのタグを更新します。 |
bigquery.savedqueries.create |
保存したクエリを作成します。 |
bigquery.savedqueries.delete |
保存したクエリを削除します。 |
bigquery.savedqueries.get |
保存したクエリのメタデータを取得します。 |
bigquery.savedqueries.list |
保存したクエリの一覧を表示します。 |
bigquery.savedqueries.update |
保存したクエリを更新します。 |
bigquery.tables.create |
新しいテーブルを作成します。 |
bigquery.tables.createIndex |
テーブルに検索インデックスを作成します。 |
bigquery.tables.createSnapshot
|
新しいテーブル スナップショットを作成します。 |
bigquery.tables.delete |
テーブルを削除します。 |
bigquery.tables.deleteIndex |
検索インデックスをテーブルから削除します。 |
bigquery.tables.deleteSnapshot
|
テーブル スナップショットを削除します。 |
bigquery.tables.export |
BigQuery からテーブルのデータをエクスポートします。 |
bigquery.tables.get |
テーブルのメタデータを取得します。 テーブルのデータを取得するには、 bigquery.tables.getData が必要です。 |
bigquery.tables.getData |
テーブルのデータを取得します。この権限は、テーブルのデータを検索するために必要です。 テーブルのメタデータを取得するには、 bigquery.tables.get が必要です。 |
bigquery.tables.getIamPolicy |
テーブルの IAM ポリシーを読み取ります。 |
bigquery.tables.list |
テーブルとテーブルのメタデータを一覧表示します。 |
bigquery.tables.restoreSnapshot
|
テーブル スナップショットを復元します。 |
bigquery.tables.setCategory |
テーブル スキーマにポリシータグを設定します。 |
bigquery.tables.setIamPolicy |
テーブルの IAM ポリシーを変更します。 |
bigquery.tables.update |
テーブルのメタデータを更新します。 |
bigquery.tables.updateData |
テーブルのデータを更新します。 |
bigquery.tables.updateTag (ベータ版) |
テーブルのタグを更新します。 |
bigquery.transfers.get |
転送のメタデータを取得します。 |
bigquery.transfers.update |
転送を作成、更新、削除します。 |
1 ジョブを作成すると、作成者に、そのジョブの bigquery.jobs.get
権限および bigquery.jobs.update
権限に相当する権限が自動的に付与されます。
BigQuery の IAM 事前定義ロール
次の表に、BigQuery の事前定義された IAM のロールと、各ロールに割り当てられた全権限の一覧を示します。各権限は、それぞれ特定のリソースタイプに適用されます。
Role | Permissions |
---|---|
BigQuery Admin
Provides permissions to manage all resources within the project. Can manage all data within the project, and can cancel jobs from other users running within the project. Lowest-level resources where you can grant this role:
|
|
BigQuery Connection Admin
|
|
BigQuery Connection User
|
|
BigQuery Data Editor
When applied to a table or view, this role provides permissions to:
This role cannot be applied to individual models or routines. When applied to a dataset, this role provides permissions to:
When applied at the project or organization level, this role can also create new datasets. Lowest-level resources where you can grant this role:
|
|
BigQuery Data Owner
When applied to a table or view, this role provides permissions to:
This role cannot be applied to individual models or routines. When applied to a dataset, this role provides permissions to:
When applied at the project or organization level, this role can also create new datasets. Lowest-level resources where you can grant this role:
|
|
BigQuery Data Viewer
When applied to a table or view, this role provides permissions to:
This role cannot be applied to individual models or routines. When applied to a dataset, this role provides permissions to:
When applied at the project or organization level, this role can also enumerate all datasets in the project. Additional roles, however, are necessary to allow the running of jobs. Lowest-level resources where you can grant this role:
|
|
BigQuery Filtered Data Viewer
Access to view filtered table data defined by a row access policy |
|
BigQuery Job User
Provides permissions to run jobs, including queries, within the project. Lowest-level resources where you can grant this role:
|
|
BigQuery Metadata Viewer
When applied to a table or view, this role provides permissions to:
This role cannot be applied to individual models or routines. When applied to a dataset, this role provides permissions to:
When applied at the project or organization level, this role provides permissions to:
Additional roles are necessary to allow the running of jobs. Lowest-level resources where you can grant this role:
|
|
BigQuery Read Session User
Access to create and use read sessions |
|
BigQuery Resource Admin
Administer all BigQuery resources. |
|
BigQuery Resource Editor
Manage all BigQuery resources, but cannot make purchasing decisions. |
|
BigQuery Resource Viewer
View all BigQuery resources but cannot make changes or purchasing decisions. |
|
BigQuery User
When applied to a dataset, this role provides the ability to read the dataset's metadata and list tables in the dataset. When applied to a project, this role also provides the ability to run jobs, including queries,
within the project. A principal with this role can enumerate their own jobs, cancel their own jobs, and
enumerate datasets within a project. Additionally, allows the creation of new datasets within the
project; the creator is granted the BigQuery Data Owner role ( Lowest-level resources where you can grant this role:
|
|
Masked Reader
Beta
Maksed read access to sub-resources tagged by the policy tag associated with a data policy, for example, BigQuery columns |
|
BigQuery のカスタムロール
BigQuery のカスタムの IAM ロールを作成するには、IAM のカスタムロールのドキュメントで説明されている手順を行います。
BigQuery の基本ロール
BigQuery の基本ロールについては、BigQuery の基本ロールと権限をご覧ください。
次のステップ
- BigQuery のアクセス制御の例をご覧ください。
- データセット レベルでロールを割り当てる方法については、データセットへのアクセスの制御をご覧ください。
- テーブルまたはビューレベルでロールを割り当てる方法については、テーブルとビューへのアクセスの制御をご覧ください。