Cloud Armor Enterprise: Deny List with Address Group
This guide explains how to use Address Groups in Google Cloud Armor Enterprise to manage a centralized IP deny list, reusable across multiple security policies.Requirements
Cloud Armor Enterprise
The GCP project must be enrolled in the Enterprise tier. On downgrade, security policies referencing address groups become read-only until those rules are removed.
Terraform Provider
The
google_network_security_address_group resource requires the google-beta provider. Make sure it is configured in your Terraform setup.Required IAM Permissions for the Service Account
The service account used by Terraform must have the following roles:| Role | Description |
|---|---|
roles/compute.securityAdmin | Create and manage Cloud Armor security policies |
roles/compute.networkAdmin | Create and manage address groups |
roles/iam.serviceAccountUser | Required if the SA needs to impersonate other accounts |
Address Group Limits & Quota
purpose configuration | Maximum capacity |
|---|---|
CLOUD_ARMOR only | Up to 10,000+ IPs (requestable via quota increase) |
DEFAULT + CLOUD_ARMOR | Maximum 1,000 IPs |
To increase quota limits, the service account needs the
serviceusage.quotas.update permission, included in the Owner, Editor, and Quota Administrator roles. Requests can be submitted from the GCP Console under IAM & Admin → Quotas.Configuration with Terraform
Step 1 — Configure the google-beta provider
terraform.tf
Step 2 — Create the Address Group
address_group.tf
The
items field can also be managed externally via gcloud or the API, without re-running Terraform every time you add or remove an IP.Step 3 — Create the Security Policy with the deny rule
security_policy.tf
Step 4 — Attach the policy to a backend service
backend.tf
Updating the Deny List Without Terraform
If you need to add or remove IPs dynamically (without going through Terraform), you can usegcloud:
Reusing Across Multiple Security Policies
One of the main advantages of address groups is that the same list can be referenced by multiple security policies simultaneously. This avoids duplication and ensures consistency across your infrastructure:multi_policy.tf
CDN with masked ip x-forwarded-for
multi_policy.tf
Summary
| Aspect | Value |
|---|---|
| Required tier | Cloud Armor Enterprise |
| Terraform resource | google_network_security_address_group |
| Terraform provider | google-beta |
Required purpose field | CLOUD_ARMOR |
| Max capacity (CLOUD_ARMOR only) | 10,000+ (with quota increase) |
| Max capacity (CLOUD_ARMOR + DEFAULT) | 1,000 |
| Capacity editable after creation | No |
| Minimum SA roles | securityAdmin + networkAdmin |
| Update IPs without Terraform | Yes, via gcloud or API |

