Best Practices for DDoS Protection and Mitigation
on Google Cloud Platform
Last updated: April 12th, 2016
Introduction
Protecting Shared Protecting Google’s Infrastructure
DDoS Protection and Mitigation for your GCP DeploymentConclusion

Introduction
A Denial of Service (DoS) attack is an attempt to render your service or application
unavailable to your end users. With Distributed Denial of Service (DDoS) attacks, theattackers use multiple resources (often a large number of compromised
hosts/instances) to orchestrate large scale attacks against targets. This document
describes the best practices for protecting against and mitigating such DDoS attacks
for your Google Cloud Platform (GCP) deployment.

Protecting Shared Infrastructure
Google has mechanisms in place to protect its cloud infrastructure and its production
services. These mechanisms are designed to ensure that no single service canoverwhelm the shared infrastructure and to provide isolation among customers using
the shared infrastructure. Details of these mechanisms are out of scope for thisdocument.

DDoS Protection and Mitigation for your GCP Deployment
Successfully thwarting and handling DDoS attacks for your GCP deployment is a shared
responsibility between Google Cloud Platform and you. ​DDoS defense involves
deploying detection systems, implementing barriers and being able to absorb attacks byscaling in order to prevent attackers from overwhelming or disabling access to yourservices or applications. Google Cloud Platform provides several of these mechanisms
automatically and you can follow the best practices detailed below on your end to help
secure your GCP deployment:● Reduce the attack surface for your GCE deployment○ Provision your own isolated and secure piece of the Google Cloud with
Google Cloud Virtual Network​. View the best practice ​here​.

1

○ Isolate and secure your deployment using subnetworks and networks,firewall rules, tags and Identity and Access Management (IAM).
○ Open access to ports and protocols that you need using firewall rules
and/or ​protocol forwarding​.
○ GCP provides anti-spoofing protection for the private network (IPaddresses) by default.
○ GCP automatically provides isolation between virtual networks.

● Isolate your internal traffic from the external world○ Deploy instances without public IPs unless necessary.
○ You can set up a NAT gateway or SSH bastion to limit the number of
instances that are exposed to the internet.
○ Once available, deploy Internal Load Balancing for your internal client
instances accessing internally deployed services thereby avoiding
exposure to the external world. [Internal LB expected to be available in thesecond half of 2016.]● DDoS Protection by enabling Proxy-based Load Balancing○ When you enable HTTP(S) Load Balancing or SSL proxy Load Balancing,
Google infrastructure mitigates and absorbs many Layer 4 and below
attacks, such as SYN floods, IP fragment floods, port exhaustion, etc.
○ If you have HTTP(S) Load Balancing with instances in multiple regions,
you are able to disperse your attack across instances around the globe.

● Scale to absorb the attack○ Protection by Google Frontend infrastructureWith Google Cloud Global Load Balancing, the frontend infrastructure
which terminates user traffic, automatically scales to absorb certain types
of attacks (e.g., SYN floods) before they reach your compute instances.
○ Anycast-based Load Balancing​: HTTP(S) Load Balancing and SSL proxyenable a single anycast IP to front-end your deployed backend instancesin all regions. Normally your user traffic is directed to the closest backend
with capacity; in the event of a DDoS attack, the additional advantage ofthis approach is that it increases the surface area to absorb this attack by
moving traffic to instances with available capacity in any region wherebackends are deployed.
○ Autoscaling​: When you configure HTTP(S)or SSL Proxy Load Balancing,
Google frontend infrastructure that terminates your user traffic protects
your backends. You should also provision sufficient number of instances2and/or configure autoscaling to handle spikes in traffic. In the event of asudden traffic spike, the load balancing proxy layer will distribute thetraffic across all the backends with available capacity. In parallel, theautoscaler ramps up the backends inline with traffic that needs to behandled.

● Protection with CDN Offloading○ Google Cloud CDN acts as a proxy between your clients and your origin
servers. For cacheable content, Cloud CDN caches and services thiscontent from points-of-presence (POPs) closer to your users as opposedto sending them to backend servers (instances). In the event of DDoS
attack for cacheable content, the requests are sent to POPs all over theglobe as opposed to your origin servers, thereby providing a larger set oflocations to absorb the attack.
○ If you use CDN Interconnect, you can leverage the additional DDoS
Protection provided by our CDN Interconnect partners. You can check thepartner page​for specifics on their DDoS protection capabilities.

● Deploy third-party DDoS protection solutions○ In order to meet your specific needs of protection for DDoS attack
prevention/mitigation, consider purchasing specialized third-party DDoS
protection solutions to protect against such attacks.
○ You can also deploy DDoS solutions available via ​Google Cloud Launcher​.

● App Engine deployment○ App Engine is designed to be a fully multi-tenant system and implements a
number of safeguards intended to ensure that a single bad application will
not impact the performance or availability of other applications on theplatform.
○ App Engine sits behind the Google Front End which mitigates and absorbs
many Layer 4 and below attacks, such as SYN floods, IP fragment floods,
port exhaustion, etc.
○ You can also specify a set of IPs/IP networks via a ​dos.yaml file to block
them from accessing your application(s).

● Google Cloud Storage○ If you do not want to require your users to have a Google account in order
to be able to access your Google Cloud Storage resources, you can control
access using ​signed URLs​.

3

● API rate-limiting○ API rate limits define the number of requests that can be made to theGoogle Compute Engine API​
. API rate limits apply on a per-project basis.
○ Currently, projects are ​limited to an API rate limit​of 20 requests/second.

● Resource Quotas○ Compute Engine enforces ​quotas on resource usage for a variety ofreasons. For example, quotas protect the community of Google Cloud
Platform users by preventing unforeseen spikes in usage. ​Special quotas
limit access for projects that are just exploring Google Cloud Platform ona free trial basis.

Conclusion
Google Cloud Platform provides a number of features to defend against DDoS attacks.
You can use these in conjunction with the above mentioned best practices and othermeasures tailored to your requirements to make your GCP deployment resilient to DDoS
attacks.

4