fanf: (dotat)
[personal profile] fanf

Last weekend one of our authoritative name servers (authdns1.csx.cam.ac.uk) suffered a series of DoS attacks which made it rather unhappy. Over the last week I have developed a patch for BIND to make it handle these attacks better.

The attack traffic

On authdns1 we provide off-site secondary name service to a number of other universities and academic institutions; the attack targeted imperial.ac.uk.

For years we have had a number of defence mechanisms on our DNS servers. The main one is response rate limiting, which is designed to reduce the damage done by DNS reflection / amplification attacks.

However, our recent attacks were different. Like most reflection / amplification attacks, we were getting a lot of QTYPE=ANY queries, but unlike reflection / amplification attacks these were not spoofed, but rather were coming to us from a lot of recursive DNS servers. (A large part of the volume came from Google Public DNS; I suspect that is just because of their size and popularity.)

My guess is that it was a reflection / amplification attack, but we were not being used as the amplifier; instead, a lot of open resolvers were being used to amplify, and they in turn were making queries upstream to us. (Consumer routers are often open resolvers, but usually forward to their ISP's resolvers or to public resolvers such as Google's, and those query us in turn.)

What made it worse

Because from our point of view the queries were coming from real resolvers, RRL was completely ineffective. But some other configuration settings made the attacks cause more damage than they might otherwise have done.

I have configured our authoritative servers to avoid sending large UDP packets which get fragmented at the IP layer. IP fragments often get dropped and this can cause problems with DNS resolution. So I have set

    max-udp-size 1420;
    minimal-responses yes;

The first setting limits the size of outgoing UDP responses to an MTU which is very likely to work. (The ethernet MTU minus some slop for tunnels.) The second setting reduces the amount of information that the server tries to put in the packet, so that it is less likely to be truncated because of the small UDP size limit, so that clients do not have to retry over TCP.

This works OK for normal queries; for instance a cam.ac.uk IN MX query gets a svelte 216 byte response from our authoritative servers but a chubby 2047 byte response from our recursive servers which do not have these settings.

But ANY queries blow straight past the UDP size limit: the attack queries for imperial.ac.uk IN ANY got obese 3930 byte responses.

The effect was that the recursive clients retried their queries over TCP, and consumed the server's entire TCP connection quota. (Sadly BIND's TCP handling is not up to the standard of good web servers, so it's quite easy to nadger it in this way.)

draft-ietf-dnsop-refuse-any

We might have coped a lot better if we could have served all the attack traffic over UDP. Fortunately there was some pertinent discussion in the IETF DNSOP working group in March last year which resulted in draft-ietf-dnsop-refuse-any, "providing minimal-sized responses to DNS queries with QTYPE=ANY".

This document was instigated by Cloudflare, who have a DNS server architecture which makes it unusually difficult to produce traditional comprehensive responses to ANY queries. Their approach is instead to send just one synthetic record in response, like

    cloudflare.net.  HINFO  ( "Please stop asking for ANY"
                              "See draft-jabley-dnsop-refuse-any" )

In the discussion, Evan Hunt (one of the BIND developers) suggested an alternative approach suitable for traditional name servers. They can reply to an ANY query by picking one arbitrary RRset to put in the answer, instead of all of the RRsets they have to hand.

The draft says you can use either of these approaches. They both allow an authoritative server to make the recursive server go away happy that it got an answer, and without breaking odd applications like qmail that foolishly rely on ANY queries.

I did a few small experiments at the time to demonstrate that it really would work OK in the real world (unlike some of the earlier proposals) and they are both pretty neat solutions (unlike some of the earlier proposals).

Attack mitigation

So draft-ietf-dnsop-refuse-any is an excellent way to reduce the damage caused by the attacks, since it allows us to return small UDP responses which reduce the downstream amplification and avoid pushing the intermediate recursive servers on to TCP. But BIND did not have this feature.

I did a very quick hack on Tuesday to strip down ANY responses, and I deployed it to our authoritative DNS servers on Wednesday morning for swift mitigation. But it was immediately clear that I had put my patch in completely the wrong part of BIND, so it would need substantial re-working before it could be more widely useful.

I managed to get back to the patch on Thursday. The right place to put the logic was in the fearsome query_find() which is the top-level query handling function and nearly 2400 lines long! I finished the first draft of the revised patch that afternoon (using none of the code I wrote on Tuesday), and I spent Friday afternoon debugging and improving it.

The result is this patch which adds a minimal-qtype-any option. I'm currently running it on my toy nameserver, and I plan to deploy it to our production servers next week to replace the rough hack.

I have submitted the patch to the ISC; hopefully something like it will be included in a future version of BIND. And it prompted a couple of questions about draft-ietf-dnsop-refuse-any that I posted to the DNSOP working group mailing list.

kxcdskj

Date: 2017-03-27 04:30 pm (UTC)
From: (Anonymous)
ztqyvub

http://www.reisen-netz.de/sneakers-puma-schwarz-726.htm
http://www.sport-krediet.nl/093-rihanna-puma-creepers-zwart.php
http://www.sport-krediet.nl/064-puma-velvet-creepers-ebay.php
http://www.rmitbuddhistsociety.org/728-puma-shoes-for-women-on-sale.php
http://www.sport-krediet.nl/904-fenty-puma-creeper-suede.php

[url=http://www.ristoranteeremo.it/scarpe-puma-suede-classic-prezzo-175.php]Scarpe Puma Suede Classic Prezzo[/url]
[url=http://www.praxis-forum-passau.de/676-puma-basket-heart-binden.htm]Puma Basket Heart Binden[/url]
[url=http://www.tulencenter.nl/puma-x-fenty-rihanna-bordeaux-113.php]Puma X Fenty Rihanna Bordeaux[/url]
[url=http://www.reisen-netz.de/puma-sneaker-354.htm]Puma Sneaker[/url]
[url=http://www.rmitbuddhistsociety.org/056-puma-sneakers-burgundy.php]Puma Sneakers Burgundy[/url]

gnxsavy

Date: 2017-03-27 05:07 pm (UTC)
From: (Anonymous)
ytvrxmy

http://www.rmitbuddhistsociety.org/924-puma-shoes-pink-and-black.php
http://www.ukrainesolidarity.co.uk/712-puma-basket-jewel.php
http://www.thejuniperpassion.it/082-puma-basket-heart-kl.html
http://www.praxis-forum-passau.de/550-puma-basket-schwarz-lack.htm
http://www.rmitbuddhistsociety.org/638-puma-shoes-size-6.php

[url=http://www.ricercasiti.it/scarpe-puma-bianche-alte-209.html]Scarpe Puma Bianche Alte[/url]
[url=http://www.tunbecklongstraw.co.uk/277-puma-fenty-shoes-white.htm]Puma Fenty Shoes White[/url]
[url=http://www.praxis-forum-passau.de/665-puma-basket-platform-schwarz.htm]Puma Basket Platform Schwarz[/url]
[url=http://www.rmitbuddhistsociety.org/680-puma-shoes-for-women-2017.php]Puma Shoes For Women 2017[/url]
[url=http://www.websitesrespectingcopyright.org/718-puma-ignite-v3.php]Puma Ignite V3[/url]

zdhetvg

Date: 2017-03-28 05:36 am (UTC)
From: (Anonymous)
eduaile

http://www.bevarakymlinge.nu/077-nike-roshe-one-womens-shoe-grey.html
http://www.mooienschede.nu/nike-free-3.0-flyknit-womens-605.html
http://www.denhaagleeft.nu/air-max-zero-ultramarine-897.html
http://www.linkopingseskadern.nu/769-nike-air-max-1-woven-carbon-green.asp
http://www.laganda.nu/572-nike-cortez-ultra-black-white.php

[url=http://www.enola.nu/091-nike-shox-deliver-black-gold.html]Nike Shox Deliver Black Gold[/url]
[url=http://www.eliteteam.nu/mens-nike-air-max-2015-running-shoes-amazon-228.asp]Mens Nike Air Max 2015 Running Shoes Amazon[/url]
[url=http://www.appelgaard.nu/408-nike-dunk-sb-high.html]Nike Dunk Sb High[/url]
[url=http://www.enkrona.nu/154-huarache-triple-black-price.asp]Huarache Triple Black Price[/url]
[url=http://www.klickdata.nu/vans-hi-sk8-464.html]Vans Hi Sk8[/url]

rhzdjth

Date: 2017-03-28 01:35 pm (UTC)
From: (Anonymous)
agxrlcg

http://www.depannagepc93.fr/989-crampons-adidas-x-traxion.html
http://www.domainedelargens.fr/633-nike-hypervenom-2-blanche.html
http://www.domainedelargens.fr/611-nike-mercurial-superfly-bleu.html
http://www.depannagepc93.fr/692-crampons-adidas-bleu-et-noir.html
http://www.jorion-multimedia.fr/chaussure-philipp-plein-homme-basse-898.htm

[url=http://www.3-devis.fr/064-balenciaga-arena-bleu.php]Balenciaga Arena Bleu[/url]
[url=http://www.institutchama.fr/674-chaussure-de-foot-nike-synthétique.php]Chaussure De Foot Nike Synthétique[/url]
[url=http://www.institutchama.fr/481-nike-elastico-superfly-futsal.php]Nike Elastico Superfly Futsal[/url]
[url=http://www.institut-beautyboop.fr/escarpins-bleu-klein-932.php]Escarpins Bleu Klein[/url]
[url=http://www.e-acute.fr/562-clarks-desert-boots.html]Clarks Desert Boots[/url]

kmdnnty

Date: 2017-03-30 03:27 am (UTC)
From: (Anonymous)
ilweuqo

http://www.forge-delours.fr/673-coq-sportif-kaki-femme.html
http://www.messengercity.fr/285-mizuno-lightning-z2.php
http://www.lesdroles.fr/062-chaussure-lacoste-sneakers.php
http://www.forge-delours.fr/706-le-coq-sportif-tennis-femme.html
http://www.messengercity.fr/999-mizuno-wave-20.php

[url=http://www.barreau-de-saint-pierre.fr/629-salomon-apres-ski-femme.php]Salomon Apres Ski Femme[/url]
[url=http://www.lesdroles.fr/631-chaussures-lacoste-homme-2016.php]Chaussures Lacoste Homme 2016[/url]
[url=http://www.lesdroles.fr/048-basket-lacoste-kaki.php]Basket Lacoste Kaki[/url]
[url=http://www.forge-delours.fr/263-coq-sportif-bleu.html]Coq Sportif Bleu[/url]
[url=http://www.forge-delours.fr/941-coq-sportif-bebe-fille.html]Coq Sportif Bebe Fille[/url]

gfcfpgp

Date: 2017-04-03 11:59 pm (UTC)
From: (Anonymous)
dzjqkzk

http://www.lombardoeditore.it/negozio-vibram-fivefingers-158.html
http://www.laviadiemmaus.it/pigalle-louboutin-120-302.htm
http://www.lluvia.it/787-louboutin-tronchetti.htm
http://www.laviadiemmaus.it/louboutin-brillantini-013.htm
http://www.lluvia.it/288-sandals-louboutin.htm

[url=http://www.laprealpinagiorn.it/765-adidas-f50-2017.htm]Adidas F50 2017[/url]
[url=http://www.lombardoeditore.it/negozio-scarpe-vibram-milano-762.html]Negozio Scarpe Vibram Milano[/url]
[url=http://www.lombardoeditore.it/birkenstock-medina-207.html]Birkenstock Medina[/url]
[url=http://www.maurogiulianini.it/521-dsquared-scarpe-uomo-scontate.htm]Dsquared Scarpe Uomo Scontate[/url]
[url=http://www.lluvia.it/119-scarpe-louboutin-su-ebay.htm]Scarpe Louboutin Su Ebay[/url]
Page generated Oct. 18th, 2017 08:10 pm
Powered by Dreamwidth Studios