Skip to main content

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.

SIEM & Data Lake
Updated

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_audit for 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

A Cloud Logging filter for IAM changestext
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]

PermissionAccess
roles/pubsub.subscriberGranted to the federated principal on Cotool's subscription only.[1][8]Read
roles/pubsub.publisherGranted to the sink's writer identity on the topic so Cloud Logging can publish entries to it.[1][4]Write
  • Except for BigQuery, Data Access audit logs are disabled by default because of their volume. Enable them for the services you want covered.[7]
  • Use a subscription dedicated to Cotool. Cotool acknowledges messages once ingested, so a shared subscription would take them from another SIEM.[1]

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

  1. GCP Pub/Sub Log Ingestion (Cotool docs) · accessed November 16, 2026
  2. Detections are code (Cotool Detect) · accessed November 16, 2026
  3. Respond to every signal (Cotool Respond) · accessed November 16, 2026
  4. Route logs to supported destinations (Cloud Logging docs) · accessed November 16, 2026
  5. Enable finding notifications for Pub/Sub (Security Command Center docs) · accessed November 16, 2026
  6. Workload Identity Federation with other identity providers (Google Cloud IAM docs) · accessed November 16, 2026
  7. Cloud Audit Logs overview (Google Cloud docs) · accessed November 16, 2026
  8. Access control with IAM (Pub/Sub docs) · accessed November 16, 2026

Related integrations

All integrations

Use cases with GCP Pub/Sub Logs

Attackers are scaling with tokens

Cotool helps defenders operate at machine speed. See how security teams are scaling Detection & Response.

Book a demo