Re: [IPsec] A strategy against DoS/DDoS for IKE responders

"Graham Bartlett (grbartle)" <grbartle@cisco.com> Fri, 10 October 2014 11:32 UTC

Return-Path: <grbartle@cisco.com>
X-Original-To: ipsec@ietfa.amsl.com
Delivered-To: ipsec@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E238A1A8A97 for <ipsec@ietfa.amsl.com>; Fri, 10 Oct 2014 04:32:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -15.287
X-Spam-Level:
X-Spam-Status: No, score=-15.287 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.786, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tyMOxJdjyZEe for <ipsec@ietfa.amsl.com>; Fri, 10 Oct 2014 04:32:00 -0700 (PDT)
Received: from alln-iport-2.cisco.com (alln-iport-2.cisco.com [173.37.142.89]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EA6861A8AA8 for <ipsec@ietf.org>; Fri, 10 Oct 2014 04:31:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=11984; q=dns/txt; s=iport; t=1412940719; x=1414150319; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=kJtO7+tCM93tkRK09T8HlrOzwNlFo9k0oDTjXDfgiaE=; b=UpvFykuQw1FeC0pkRBJC0k7kwEeAbkDc8f8YkFM0UjV8cL4i4ylnR8j3 jFCdZB9dYu5B39JgpgoDqd2M8Wi5kuZ8JpmaEnhbcgHT4srk7AKmqc0fD DiLOlxw7QVPHI1nUwRiAwaNRJI6OVRLoQLqcp/jCQMAZrabFDWp7ZesJa Q=;
X-Files: smime.p7s : 3708
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AhIFAFDCN1StJV2d/2dsb2JhbABWCoJrI1NYBIMCyEEKh00CgQgWAXuEAwEBAQMBAQEBaQILEAIBCBgsAgIfBgslAgQBDQUODYgPAwkIAQyRFpxFBo4cDYZjAQEBAQEBAQEBAQEBAQEBAQEBAQEBEwSCYYsxgVZBGweCcYFaBZF5ggyBT4VmghGPPYZUggYYgVlsgQYGATuBAgEBAQ
X-IronPort-AV: E=Sophos;i="5.04,691,1406592000"; d="p7s'?scan'208";a="85760820"
Received: from rcdn-core-6.cisco.com ([173.37.93.157]) by alln-iport-2.cisco.com with ESMTP; 10 Oct 2014 11:31:59 +0000
Received: from xhc-rcd-x11.cisco.com (xhc-rcd-x11.cisco.com [173.37.183.85]) by rcdn-core-6.cisco.com (8.14.5/8.14.5) with ESMTP id s9ABVxqI020859 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Fri, 10 Oct 2014 11:31:59 GMT
Received: from xmb-aln-x13.cisco.com ([fe80::5404:b599:9f57:834b]) by xhc-rcd-x11.cisco.com ([173.37.183.85]) with mapi id 14.03.0195.001; Fri, 10 Oct 2014 06:31:58 -0500
From: "Graham Bartlett (grbartle)" <grbartle@cisco.com>
To: Yaron Sheffer <yaronf.ietf@gmail.com>, Yoav Nir <ynir.ietf@gmail.com>
Thread-Topic: [IPsec] A strategy against DoS/DDoS for IKE responders
Thread-Index: AQHP4IbF+Xf2zTD2ikCTmGddD9T/C5wiP6oAgAAHRYCAANx7gIAAp7KAgAXUBQA=
Date: Fri, 10 Oct 2014 11:31:58 +0000
Message-ID: <D05D5032.2F73E%grbartle@cisco.com>
References: <9612D2B2-7DFE-49F5-8593-3750B781956B@gmail.com> <5431A26C.90307@gmail.com> <B64E3253-54CB-4A71-A5BD-7B16383559D4@gmail.com> <D05808E1.2F023%grbartle@cisco.com> <5432EE25.7050400@gmail.com>
In-Reply-To: <5432EE25.7050400@gmail.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/14.4.4.140807
x-originating-ip: [10.55.146.102]
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha256"; boundary="B_3495789118_36187111"
MIME-Version: 1.0
Archived-At: http://mailarchive.ietf.org/arch/msg/ipsec/7gow_OgYVm_xEY9ARJpxBCnAL4M
Cc: ipsec <ipsec@ietf.org>
Subject: Re: [IPsec] A strategy against DoS/DDoS for IKE responders
X-BeenThere: ipsec@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Discussion of IPsec protocols <ipsec.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ipsec>, <mailto:ipsec-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/ipsec/>
List-Post: <mailto:ipsec@ietf.org>
List-Help: <mailto:ipsec-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ipsec>, <mailto:ipsec-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 10 Oct 2014 11:32:03 -0000

Hi Yaron / Yoav

I'm summarising my thoughts below, I've spoken to a few folk offlist and
hopefully the following will help my understanding and also theirs.

So assuming a device is under potential attack by devices using their own
addresses (botnet or similar), the cookie notification is not going to
give any benefit (as they are using a legitimate IP address), but Yoav's
puzzle will slow the attack down.


If an attacker sent a legitimate DH public value (that would pass the 6989
checks) and we held off checking this until IKE_AUTH, as you say no
benefit would be gained from detecting this at SA_INIT. The only point in
this attack that we detect an attacker is when the AUTH value is known to
be incorrect so even if they send correct DH public values.

Now the only issue I can see is alluded to in the draft, where a VPN
headend is serving clients with varying resource. So say a botnet attacks
this headend and the puzzle is enabled, you have some clients with a lot
of resource (that require a hard puzzle) and some mobile devices with
minimal (that require an easier puzzle). How do you identify each? The
only way I can think is you must do this once the device has authenticated
itself - else how do you know who they are?

An idea - for example the minimum difficulty of the puzzle is sent by
responder and this is selected by the client and confirmed by the headend
based on IKE ID/certificate attribute? For IKE ID/cert that knows it
should perform a harder puzzle it will (manual local setting).

I know this is a bit of a corner case, but seems to be an easy attack for
someone to start disrupting a remote-access VPN solution that serves
clients with different processing resource.

So to summarise; Because of the attack(s) described in 6989 I personally
feel that this should always be implemented - it's a must. Cookie
notification gives no benefit (only mitigates blind spoofing), but Yoav's
puzzle will help slow down an attack using a devices own IP address.


So I'm all for Yoav's puzzle. :-)

cheers 


On 06/10/2014 20:31, "Yaron Sheffer" <yaronf.ietf@gmail.com> wrote:

>It seems to me the difference between the two options is not very
>important (assuming reasonable rate limits), because the cost of
>receiving an IKE_AUTH message and detecting an incorrect MAC is not very
>high, after the initial generation of the IKE SA key material.
>
>But Yoav's model also demonstrates that we could get the same effect by
>attaching the puzzle to IKE_AUTH - though I don't see an advantage.
>
>Re: RFC 6989, yes, the test refers to IKE_SA_INIT. But the response
>message does not depend on the received DH public key, so IMHO it's fine
>to postpone the test until IKE_AUTH is received, and before generating
>the IKE shared key.
>
>Thanks,
>	Yaron
>
>
>On 10/06/2014 11:31 AM, Graham Bartlett (grbartle) wrote:
>> Hi
>>
>> This is a very interesting attack, I would dismiss (1) as it leaves an
>> implementation open for a semi-easy DOS (just one packet that generates
>> work rate on both initiator and responder).
>>
>> Basing the behaviour on (2) the attacker would only have the window from
>> when the responder sends the SA_INIT, to receiving the (valid) IKE_AUTH.
>> As Nico said shortening the time is critical, but also once the
>>responder
>> receives a valid IKE_AUTH it should (IMO) dismiss any more IKE_AUTH
>> messages it receives.
>>
>>
>> I guess you could look at rate limiting IKE_AUTH messages if they fail
>>to
>> decrypt, but then you could drop the legit IKE_AUTH. Unless the attacker
>> is very very lucky (in their packet generation), or has the
>>authentication
>> credentials they will not be able to send a valid IKE_AUTH, so the
>>window
>> that occurs between the responder receiving the valid IKE_AUTH is key.
>>
>> I see the potential for an attacker dropping, or delaying the legit
>> IKE_AUTH and then sending many IKE_AUTH as you said, so if the behaviour
>> was set to 10s if a device detected it was under this attack it should
>> reduce the window of time to process IKE_AUTH (as Nico said), but once
>> again this could then drop the legit IKE_AUTH.
>>
>> As I understand the RFC6989 checks are performed on the public value
>> received in SA_INIT, no IKE_AUTH. (FROM RFC6989) "A receiving peer MUST
>> check that its peer's public value is valid;", so these checks (as I
>> understand) would be performed before the responder sends the SA_INIT.
>>
>> So to summarise, I think that (1) is worse, (2) should be implemented
>> (maybe with a different timer), but with guidance on what to do should a
>> device become under attack.
>>
>> cheers
>>
>>
>>
>> On 05/10/2014 21:22, "Yoav Nir" <ynir.ietf@gmail.com> wrote:
>>
>>> Hi, Yaron
>>>
>>> On Oct 5, 2014, at 10:56 PM, Yaron Sheffer <yaronf.ietf@gmail.com>
>>>wrote:
>>>
>>>>
>>>> - I'm not sure what is special about "[the case] when an
>>>>Authentication
>>>> request fails to decrypt." Seems to me this is a verified DoS attack
>>> >from a specific IP.
>>>
>>> I see I wasn¹t clear about this, because both you and Graham missed
>>>what
>>> I meant.
>>>
>>> Suppose we have a responder where half-open SAs time out after 10
>>> seconds.
>>> This responder receives an Initial Request, and responds with an
>>>Initial
>>> Response.
>>> It stores its own private value and the peer¹s public value in the
>>> half-open SA database, keyed by IKE SPIs.
>>> 0.5 seconds later, it receives an IKE_AUTH request with the right IKE
>>> SPIs.
>>> It derives the keys (making any ECDH check that¹s needed)
>>> It tries to decrypt the message
>>> The message fails to decrypt (or more likely, the MAC comparison fails)
>>> Now the responder has two options:
>>> (1) delete the entry in the half-open SA database, or
>>> (2) store the derived key, and keep the half-open SA another 9.5
>>>seconds.
>>>
>>> (2) has the disadvantage that the attacker can keep sending more junk
>>> packets and get the responder to attempt to decrypt all of them.
>>> (1) has the disadvantage that an attacker can inject a junk IKE_AUTH
>>> request by just copying the IKE SPIs from the IKE_INIT response, which
>>> will prevent the responder from processing the real initiator¹s
>>>IKE_AUTH
>>> request.
>>>
>>> So I¹m not sure which is worse.
>>>
>>> Yoav
>>>
>>> _______________________________________________
>>> IPsec mailing list
>>> IPsec@ietf.org
>>> https://www.ietf.org/mailman/listinfo/ipsec