Stay organized with collectionsSave and categorize content based on your preferences.
This page describes how you can manage the dry run configuration for your
service perimeters. For information about managing service
perimeters generally, seeManaging service perimeters.
Get the name of your policy.The policy name is required
for commands using thegcloudcommand-line tool and making API calls. If you set a default
access policy, you do not need to specify the policy for thegcloudcommand-line tool.
Enforcing a dry run configuration
When you're satisfied with the dry run configuration for a service perimeter,
you can enforce that configuration. When a dry run configuration is enforced,
it replaces the current enforced configuration for a perimeter, if one exists.
If an enforced version of the perimeter doesn't exist, the dry run configuration
is used as the initial enforced configuration for the perimeter.
After you update a service perimeter, it may take up to 30 minutes for the
changes to propagate and take effect. During this time, the perimeter might block
requests with the following error message:Error 403: Request is prohibited by organization's policy.
Console
In the Google Cloud console navigation menu, clickSecurity, and then
clickVPC Service Controls.
On theVPC Service Controlspage, clickDry run mode.
In the list of service perimeters, click the name of the service
perimeter that you want to enforce.
On theService perimeter detailspage, clickEnforce config.
When you are asked to confirm that you want to overwrite your existing
enforced configuration, clickConfirm.
gcloud
You can use thegcloudcommand-line tool to enforce the dry configuration for an individual
perimeter, as well as for all of your perimeters simultaneously.
Enforce one dry run configuration
To enforce the dry run configuration for asingleperimeter, use thedry-run enforcecommand:
PERIMETER_NAMEis the name of the service perimeter that you
want to obtain details about.
ETAGis a string that represents the target
version of your organization's access policy. If you do not include an
etag, theenforce-alloperation targets the latest version of the your
organization's access policy.
When you update a dry run configuration, you can modify the list of services,
projects, and VPC accessible services, among other features of the perimeter.
After you update a service perimeter, it may take up to 30 minutes for the
changes to propagate and take effect. During this time, the perimeter might block
requests with the following error message:Error 403: Request is prohibited by organization's policy.
Console
In the Google Cloud console navigation menu, clickSecurity, and then
clickVPC Service Controls.
PERIMETER_NAMEis the name of the service perimeter that you
want to obtain details about.
RESOURCESis a comma-separated list of one or more project
numbers or VPC network names. For example:projects/12345or//compute.googleapis.com/projects/my-project/global/networks/vpc1.
Only projects and VPC networks are allowed. Project format:projects/<project_number>.
VPC format://compute.googleapis.com/projects/<project-id>/global/networks/<network_name>.
POLICY_NAMEis the name of your organization's access policy.
This value is required only if you haven't set adefault access policy.
To update the list of restricted services, use thedry-run updatecommand
and specify the services to add as a comma-delimited list:
PERIMETER_NAMEis the name of the service perimeter that you
want to obtain details about.
SERVICESis a comma-delimited list of one or more services.
For example:storage.googleapis.comorstorage.googleapis.com,bigquery.googleapis.com.
POLICY_NAMEis the name of your organization's access policy.
This value is required only if you haven't set adefault access policy.
Identifying blocked requests
After you have created a dry run configuration, you can review logs to identify where the dry run configuration would deny access to services if enforced.
Console
In the Google Cloud console navigation menu, clickLogging, and then
clickLogs Explorer.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Manage dry run configurations\n\nThis page describes how you can manage the dry run configuration for your\nservice perimeters. For information about managing service\nperimeters generally, see [Managing service perimeters](/vpc-service-controls/docs/manage-service-perimeters).\n\nBefore you begin\n----------------\n\n- Read [Overview of VPC Service Controls](/vpc-service-controls/docs/overview)\n\n- Read [Dry run mode](/vpc-service-controls/docs/dry-run-mode)\n\n- [Set your default access policy](/access-context-manager/docs/manage-access-policy#set-default) for using the `gcloud` command-line tool.\n\n *-or-*\n\n [Get the name of your policy.](/access-context-manager/docs/manage-access-policy#get_the_name_of_an_access_policy) The policy name is required\n for commands using the `gcloud` command-line tool and making API calls. If you set a default\n access policy, you do not need to specify the policy for the `gcloud` command-line tool.\n\nEnforcing a dry run configuration\n---------------------------------\n\nWhen you're satisfied with the dry run configuration for a service perimeter,\nyou can enforce that configuration. When a dry run configuration is enforced,\nit replaces the current enforced configuration for a perimeter, if one exists.\nIf an enforced version of the perimeter doesn't exist, the dry run configuration\nis used as the initial enforced configuration for the perimeter.\n| **Note:** You can only enforce a dry run configuration that has been modified. If the dry run configuration has not been changed, you cannot enforce it. In the Google Cloud console, if the dry run configuration has not been modified, the **Enforce** button will not be visible on the **VPC Service Perimeter Detail** page.\n\n\nAfter you update a service perimeter, it may take up to 30 minutes for the\nchanges to propagate and take effect. During this time, the perimeter might block\nrequests with the following error message: `Error 403: Request is prohibited by organization's policy.` \n\n### Console\n\n1. In the Google Cloud console navigation menu, click **Security** , and then\n click **VPC Service Controls**.\n\n [Go to the VPC Service Controls page](https://console.cloud.google.com/security/service-perimeter)\n2. On the **VPC Service Controls** page, click **Dry run mode**.\n\n3. In the list of service perimeters, click the name of the service\n perimeter that you want to enforce.\n\n4. On the **Service perimeter details** page, click **Enforce config**.\n\n5. When you are asked to confirm that you want to overwrite your existing\n enforced configuration, click **Confirm**.\n\n### gcloud\n\nYou can use the `gcloud` command-line tool to enforce the dry configuration for an individual\nperimeter, as well as for all of your perimeters simultaneously.\n\n**Enforce one dry run configuration**\n\nTo enforce the dry run configuration for a *single* perimeter, use the\n`dry-run enforce` command: \n\n gcloud access-context-manager perimeters dry-run enforce \u003cvar translate=\"no\"\u003ePERIMETER_NAME\u003c/var\u003e \\\n [--policy=\u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e]\n\nWhere:\n\n- \u003cvar translate=\"no\"\u003ePERIMETER_NAME\u003c/var\u003e is the name of the service perimeter that you\n want to obtain details about.\n\n- \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e is the name of your organization's access policy.\n This value is required only if you haven't set a\n [default access policy](/access-context-manager/docs/manage-access-policy#set-default).\n\n**Enforce all dry run configurations**\n\nTo enforce the dry run configuration for *all* of your perimeters, use the\n`dry-run enforce-all` command: \n\n gcloud access-context-manager perimeters dry-run enforce-all \\\n [--etag=\u003cvar translate=\"no\"\u003eETAG\u003c/var\u003e]\n [--policy=\u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e]\n\nWhere:\n\n- \u003cvar translate=\"no\"\u003ePERIMETER_NAME\u003c/var\u003e is the name of the service perimeter that you\n want to obtain details about.\n\n- \u003cvar translate=\"no\"\u003eETAG\u003c/var\u003e is a string that represents the target\n version of your organization's access policy. If you do not include an\n etag, the `enforce-all` operation targets the latest version of the your\n organization's access policy.\n\n To obtain the latest etag of your access policy,\n [`list` your access policies](/access-context-manager/docs/manage-access-policy#get_the_name_of_an_access_policy).\n- \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e is the name of your organization's access policy.\n This value is required only if you haven't set a\n [default access policy](/access-context-manager/docs/manage-access-policy#set-default).\n\n### API\n\nTo enforce the dry run configuration for *all* of\nyour perimeters, call [`accessPolicies.servicePerimeters.commit`](/access-context-manager/docs/reference/rest/v1/accessPolicies.servicePerimeters/commit).\n\nUpdating a dry run configuration\n--------------------------------\n\nWhen you update a dry run configuration, you can modify the list of services,\nprojects, and VPC accessible services, among other features of the perimeter.\n\n\nAfter you update a service perimeter, it may take up to 30 minutes for the\nchanges to propagate and take effect. During this time, the perimeter might block\nrequests with the following error message: `Error 403: Request is prohibited by organization's policy.` \n\n### Console\n\n1. In the Google Cloud console navigation menu, click **Security** , and then\n click **VPC Service Controls**.\n\n [Go to the VPC Service Controls page](https://console.cloud.google.com/security/service-perimeter)\n2. On the **VPC Service Controls** page, click **Dry run mode**.\n\n3. In the list of service perimeters, click the name of the service\n perimeter that you want to edit.\n\n4. On the **Service perimeter details** page, click **Edit**.\n\n5. On the **Edit service perimeter** page, make changes to the dry\n run configuration of the service perimeter.\n\n6. Click **Save**.\n\n### gcloud\n\nTo add new projects to a perimeter, use the `dry-run update` command and\nspecify the resources to add: \n\n gcloud access-context-manager perimeters dry-run update \u003cvar translate=\"no\"\u003ePERIMETER_NAME\u003c/var\u003e \\\n --add-resources=\u003cvar translate=\"no\"\u003eRESOURCES\u003c/var\u003e \\\n [--policy=\u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e]\n\nWhere:\n\n- \u003cvar translate=\"no\"\u003ePERIMETER_NAME\u003c/var\u003e is the name of the service perimeter that you\n want to obtain details about.\n\n- \u003cvar translate=\"no\"\u003eRESOURCES\u003c/var\u003e is a comma-separated list of one or more project\n numbers or VPC network names. For example: `projects/12345` or\n `//compute.googleapis.com/projects/my-project/global/networks/vpc1`.\n Only projects and VPC networks are allowed. Project format: `projects/\u003cproject_number\u003e`.\n VPC format: `//compute.googleapis.com/projects/\u003cproject-id\u003e/global/networks/\u003cnetwork_name\u003e`.\n\n- \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e is the name of your organization's access policy.\n This value is required only if you haven't set a\n [default access policy](/access-context-manager/docs/manage-access-policy#set-default).\n\nTo update the list of restricted services, use the `dry-run update` command\nand specify the services to add as a comma-delimited list: \n\n gcloud access-context-manager perimeters dry-run update \u003cvar translate=\"no\"\u003ePERIMETER_ID\u003c/var\u003e \\\n --add-restricted-services=\u003cvar translate=\"no\"\u003eSERVICES\u003c/var\u003e \\\n [--policy=\u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e]\n\nWhere:\n\n- \u003cvar translate=\"no\"\u003ePERIMETER_NAME\u003c/var\u003e is the name of the service perimeter that you\n want to obtain details about.\n\n- \u003cvar translate=\"no\"\u003eSERVICES\u003c/var\u003e is a comma-delimited list of one or more services.\n For example: `storage.googleapis.com` or\n `storage.googleapis.com,bigquery.googleapis.com`.\n\n- \u003cvar translate=\"no\"\u003ePOLICY_NAME\u003c/var\u003e is the name of your organization's access policy.\n This value is required only if you haven't set a\n [default access policy](/access-context-manager/docs/manage-access-policy#set-default).\n\nIdentifying blocked requests\n----------------------------\n\nAfter you have created a dry run configuration, you can review logs to identify where the dry run configuration would deny access to services if enforced. \n\n### Console\n\n1. In the Google Cloud console navigation menu, click **Logging** , and then\n click **Logs Explorer**.\n\n [Go to Logs Explorer](https://console.cloud.google.com/logs/query)\n2. In the **Query** field, input a query filter like the following filter,\n and then click **Run query**.\n\n log_id(\"cloudaudit.googleapis.com/policy\") AND severity=\"error\" AND protoPayload.metadata.dryRun=\"true\"\n\n3. View the logs under **Query results**.\n\n### gcloud\n\nTo view logs using gcloud CLI, run a command like the following: \n\n gcloud logging read 'log_id(\"cloudaudit.googleapis.com/policy\") AND severity=\"error\" AND protoPayload.metadata.dryRun=\"true\"'"]]