Credential vending mode in the Lakehouse runtime catalog lets you delegate Cloud Storage access to query engines and enforce fine-grained Identity and Access Management (IAM) policies at the catalog, namespace, and table levels for Apache Iceberg tables. Instead of granting direct bucket permissions, you configure the Apache Iceberg REST catalog endpoint to vend short-lived, downscoped storage tokens for authorized table paths. This mode is also required for automatic table management.
When to use credential vending
The following are some common use cases:
- Enforce table-level access without bucket-level roles: grant analysts and workloads access to specific Apache Iceberg tables while preventing direct access to underlying Cloud Storage buckets or sibling table directories.
- Centralize access governance across multiple query engines: apply consistent IAM policies across BigQuery, Managed Service for Apache Spark, open-source Apache Spark, and Trino using short-lived, path-scoped tokens.
- Isolate warehouse buckets inside a service perimeter: store table data in Cloud Storage buckets protected by VPC Service Controls while authorizing storage reads and writes through a single catalog endpoint service account.
How credential vending works
When you use credential vending mode, the sequence of operations enforces IAM policies before storage is accessed. The following diagram illustrates how query engines obtain downscoped storage tokens from the Lakehouse runtime catalog to securely read and write data directly in Cloud Storage:
The sequence of operations shown in the preceding diagram is as follows:
- Request: A user submits a SQL statement, such as a query, DML, or DDL operation, to a supported engine, such as Spark or BigQuery.
- Metadata lookup: The engine sends a request to the Lakehouse runtime catalog to resolve the table.
- Authentication and policy: The Lakehouse runtime catalog authenticates the user and checks their IAM permissions on Lakehouse resources.
- Response: Because credential vending mode is enabled, the Lakehouse runtime catalog returns the metadata and a short-lived storage token (downscoped storage credentials) to the engine. The token is scoped to the paths associated with the table and downscoped to the minimum required permissions (for example, read-only access for queries that don't need to write files).
- Access: The engine uses this token to read or write the specific authorized files directly from Cloud Storage.
- Compute: The engine processes the data or executes the operation, and returns the results.
When automatic table
management
(gcp.biglake.table-management.enabled) is enabled, background maintenance
tasks such as compaction, snapshot expiration, and garbage collection use the
catalog's auto-provisioned service account to authenticate directly to
Cloud Storage and update the underlying data files.
Supported engines
To use credential vending with query engines, you must configure the Apache Iceberg REST catalog endpoint in your Lakehouse runtime catalog in credential vending mode. Credential vending isn't supported for Apache Hive catalog endpoints.
- Open-source engines: Supported engines such as
Spark and Trino use short-lived storage tokens vended
by the Lakehouse runtime catalog. Your client application
must specify support for credential vending in the
X-Iceberg-Access-Delegationheader. - BigQuery: BigQuery uses vended credentials for Cloud Storage access instead of end-user credentials.
Required roles
To ensure that the auto-provisioned catalog endpoint service account has the necessary permissions to read and write table data in credential vending mode, ask your administrator to grant the following IAM roles to the auto-provisioned catalog endpoint service account:
-
Read and write table data in Cloud Storage:
Storage Object User (
roles/storage.objectUser) on all associated Cloud Storage buckets
For more information about granting roles, see Manage access to projects, folders, and organizations.
Your administrator might also be able to give the auto-provisioned catalog endpoint service account the required permissions through custom roles or other predefined roles.
To ensure that the service account that runs your query engine jobs has the necessary permissions to obtain vended credentials with write scope, ask your administrator to grant the following IAM roles to the service account that runs your query engine jobs:
-
Obtain vended credentials with write scope from query engine jobs (such as Managed Service for Apache Spark or Dataflow):
BigLake Editor (
roles/biglake.editor) on the catalog, namespace, table, or project
For more information about granting roles, see Manage access to projects, folders, and organizations.
Your administrator might also be able to give the service account that runs your query engine jobs the required permissions through custom roles or other predefined roles.
If you use the Google Cloud console, clicking Set bucket permissions
verifies the Storage Object User role (roles/storage.objectUser) on the
associated buckets. For the Google Cloud CLI, Terraform, or the REST API,
you must grant this role to the auto-provisioned catalog endpoint service
account manually.
Creation of the auto-provisioned catalog endpoint service account is eventually consistent. It takes time for the service account to propagate through the system. If you try to grant roles to the service account immediately after creation, the request might fail. For more information about how long it takes, on average, for access changes to propagate, see Access change propagation.
Credential vending guardrail for FGAC-protected tables
When row-level security or column-level data policies (fine-grained access control, or FGAC) protect an Apache Iceberg table in a catalog that uses credential vending mode, direct Cloud Storage file access bypasses query-time policy evaluation in BigQuery.
To prevent unauthorized data exposure, the Apache Iceberg REST catalog endpoint
returns a 403 Forbidden HTTP status code for credential vending requests on
FGAC-protected tables, unless the calling principal has full access to the
table:
- Unmasked (raw) data access to all protected columns: Every protected
column on the table must also have a
RAW_DATA_ACCESS_POLICYattached. Grant the calling principal theFINE_GRAINED_READprivilege on thatRAW_DATA_ACCESS_POLICYdata policy by using its IAM v2 principal identifier (such asprincipal://iam.googleapis.com/projects/-/serviceAccounts/SA_EMAIL). - Unfiltered row access (all rows): If the table has row-level access
policies attached, grant the calling principal a row-level access policy
that has a
FILTER USING (TRUE)clause.
To configure a service account to read from or write to an FGAC-protected table from open source engines (such as Spark, Trino, or Apache Flink), see Configure open source engine credentials for FGAC-protected tables.
Use VPC Service Controls with credential vending
When you use the Apache Iceberg REST catalog endpoint in credential vending mode with Cloud Storage buckets inside a VPC Service Controls service perimeter, you can support the following use cases:
- Create and modify Apache Iceberg tables in protected buckets: run
CREATE TABLEor DML statements from BigQuery, Managed Service for Apache Spark, Spark, or Trino when warehouse buckets reside inside a service perimeter. - Delegate fine-grained table reads inside a storage perimeter: enforce table-level IAM policies using short-lived, downscoped storage tokens without granting end users or query runtimes direct IAM roles on perimeter-protected buckets.
In credential vending mode, query engines and Lakehouse
authenticate to Cloud Storage using credentials issued for the catalog
endpoint's auto-provisioned service account
(blirc-PROJECT_NUMBER-ID@gcp-sa-biglakerestcatalog.iam.gserviceaccount.com).
Because this service agent belongs to a Google-managed project outside your
service perimeter, Cloud Storage evaluates requests authenticated with
its credentials as perimeter ingress whenever the bucket project's perimeter
restricts storage.googleapis.com. This evaluation applies even when the
catalog endpoint, query job, and bucket are in the same project and service
perimeter.
To allow access, configure an ingress rule in Access Context Manager on the perimeter that protects the bucket project with the following settings:
- Source identity:
serviceAccount:blirc-PROJECT_NUMBER-ID@gcp-sa-biglakerestcatalog.iam.gserviceaccount.com - Target project: The bucket project
(
projects/BUCKET_PROJECT_NUMBER) - Service:
storage.googleapis.comwith all methods ('*'), or specific supported service methods
The following ingress.yaml example allows the catalog endpoint's service
account to access storage.googleapis.com in the bucket project:
- ingressFrom:
identities:
- serviceAccount:CATALOG_ENDPOINT_SERVICE_ACCOUNT
sources:
- accessLevel: '*'
ingressTo:
operations:
- serviceName: storage.googleapis.com
methodSelectors:
- method: '*'
resources:
- projects/BUCKET_PROJECT_NUMBER
Replace the following:
CATALOG_ENDPOINT_SERVICE_ACCOUNT: your catalog endpoint's auto-provisioned service account email address (blirc-PROJECT_NUMBER-ID@gcp-sa-biglakerestcatalog.iam.gserviceaccount.com). To retrieve this email address, describe the catalog endpoint:gcloud biglake iceberg catalogs describe CATALOG_ID \ --project=PROJECT_ID \ --format='value(biglake-service-account)'In this command,
CATALOG_IDis the ID of your catalog endpoint andPROJECT_IDis the ID of the project that contains the catalog endpoint.BUCKET_PROJECT_NUMBER: the numeric project number of the project that contains the Cloud Storage bucket.
If a table creation or query request is blocked by VPC Service Controls, then
the error message includes a vpcServiceControlsUniqueIdentifier value. Search
Policy Denied audit logs in Cloud Audit Logs
by matching protoPayload.metadata.vpcServiceControlsUniqueId to that
identifier, and inspect ingressViolations for the blirc-... principal. For
more information, see
Retrieve VPC Service Controls errors from audit logs.
What's next
- Create a catalog endpoint in credential vending mode.
- Enable credential vending for an existing catalog endpoint.
- Configure your client application for credential vending.
- Configure row-level and column-level security on Apache Iceberg tables.