PIVTR-D
RGoogle Cloud playbook · Network and edge

DDoS or application-layer attack

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

LogSearch 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 rateTop 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 logRequests 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 fieldsRate 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 loggingWhich 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 alertsAlerts 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>')
Admin Activity audit logPolicy tampering: v1.compute.securityPolicies.patch, v1.compute.securityPolicies.insert, v1.compute.securityPolicies.delete, v1.compute.securityPolicies.addRule, v1.compute.securityPolicies.patchRule, v1.compute.securityPolicies.removeRule
Security Command CenterCloud Armor findings, which appear only for projects in an organization with Security Command Center enabled: Allowed Traffic Spike, Increasing Deny Ratio
Policy and tier statePolicies in the project and the project's Cloud Armor tier, in cloudArmorTier: gcloud compute security-policies list, gcloud compute project-info describe
Backend configurationWhether each backend has a policy and logging: gcloud compute backend-services describe <backend> --global --format='yaml(securityPolicy,logConfig)'

Contain

#Item
1Export 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>
2Enable logging on backends that lack it: gcloud compute backend-services update <backend> --global --enable-logging --logging-sample-rate=1.0
3Create a policy if the backend has none: gcloud compute security-policies create <policy>
4Attach the policy to the backend: gcloud compute backend-services update <backend> --security-policy=<policy> --global
5Block 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
6Rate limit the targeted path: gcloud compute security-policies rules create 900 --security-policy=<policy> --expression="request.path.matches('<path-regex>')" --action=rate-based-ban --rate-limit-threshold-count=<count> --rate-limit-threshold-interval-sec=60 --ban-duration-sec=600 --conform-action=allow --exceed-action=deny-429 --enforce-on-key=IP
7Block 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
8Turn on Adaptive Protection. It needs at least one hour of training before it alerts: gcloud compute security-policies update <policy> --enable-layer7-ddos-defense
9For 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
10Enroll 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
11As 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
1List 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
2Move preview rules to enforcement after the logs show no legitimate clients: gcloud compute security-policies rules update <priority> --security-policy=<policy> --no-preview
3Deploy Adaptive Protection suggested rules in preview mode first, by pasting the evaluateAdaptiveProtection expression into a rule with action deny
4Remove temporary blocks once the attack ends and no client hits them destructive: gcloud compute security-policies rules delete <priority> --security-policy=<policy>
5Close 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
6For 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>
7Turn on advanced network DDoS protection in that policy. Training takes 24 hours: gcloud compute security-policies update <policy> --network-ddos-protection ADVANCED --region <region>
8Attach the policy through a network edge security service: gcloud compute network-edge-security-services create <service> --security-policy <policy> --region <region>
9Enroll production projects in Cloud Armor Enterprise Annual before the next attack and complete the annual DDoS posture review
10Record 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.

Adapts material from Dynamic Incident Response: A Framework for Security Teams by Joshua Wright, © 2026 The Escal Institute of Advanced Technologies, Inc. d/b/a SANS Institute, licensed under CC BY 4.0. Figures reproduced under that license. Changes were made. Not published by, endorsed by, or affiliated with the SANS Institute.