Prerequisites
- Organization Admin role in Kestrel
- A GCP project where you can create service accounts and grant IAM roles
gcloudCLI, authenticated against that project- Optional: a BigQuery billing export if you want the cost and FinOps triggers
Setup
1
Start the connection
- Navigate to Integrations → Cloud in your Kestrel dashboard
- Open the GCP tab and click Connect GCP Project
- Enter your Project ID and pick a default region
- Click Generate Setup Script
2
Run the setup script
Kestrel generates a The script prints the service account email and the Workload Identity provider resource name when it finishes.
gcloud script scoped to the project you entered. It creates a Workload Identity Pool and provider, creates a service account for Kestrel to impersonate, and grants that service account the roles listed below.Run it in Cloud Shell or any terminal with gcloud authenticated:3
Verify the connection
- Paste the service account email and Workload Identity provider into the Kestrel verification dialog
- Click Verify Connection
Kestrel never asks for a service account key. Access is brokered through Workload Identity Federation, so there is no long-lived credential to store, rotate, or leak. Revoking the
roles/iam.serviceAccountTokenCreator binding on the service account immediately cuts off Kestrel’s access.Billing export (optional)
The cost triggers and the Cost Explorer style blocks read from a BigQuery billing export, because GCP does not expose detailed cost data through a general-purpose API.- Set up a detailed usage cost export in your billing account
- In Kestrel, open the connected project and set the Billing export table to the fully-qualified table, for example
my-project.billing.gcp_billing_export_resource_v1_XXXXXX
Security Command Center (optional)
The Security Command Center Finding trigger reads findings at the organization level, which project-level roles cannot grant. To use it, grant the Kestrel service accountroles/securitycenter.findingsViewer on your organization rather than the project. The setup script prints the exact command. Every other security trigger works with project-level access alone.
How It’s Used
In Workflows
Trigger blocks: Cost and FinOps:- Cost Anomaly Detected — fires when spend for a service deviates from its recent baseline
- Budget Threshold Exceeded — fires when a budget’s month-to-date spend crosses a percentage of its amount
- Cost Forecast Overrun — fires when the projected month-end spend exceeds the budget, before the overrun happens
- Daily Spend Spike — fires when daily spend rises beyond a configurable percentage over the trailing baseline
- Idle Resource Detected — fires when a scan finds idle VMs, unattached disks, unused static IPs, or stale snapshots
- Instance Preempted — fires when a Spot or preemptible VM is reclaimed
- Instance Terminated Abnormally — fires when a VM stops for a reason other than a normal shutdown
- Instance Group Unhealthy — fires when a managed instance group has unhealthy instances beyond a threshold
- GKE Node Pool Degraded — fires when a node pool stays degraded past a dwell time, so routine upgrades stay quiet
- Cloud Run Revision Failed — fires when a new Cloud Run revision fails to become ready
- Cloud Monitoring Alert Fired — fires when a Cloud Monitoring alert policy opens an incident
- Log Error Pattern Matched — fires when a Cloud Logging filter matches more than a threshold number of entries
- Cloud Build Failed — fires when a build fails
- Security Command Center Finding — fires on new SCC findings, filterable by category and severity
- Privileged IAM Grant — fires when a privileged role is granted on the project
- Service Account Key Aged — fires when a user-managed service account key passes a maximum age
- Public Storage Bucket Detected — fires when a bucket becomes publicly readable
- Public IAM Binding Detected — fires when
allUsersorallAuthenticatedUsersis bound to a resource
- BigQuery Job Failed — fires when a BigQuery job fails
- Expensive BigQuery Query — fires when a query scans more than a configurable number of gigabytes
- Cloud SQL Instance Unhealthy — fires when a Cloud SQL instance reports an unhealthy state
- Pub/Sub Backlog Growing — fires when undelivered messages on a subscription exceed a threshold
- Dataflow Job Failed — fires when a Dataflow job fails
GCP does not offer tenant-wide outbound webhooks for these services, so all GCP triggers are poll-based. Cadence defaults differ by family: operations events poll every few minutes, while cost events poll hourly because they query your billing export.
- Cost insights (read-only): Query Billing Data, Get Cost Anomalies, Get Cost Forecast, Get Budget Status, Get Rightsizing Recommendations, Get Committed Use Discount Recommendations, Get Committed Use Discount Utilization, Compare Cost Periods, Find Idle Resources
- Cost remediation: Stop Compute Instances, Delete Unattached Disks, Release Static IP Addresses, Delete Old Snapshots, Downsize Compute Instance
- Compute and operations: Get Instance, Start Instance, Reset Instance, Get Instance Group Health, Resize Instance Group, Recreate Instance Group Members, List GKE Node Pools, Resize GKE Node Pool, Set GKE Node Pool Autoscaling, Get Cloud Run Service, Rollback Cloud Run Service, Set Cloud Run Traffic Split, Query Cloud Monitoring Metrics, Query Cloud Logging, Retry Cloud Build, Investigate (AI)
- Security: List Security Findings, Audit IAM Policy, Audit Service Account Keys, Find Public Buckets, Delete Service Account Key, Disable Service Account, Remove IAM Binding, Remove Public Bucket Access, Quarantine Instance
- Data: Run BigQuery Query, List BigQuery Jobs, Cancel BigQuery Job, List Cloud SQL Instances, Get Cloud SQL Instance, Restart Cloud SQL Instance, Fail Over Cloud SQL Instance, List Pub/Sub Subscriptions, Purge Pub/Sub Subscription, Replay Pub/Sub Subscription, List Dataflow Jobs, Stop Dataflow Job
kestrel-protected.
Example: a workflow triggers on Cloud Run Revision Failed, reads the service to find the last revision that became ready, posts the failure reason to Slack, waits for approval, then rolls traffic back to that revision.
In Cloud AI Copilot
- Ask questions about your GCP resources:
Which Cloud SQL instances are not highly available? - Investigate spend:
What drove the increase in BigQuery costs last week? - Investigate findings:
Show me buckets with public access in the prod project
IAM Permissions
The setup script grants the Kestrel service account these roles on the project: Read-only:roles/viewer— resource inventory across servicesroles/billing.viewer,roles/bigquery.dataViewer,roles/bigquery.jobUser— budgets and billing export queriesroles/recommender.viewer— rightsizing and commitment recommendationsroles/monitoring.viewer,roles/logging.viewer— metrics, alert policies, and log queriesroles/securitycenter.findingsViewer— Security Command Center findingsroles/iam.serviceAccountViewer— service account and key metadata
roles/compute.instanceAdmin.v1,roles/compute.storageAdmin,roles/compute.networkAdmin— instance lifecycle, disk and snapshot cleanup, static IP release, network tags for quarantineroles/container.developer— node pool resizeroles/run.developer— Cloud Run traffic and rollbackroles/cloudbuild.builds.editor— build retryroles/cloudsql.admin— Cloud SQL restart and failoverroles/pubsub.admin— subscription seek and purgeroles/dataflow.admin— Dataflow job cancel and drainroles/storage.admin— removing public bucket accessroles/resourcemanager.projectIamAdmin,roles/iam.serviceAccountAdmin,roles/iam.serviceAccountKeyAdmin— removing IAM bindings and deleting stale keys
If you connected a project before a new block family shipped, Kestrel detects that your grant predates the current role set and prompts you to re-run the setup script. Re-running is safe and idempotent.
Managing Connections
- Verify: Re-checks impersonation and permissions, and refreshes the connection status
- Billing export: Set or change the BigQuery billing export table at any time
- Delete: Removes the connection from Kestrel. The Workload Identity Pool, service account, and role bindings remain in GCP; delete them there if you want the access fully removed.