BigQuery access for all authenticated users

Granting BigQuery access to allAuthenticatedUsers can expose data to authenticated users outside your organization. Limit access to the identities and roles that are needed.

Description

allAuthenticatedUsers includes users signed in with Google Accounts, including personal Gmail accounts, and service accounts outside your organization. It excludes anonymous users. The dataset role determines what this group can do.

Potential impact

Read access can let outside users copy data. A broader role can allow changes to data or permissions. Replacing the entire access list can also remove access that applications need.

Remediation

For an internal dataset, inspect existing access entries, dataset IAM and inherited permissions. Keep required users, groups and service accounts with the minimum roles they need, and explicitly revoke any unnecessary public grant. In google.cloud 1.14.0, omitting or emptying access does not explicitly revoke existing grants. Read back the policy and test both approved and unapproved access.

Examples

Authenticated-users group entry

yaml
---
- name: create a dataset
  google.cloud.gcp_bigquery_dataset:
    name: my_example_dataset
    access:
      - special_group: allAuthenticatedUsers
    dataset_reference:
      dataset_id: my_example_dataset
    project: test_project
    auth_kind: serviceaccount
    service_account_file: "/tmp/auth.pem"
    state: present

Default access for a new dataset

yaml
- name: create a dataset
  google.cloud.gcp_bigquery_dataset:
    name: my_example_dataset
    dataset_reference:
      dataset_id: my_example_dataset
    project: test_project
    auth_kind: serviceaccount
    service_account_file: /tmp/auth.pem
    state: present

Explanation:

  • Authenticated-users group entry: The entry sets special_group: allAuthenticatedUsers but omits its role, so it is incomplete.
  • Default access for a new dataset: On creation, omitting access gives default access to projectOwners, projectWriters, projectReaders and the dataset creator. Check those permissions against your needs. Supply the actual project and replace /tmp/auth.pem with the path to your service account JSON credential file.

References