Allow Event Threat Detection to access VPC Service Controls perimeters Stay organized with collections Save and categorize content based on your preferences.
This document describes how to add ingress rules to allowEvent Threat Detection to monitor logging streams in Security Command Center withinVPC Service Controls perimeters. Perform this taskif your organization uses VPC Service Controls to restrict services in projects thatyou want Event Threat Detection to monitor. For more information aboutEvent Threat Detection, seeEvent Threat Detection overview.
Before you begin
Make sure that you have the following role or roles on the organization: Cloud Asset Service Agent(roles/cloudasset.serviceAgent).
Check for the roles
In the Google Cloud console, go to theIAM page.
Go to IAM- Select the organization.
In thePrincipal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check theRole column to see whether the list of roles includes the required roles.
Grant the roles
In the Google Cloud console, go to theIAM page.
Go to IAM- Select the organization.
- ClickGrant access.
In theNew principals field, enter your user identifier. This is typically the email address for a Google Account.
- ClickSelect a role, then search for the role.
- To grant additional roles, clickAdd another role and add each additional role.
- ClickSave.
Create the ingress rules
To allow Event Threat Detection to monitor logging streams in Security Command Center withinVPC Service Controls perimeters, add the required ingress rules in thoseperimeters. Perform these steps for each perimeter that you want Event Threat Detectionto monitor.
For more information, seeUpdating ingress and egress policies for a service perimeterin the VPC Service Controls documentation.
Console
In the Google Cloud console, go to theVPC Service Controls page.
- Select your organization or project.
In the drop-down list, select the access policy that contains the service perimeter that you want to grant access to.
The service perimeters associated with the access policy appear in the list.
Click the name of the service perimeter that you want to update.
To find the service perimeter you need to modify, you can check your logs for entries that show
RESOURCES_NOT_IN_SAME_SERVICE_PERIMETERviolations. In those entries, check theservicePerimeterNamefield:accessPolicies/ACCESS_POLICY_ID/servicePerimeters/SERVICE_PERIMETER_NAME
- ClickEdit.
- ClickIngress policy.
- ClickAdd an ingress rule.
In theFrom section, set the following details:
- ForIdentities > Identity, selectSelect identities & groups.
- ClickAdd identities.
Enter the email address that identifies theCloud Security Command Center Service Agent. This address has the following format:
service-org-ORGANIZATION_ID@security-center-api.iam.gserviceaccount.com
Replace
ORGANIZATION_IDwith your organization ID.- Select the service agent or pressENTER, and then clickAdd identities.
- ForSources, selectAll sources.
In theTo section, set the following details:
- ForResources > Projects, selectAll projects.
- ForOperations or IAM roles, selectSelect operations.
ClickAdd operations, and then add the following operations:
- Add thecloudasset.googleapis.com service.
- ClickAll methods.
- ClickAdd all methods.
- Add thecloudasset.googleapis.com service.
- ClickSave.
gcloud
If a quota project isn't already set, then set it. Choose a project that has the Access Context Manager API enabled.
gcloudconfigsetbilling/quota_projectQUOTA_PROJECT_IDReplace
QUOTA_PROJECT_IDwith the ID of the project that you want to use for billing and quota.Create a file named
ingress-rule.yamlwith the following contents:-ingressFrom:identities:-serviceAccount:service-org-ORGANIZATION_ID@security-center-api.iam.gserviceaccount.comsources:-accessLevel:'*'ingressTo:operations:-serviceName:cloudasset.googleapis.commethodSelectors:-method:'*'resources:-'*'
Replace
ORGANIZATION_IDwith your organization ID.Add the ingress rule to the perimeter:
gcloudaccess-context-managerperimetersupdatePERIMETER_NAME\--set-ingress-policies=ingress-rule.yaml
Replace the following:
PERIMETER_NAME: the name of the perimeter. For example,accessPolicies/1234567890/servicePerimeters/example_perimeter.To find the service perimeter you need to modify, you can check your logs for entries that show
RESOURCES_NOT_IN_SAME_SERVICE_PERIMETERviolations. In those entries, check theservicePerimeterNamefield:accessPolicies/ACCESS_POLICY_ID/servicePerimeters/SERVICE_PERIMETER_NAME
SeeIngress and egress rules for more information.
What's next
- Learn how to useEvent Threat Detection.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-20 UTC.