More Info:

Ensure that “Google Cloud Platform - Resource Location Restriction” constraint policy is enforced for your GCP organizations.

Risk Level

Medium

Address

Operational Maturity, Reliability, Security

Compliance Standards

CBP

Triage and Remediation

Remediation

To restrict the creation of cloud resources to specific locations in GCP, you can follow these steps:

  1. Open the GCP console and navigate to the IAM & admin page.
  2. Select the project for which you want to restrict the creation of cloud resources.
  3. Click on the “Edit” button next to the “Service Accounts” section.
  4. Locate the service account that you want to restrict and click on the “Edit” button next to it.
  5. Scroll down to the “Service Account Permissions” section and click on the “Add Another” button.
  6. In the “Add Permission” dialog box, select “Cloud Resource Manager API” from the “Select a service” dropdown menu.
  7. In the “Select a role” dropdown menu, select “Cloud Resource Manager Editor” or “Cloud Resource Manager Viewer” depending on the level of access you want to grant.
  8. In the “Select a resource” dropdown menu, select “All resources in the selected project”.
  9. In the “Condition” section, click on the “Add Condition” button.
  10. In the “Add Condition” dialog box, select “Location” from the “Attribute” dropdown menu.
  11. In the “Operator” dropdown menu, select “is not one of”.
  12. In the “Value” field, enter the list of allowed locations separated by commas (e.g. us-central1, us-west1, europe-west1).
  13. Click on the “Save” button to save the changes.

By following these steps, you have restricted the creation of cloud resources to specific locations in GCP. Any attempt to create resources outside of the allowed locations will be denied.