Skip to main content

GCP

Adding a GCP project forwards its audit log events, and your organization's Security Command Center findings, to Cloud Defense. Both appear under Events, and alert rules can act on them. Setup is two Terraform templates that you apply yourself; Cloud Defense creates no role or identity in your organization.

Before you start

PrerequisiteWhy it's neededWhere to check
The GCP project IDIt identifies the project in Cloud DefenseGoogle Cloud console, project selector
A Cloud Defense API keyThe templates use it to authorize the events they push to Cloud DefenseAPI Keys: create one and copy it before you start
Your GCP organization ID, the first time you set up a project in an organizationThe organization template forwards Security Command Center findings for the whole organizationGoogle Cloud console, organization settings
Terraform, signed in to Google Cloud with permission to enable APIs and create Pub/Sub topics and subscriptions in the project, and, for the organization template, to create a service account and grant it Security Command Center notification permissions on the organizationThe templates create these resourcesYour IAM roles in the project and organization

Set up a GCP account

  1. In Cloud Defense, go to Settings > Cloud Accounts and click Add Cloud Account. Cloud Accounts under the settings menu
  2. Cloud Provider: GCP. Enter the GCP Project ID, a name, a project, and the Account Environment. Cloud Defense Access is Read Only for GCP. Click Continue to Provisioning. The add account form
  3. On the Provision page, apply the organization template once per organization: download it, copy its tfvars, fill in your organization ID and the API key, and apply it against the organization. Skip this step if you already did it for another project in the same organization. The Provision page
  4. Apply the project template: download it, copy its tfvars, add the API key, and apply it against the project.

The Provision page doesn't show a provisioned status for GCP accounts. Events arriving under Events are the confirmation.

What the templates create

TemplateResourcesPurpose
Organization, onceEnables the Pub/Sub and Security Command Center APIs; a Pub/Sub topic with a push subscription to Cloud Defense; a service account allowed to manage notification configs; a Security Command Center notification config that publishes to the topicForwards every new finding in the organization to Cloud Defense
Project, per projectEnables the Pub/Sub API; a Pub/Sub topic, a log sink from the project's audit logs to it, and a push subscription to Cloud DefenseForwards the project's audit log events to Cloud Defense

Both push subscriptions deliver to the Cloud Defense API with your API key. You own everything the templates create and can remove it with Terraform at any time.

Verify it landed

What to checkWhere to look
Events are arrivingEvents, with the Account filter set to the GCP project. The list may be empty right after setup; make a change in the project, click Refresh, and expand an event for its details
Findings are arrivingThe same list, once Security Command Center reports a finding in the organization
AlertsAlert rules apply to these events like any other. The example below is one delivered to Slack

An alert for a GCP event delivered to Slack