Cotool + GCP Pub/Sub Logs
Ingest GCP Cloud Audit Logs, VPC flow, firewall, DNS, and load balancer logs, and Security Command Center findings into Cotool from a dedicated Pub/Sub subscription.
The short answer
The GCP Pub/Sub integration pulls log entries that a Cloud Logging sink publishes to a Pub/Sub topic, or findings a Security Command Center notification config publishes there, and indexes them into Cotool Logs for search and detections.[1]
How it connects: Cotool pulls from a subscription dedicated to it and authenticates with workload identity federation, so no service account key is created or stored. Your provider trusts only Cotool's subject and an audience unique to your Cotool organization.[1][6]
What Cotool uses from GCP Pub/Sub Logs
- Cloud Audit Logs
- Admin Activity, Data Access, System Event, and Policy Denied entries go to
gcp_cloud_audit, mapped into actor, action, service, resource, source IP, outcome, project, and region columns shared with AWS CloudTrail, plus impersonation chains.[1][7] - Security Command Center findings
- Each finding create and update is stored with category, severity, state, affected resource, the principal and API call behind threat findings, and MITRE ATT&CK tactics and techniques.[1][5]
- Network logs
- VPC flow logs, firewall rule logs, Cloud DNS query logs, and load balancer and Cloud Armor logs each get their own table.[1]
Detections, hunts, and triage
- Triage a Security Command Center findingTriage
- Cotool's product page shows a GCP Alert Responder fed by Security Command Center: for a new service account key, it checks for an approved change and records the key's fate.[1][3]
- Detect IAM and key changesDetection
- Python detections run on
gcp_cloud_auditfor actions such as service account key creation or IAM policy changes. Admin Activity audit logs are always written and can't be disabled.[2][7] - Follow an identity across cloudsHunt
- Shared actor, action, and resource columns let one hunt query trace a principal through GCP audit logs and AWS CloudTrail.[1]
Example query
logName:"cloudaudit.googleapis.com%2Factivity"
AND protoPayload.methodName=("SetIamPolicy" OR "google.iam.admin.v1.CreateServiceAccountKey")Cotool's setup accepts any Cloud Logging query as a custom sink filter, such as this one for Admin Activity entries that change IAM policy or create service account keys. The default routes Cloud Audit Logs.[1][4]
Setup and permissions
Cotool generates Terraform or gcloud commands that create the topic, a dedicated subscription with a dead-letter topic, the sink or notification config, and a workload identity pool and OIDC provider that trust https://accounts.google.com only for Cotool's subject and audience.[1][6]
| Permission | Access | Why |
|---|---|---|
roles/pubsub.subscriberGranted to the federated principal on Cotool's subscription only.[1][8] | Read | Granted to the federated principal on Cotool's subscription only.[1][8] |
roles/pubsub.publisherGranted to the sink's writer identity on the topic so Cloud Logging can publish entries to it.[1][4] | Write | Granted to the sink's writer identity on the topic so Cloud Logging can publish entries to it.[1][4] |
How Cotool works with GCP Pub/Sub Logs
- The generated subscription has a 120-second ack deadline and 7-day retention, and the dead-letter topic keeps messages Pub/Sub couldn't deliver after 100 attempts.[1]
- Cotool's default Security Command Center filter sends every finding create and update, because SCC only publishes updates that match the filter.[1]
FAQ
- Does Cotool need a GCP service account key?
- No. Cotool uses workload identity federation, and the provider accepts only Cotool's subject and your organization's audience. If an org policy restricts providers, allow
https://accounts.google.com.[1] - Why are my VPC flow or DNS logs missing?
- VPC flow logs, firewall rule logs, Cloud DNS queries, and load balancer logs are off in GCP until you turn them on per subnet, rule, network, or backend service. Cotool's setup shows the gcloud commands.[1]
Sources
- GCP Pub/Sub Log Ingestion (Cotool docs) · accessed November 16, 2026
- Detections are code (Cotool Detect) · accessed November 16, 2026
- Respond to every signal (Cotool Respond) · accessed November 16, 2026
- Route logs to supported destinations (Cloud Logging docs) · accessed November 16, 2026
- Enable finding notifications for Pub/Sub (Security Command Center docs) · accessed November 16, 2026
- Workload Identity Federation with other identity providers (Google Cloud IAM docs) · accessed November 16, 2026
- Cloud Audit Logs overview (Google Cloud docs) · accessed November 16, 2026
- Access control with IAM (Pub/Sub docs) · accessed November 16, 2026
