An attacker floods an external Application Load Balancer with requests, sends injection and scanner traffic at the application, or aims volumetric traffic at public IP addresses. A typical run starts with a jump in requests per second from many source IPs, then shifts paths and user agents each time you block one. Turn on request logging and attach a Cloud Armor security policy first, because both decide what you can see and stop.
Look here
Log
Search for
Load balancer request log (http_load_balancer). Logging is off for backend services created after logging became generally available, and entries follow the load balancer sampling rate
Top clients in the last 30 minutes. Read httpRequest.requestUrl, httpRequest.userAgent and jsonPayload.statusDetails for the same clients: gcloud logging read 'resource.type="http_load_balancer"' --project=<project> --freshness=30m --limit=5000 --format='value(httpRequest.remoteIp)' | sort | uniq -c | sort -rn | head -20
Cloud Armor fields in the same log
Requests a rule denied. Read enforcedSecurityPolicy.name, priority and configuredAction to see which rule fired. Preview rules appear in jsonPayload.previewSecurityPolicy. Filter: jsonPayload.enforcedSecurityPolicy.outcome="DENY", jsonPayload.statusDetails="denied_by_security_policy"
Rate limiting fields
Rate limit outcomes in jsonPayload.rateLimitAction.outcome, with the client in rateLimitAction.key: RATE_LIMIT_THRESHOLD_CONFORM, RATE_LIMIT_THRESHOLD_EXCEED, BAN_THRESHOLD_EXCEED
Cloud Armor verbose logging
Which part of a request matched a preconfigured web application firewall (WAF) rule, in matchedFieldType, matchedFieldName and matchedFieldValue. These fields exist only after verbose logging is on: gcloud compute security-policies update <policy> --log-level=VERBOSE
Adaptive Protection alerts
Alerts in Cloud Logging under the Network Security Policy resource, with a confidence score, header signatures and a suggested rule. The policy needs --enable-layer7-ddos-defense, and full alerts need Cloud Armor Enterprise. The suggested rule looks like this: evaluateAdaptiveProtection('<alert-id>')
Cloud Armor findings, which appear only for projects in an organization with Security Command Center enabled: Allowed Traffic Spike, Increasing Deny Ratio
Policy and tier state
Policies in the project and the project's Cloud Armor tier, in cloudArmorTier: gcloud compute security-policies list, gcloud compute project-info describe
Backend configuration
Whether each backend has a policy and logging: gcloud compute backend-services describe <backend> --global --format='yaml(securityPolicy,logConfig)'
Contain
#
Item
1
Export the attack window from Cloud Logging before you change rules: gcloud logging copy _Default storage.googleapis.com/<bucket> --location=global --log-filter='resource.type="http_load_balancer"' --project=<project>
2
Enable logging on backends that lack it: gcloud compute backend-services update <backend> --global --enable-logging --logging-sample-rate=1.0
3
Create a policy if the backend has none: gcloud compute security-policies create <policy>
4
Attach the policy to the backend: gcloud compute backend-services update <backend> --security-policy=<policy> --global
5
Block the dominant sources. Add --preview to a broad rule first and check previewSecurityPolicy hits for legitimate clients: gcloud compute security-policies rules create 1000 --security-policy=<policy> --src-ip-ranges="<cidr>" --action=deny-403
Block injection and scanner traffic with a preconfigured rule. Repeat for xss, lfi, rce and scannerdetection as the logs show: gcloud compute security-policies rules create <priority> --security-policy=<policy> --expression="evaluatePreconfiguredWaf('sqli-v422-stable', {'sensitivity': 1})" --action=deny-403
8
Turn on Adaptive Protection. It needs at least one hour of training before it alerts: gcloud compute security-policies update <policy> --enable-layer7-ddos-defense
9
For a volumetric attack on a passthrough load balancer or a VM with a public IP, open a Google Cloud support case in the console and state the project
10
Enroll the project in Cloud Armor Enterprise Annual if it is not enrolled. Confirm the annual commitment with the billing owner first: gcloud compute project-info update --cloud-armor-tier CA_ENTERPRISE_ANNUAL
11
As a last resort, deny by default and allow known clients destructive. Legitimate users without an allow rule lose service: gcloud compute security-policies rules update 2147483647 --security-policy=<policy> --action=deny-403
Eradicate and recover
#
Item
1
List policy changes in the window with the six securityPolicies methods. A change nobody made means a compromised identity, so open the service account key or Google account playbook
2
Move preview rules to enforcement after the logs show no legitimate clients: gcloud compute security-policies rules update <priority> --security-policy=<policy> --no-preview
3
Deploy Adaptive Protection suggested rules in preview mode first, by pasting the evaluateAdaptiveProtection expression into a rule with action deny
4
Remove temporary blocks once the attack ends and no client hits them destructive: gcloud compute security-policies rules delete <priority> --security-policy=<policy>
5
Close the path around the load balancer. Backend VMs with external IPs take traffic directly, so remove the external IPs or cover them with a network edge security policy
6
For passthrough load balancers and public VM IPs, create a regional network policy. Advanced network DDoS protection is Enterprise only: gcloud compute security-policies create <policy> --type CLOUD_ARMOR_NETWORK --region <region>
7
Turn on advanced network DDoS protection in that policy. Training takes 24 hours: gcloud compute security-policies update <policy> --network-ddos-protection ADVANCED --region <region>
8
Attach the policy through a network edge security service: gcloud compute network-edge-security-services create <service> --security-policy <policy> --region <region>
9
Enroll production projects in Cloud Armor Enterprise Annual before the next attack and complete the annual DDoS posture review
10
Record attack start, peak requests per second, top sources and the rules that stopped it for the after-action review
Watch out
DDoS response support needs an active Enterprise Annual subscription on the billing account, a Premium account for Cloud Customer Care, and the attacked project enrolled in Enterprise Annual. Subscriptions after September 3, 2024 also need an annual DDoS posture review of that project. Enterprise Paygo has no response support and no bill protection. Activation takes up to one hour.
Cloud Armor evaluates rules from the lowest priority number to the highest and allows no duplicate priorities. A deny rule numbered above a matching allow rule never fires.
Log counts follow the load balancer sampling rate. Set the rate to 1.0 before you use counts as evidence.
Verbose logging can record sensitive data from request headers and bodies. Turn it off after tuning with --log-level=NORMAL.
Google Cloud documentation: Cloud Armor request logging, verbose logging, audit logging, rate limiting overview and configuration, Adaptive Protection overview and configuration, security policy overview, preconfigured WAF rules, example policies, Security Command Center findings for Cloud Armor, Cloud Armor Enterprise overview and setup, advanced network DDoS protection; external Application Load Balancer logging and monitoring. Checked September 2026. Re-checked October 2026: Configure rate limiting (rate-based-ban flags; --exceed-action accepts deny-429); gcloud reference for logging copy; Cloud Armor Enterprise overview (DDoS response support and bill protection need Enterprise Annual, Premium Cloud Customer Care, project enrollment and, after September 3, 2024, the annual posture review; activation up to one hour); Set up Cloud Armor Enterprise (--cloud-armor-tier CA_ENTERPRISE_ANNUAL); preconfigured WAF rules (sqli-v422-stable and the other CRS 4.22 rules); Configure Adaptive Protection (--enable-layer7-ddos-defense); advanced network DDoS protection (--network-ddos-protection ADVANCED, 24-hour training, Enterprise only). Adaptive Protection one-hour training: checked September 2026.