Slide 1

Slide 1 text

Mitigating DDOS Attacks with Terraform Andy Gale

Slide 2

Slide 2 text

Andy Gale Managing Director Hello Future

Slide 3

Slide 3 text

DDOS Attacks • DDOS - Distributed Denial Of Service attacks • DDOS attacks often target certain one or two few providers • If you host everything with one provider you can be stung if they are attacked

Slide 4

Slide 4 text

Terraform • Keep your infrastructure as code • Set up your platform automatically with one command • Supports many of different services, called providers

Slide 5

Slide 5 text

Terraform Archive Atlas AWS Bitbucket Chef CenturyLinkCloud CloudFlare CloudStack Cobbler Consul Datadog DigitalOcean DNSMadeEasy DNSimple Docker Dyn GitHub Fastly Google Cloud Grafana Heroku InfluxDB Librato Logentries Mailgun Microsoft Azure Microsoft Azure (Legacy ASM) MySQL OpenStack Packet PagerDuty PostgreSQL PowerDNS RabbitMQ Random Rundeck StatusCake SoftLayer Scaleway Template Terraform TLS Triton UltraDNS VMware vCloud Director VMware vSphere Providers

Slide 6

Slide 6 text

Terraform • So we can see that we could set up our platform on multiple infrastructures with Terraform • Have them running on the time or spin them up on demand when a DDOS strikes • Of course budgetary constraints may have apply!

Slide 7

Slide 7 text

Terraform • Simple, easy win - DNS • Have them running on the time or spin them up on demand when a DDOS strikes • Of course budgetary constraints may have apply! • But recent DDOS on Dyn DNS broke many sites

Slide 8

Slide 8 text

Terraform resource "aws_route53_zone" "hellofuture" { name = "hellofutu.re" } resource "aws_route53_record" "www" { zone_id = "${aws_route53_zone.hellofuture.zone_id}" name = "www.hellofutu.re" type = "A" ttl = "300" records = ["212.45.31.81"] } AWS

Slide 9

Slide 9 text

Terraform resource "dnsimple_record" "foobar" { domain = "hellofutu.re" name = "www.hellofutu.re" value = "212.45.31.81" type = "A" ttl = 300 } DNSimpe

Slide 10

Slide 10 text

Terraform resource "dyn_record" "foobar" { zone = "${var.dyn_zone}" name = "${var.www_record}" value = "${var.www_a}" type = "A" ttl = 300 } DYN

Slide 11

Slide 11 text

Terraform variable "domain" { default = "hellofutu.re" } variable "www_name" { default = "www.hellofutu.re" } variable "www_a" { default = "212.45.31.81" } Variables

Slide 12

Slide 12 text

Terraform • Define multiple DNS servers for your domains • Keep them somewhere else (shortish TTL on the NS records) and if there is a DDOS attack just move them elsewhere.