GCP Integration
The GCP integration is an authentication provider — it establishes secure, credential-free access to your GCP project using OIDC Workload Identity Federation. It does not give the agent direct access to any data on its own.
Once configured, other integrations (such as BigQuery or PostgreSQL with Cloud SQL) can link to it to obtain GCP credentials at runtime.
How It Works
- You create a Workload Identity Pool with an OIDC Provider that trusts Autoheal
- You create a Service Account and bind Autoheal's federated identity to it
- At runtime, Autoheal exchanges a short-lived OIDC token for temporary GCP credentials via a two-step token exchange (STS + IAM)
- Those credentials are passed to whichever GCP-powered integration needs them — no static keys are stored anywhere
Prerequisites
- A GCP project with IAM admin permissions
- Security Token Service API and IAM Service Account Credentials API enabled
- Your Autoheal tenant slug (found from your Autoheal URL:
https://{tenant-slug}.autoheal.ai)
The OIDC audience value used throughout this guide follows the pattern {tenant-slug}-oidc-service — for example, acme-corp-oidc-service.
Setup
- gcloud CLI (Recommended)
- GCP Console (UI)
export GCP_PROJECT_ID="my-gcp-project"
export AUTOHEAL_TENANT_SLUG="your-tenant-slug"
gcloud services enable \
sts.googleapis.com \
iamcredentials.googleapis.com \
--project=${GCP_PROJECT_ID}
gcloud iam workload-identity-pools create autoheal-pool \
--project=${GCP_PROJECT_ID} \
--location=global \
--display-name="Autoheal OIDC Federation"
gcloud iam workload-identity-pools providers create-oidc autoheal-provider \
--project=${GCP_PROJECT_ID} \
--location=global \
--workload-identity-pool=autoheal-pool \
--issuer-uri="https://app.autoheal.ai" \
--attribute-mapping="google.subject=assertion.aud[0]" \
--allowed-audiences="${AUTOHEAL_TENANT_SLUG}-oidc-service"
The attribute mapping must use assertion.aud[0] (not assertion.aud). The OIDC token's aud claim is a JSON array, and GCP requires google.subject to be a string. Using aud[0] extracts the first element.
gcloud iam service-accounts create autoheal-sa \
--project=${GCP_PROJECT_ID} \
--display-name="Autoheal Service Account"
PROJECT_NUMBER=$(gcloud projects describe ${GCP_PROJECT_ID} --format="value(projectNumber)")
SA_EMAIL="autoheal-sa@${GCP_PROJECT_ID}.iam.gserviceaccount.com"
gcloud iam service-accounts add-iam-policy-binding ${SA_EMAIL} \
--project=${GCP_PROJECT_ID} \
--role="roles/iam.workloadIdentityUser" \
--member="principal://iam.googleapis.com/projects/${PROJECT_NUMBER}/locations/global/workloadIdentityPools/autoheal-pool/subject/${AUTOHEAL_TENANT_SLUG}-oidc-service"
Copy this — you'll paste it into Autoheal:
echo "projects/${PROJECT_NUMBER}/locations/global/workloadIdentityPools/autoheal-pool/providers/autoheal-provider"
- Go to Integrations → Google Cloud Platform
- Enter a name (e.g., "Production GCP")
- Fill in:
- GCP Project ID: Your project ID
- Workload Identity Pool Provider: The resource name from the previous step
- Service Account Email:
autoheal-sa@{your-project-id}.iam.gserviceaccount.com
- Click Test Connection, then Save
- Open the API Library in your GCP project
- Search for and enable:
- Security Token Service API (
sts.googleapis.com) - IAM Service Account Credentials API (
iamcredentials.googleapis.com)
- Security Token Service API (
- Go to IAM & Admin → Workload Identity Federation
- Click Create Pool
- Enter name:
autoheal-pool, display name:Autoheal OIDC Federation - Click Continue
- Select OpenID Connect (OIDC)
- Enter:
- Provider name:
autoheal-provider - Issuer URL:
https://app.autoheal.ai - Allowed audiences:
{your-tenant-slug}-oidc-service
- Provider name:
- Under Attribute Mapping, set
google.subject=assertion.aud[0] - Click Save
The attribute mapping must use assertion.aud[0]. The aud claim is a JSON array and GCP requires google.subject to be a string.
- Go to IAM & Admin → Service Accounts
- Click Create Service Account
- Enter name:
autoheal-sa, then click Done
Do not grant any roles here — role requirements depend on which integrations you connect later. See the Next Steps section.
- Click the
autoheal-saservice account → Permissions tab → Grant Access - In New principals, enter:
Replace
principal://iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/autoheal-pool/subject/{your-tenant-slug}-oidc-servicePROJECT_NUMBERwith your numeric project number (found on the Dashboard). - Select role: Workload Identity User (
roles/iam.workloadIdentityUser) - Click Save
- Go to Workload Identity Federation
- Click your pool → click the provider
- Copy the Resource name (format:
projects/123456789/locations/global/workloadIdentityPools/autoheal-pool/providers/autoheal-provider)
- Go to Integrations → Google Cloud Platform
- Enter a name (e.g., "Production GCP")
- Fill in:
- GCP Project ID: Your project ID
- Workload Identity Pool Provider: The resource name from the previous step
- Service Account Email:
autoheal-sa@{your-project-id}.iam.gserviceaccount.com
- Click Test Connection, then Save
Network Requirements
| Direction | From | To | Purpose |
|---|---|---|---|
| GCP → Autoheal | GCP Workload Identity Federation | https://app.autoheal.ai/.well-known/openid-configuration and JWKS endpoint | GCP fetches Autoheal's signing keys to validate the OIDC token |
| Autoheal → GCP | Autoheal platform | sts.googleapis.com | Exchanges OIDC token for a federated access token |
| Autoheal → GCP | Autoheal platform | iamcredentials.googleapis.com | Exchanges federated token for a service account access token |
Security
- No stored credentials: Autoheal never stores GCP service account keys. Tokens are short-lived and expire automatically.
- Tenant isolation: Each Autoheal tenant has a unique OIDC identity — one tenant cannot access another tenant's GCP resources.
- Revocable: Remove the Workload Identity User binding at any time to immediately revoke Autoheal access.
Troubleshooting
Test Connection fails with 'permission denied'
- Verify the Service Account has the
roles/iam.workloadIdentityUserbinding for Autoheal's federated identity - Check that the
subjectin the binding matches your tenant's audience value ({your-tenant-slug}-oidc-service) - Ensure the Workload Identity Pool Provider resource name uses the project number (not project ID)
'google.subject must be of type STRING' error
The OIDC provider's attribute mapping is using assertion.aud instead of assertion.aud[0]. Fix it:
gcloud iam workload-identity-pools providers update-oidc autoheal-provider \
--project=YOUR_PROJECT_ID \
--location=global \
--workload-identity-pool=autoheal-pool \
--attribute-mapping="google.subject=assertion.aud[0]"
How to revoke Autoheal access
export GCP_PROJECT_ID="your-project-id"
export AUTOHEAL_TENANT_SLUG="your-tenant-slug"
SA_EMAIL="autoheal-sa@${GCP_PROJECT_ID}.iam.gserviceaccount.com"
PROJECT_NUMBER=$(gcloud projects describe ${GCP_PROJECT_ID} --format="value(projectNumber)")
gcloud iam service-accounts remove-iam-policy-binding ${SA_EMAIL} \
--project=${GCP_PROJECT_ID} \
--role="roles/iam.workloadIdentityUser" \
--member="principal://iam.googleapis.com/projects/${PROJECT_NUMBER}/locations/global/workloadIdentityPools/autoheal-pool/subject/${AUTOHEAL_TENANT_SLUG}-oidc-service"
Next Steps
Once your GCP integration is configured, connect the GCP-powered integrations you need. Each one links to this GCP integration for authentication and has its own setup guide covering the additional permissions required:
- BigQuery — Query BigQuery datasets during investigations
- PostgreSQL (Cloud SQL) — Query Cloud SQL for PostgreSQL databases