Why Service Account Impersonation?
Service Account Impersonation provides several key security and operational benefits:- No persistent credentials - No service account keys to manage or rotate
- Least-privilege access - Fine-grained permissions with full audit trail
- Seamless billing - Jobs run in your GCP project with transparent cost tracking
- Enhanced security - Eliminates credential exposure risks
Architecture Overview
The integration follows Google Cloud’s recommended security practices:| Component | Description |
|---|---|
| Openlayer Service Account | impersonator@unbox-ai.iam.gserviceaccount.com |
| Customer Service Account | Created in your GCP project (e.g., openlayer-bigquery@your-project.iam.gserviceaccount.com) |
| Billing Project | Your GCP project where BigQuery job costs are billed |
Setup Guide
Step 1: Create a Service Account
Create a dedicated service account in your GCP project for Openlayer to use:Step 2: Grant Required Permissions
Grant the necessary BigQuery permissions to your service account:Step 3: Enable Service Account Impersonation
Allow Openlayer’s service account to impersonate your service account:Step 4: Configure Openlayer
Connect to BigQuery Data Source
In your Openlayer workspace, navigate to the data sources section and select BigQuery as your data source:
Configure BigQuery Connection
Fulfill the required connection details:
- BigQuery Target Principal: Your service account email (e.g.,
openlayer-bigquery@your-project-id.iam.gserviceaccount.com) - BigQuery Billing Project: Your GCP project ID (where costs will be billed)
- Name: A descriptive name for this data source connection
Your service account email should follow the format:
SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.comConfigure BigQuery Table
After creating the BigQuery connection, configure the specific table you want to monitor:
- BigQuery Project: Write the project name or select it from the dropdown list
- BigQuery Dataset: Write the dataset name or select it from the dropdown list
- BigQuery Table: Write the table name you want to monitor
- Data Source Name: A descriptive name for this data source
- Class Names: Select the columns that contain class labels or prediction outputs
- Feature Names: Select the columns that represent input features for your ML model
- Categorical Feature Names: Select columns that contain categorical data
Troubleshooting
Permission Errors
If you encounter permission errors:Error:
User does not have permission to access BigQuery Solution:
Verify that both bigquery.jobUser and bigquery.dataViewer roles are
granted to your service account.Impersonation Failures
If service account impersonation fails:Error:
Failed to impersonate service account Solution: Ensure the
iam.serviceAccountTokenCreator role is granted to Openlayer’s service
account on your service account.
