Re: [secdir] [mpls] FYI - Early review of draft-farrelll-mpls-opportunistic-encrypt

"Adrian Farrel" <adrian@olddog.co.uk> Fri, 29 May 2015 18:57 UTC

Return-Path: <adrian@olddog.co.uk>
X-Original-To: secdir@ietfa.amsl.com
Delivered-To: secdir@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D870F1B2C30; Fri, 29 May 2015 11:57:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -100.701
X-Spam-Level:
X-Spam-Status: No, score=-100.701 tagged_above=-999 required=5 tests=[BAYES_40=-0.001, RCVD_IN_DNSWL_LOW=-0.7, USER_IN_WHITELIST=-100] 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 uUTrfj8pGCjO; Fri, 29 May 2015 11:57:50 -0700 (PDT)
Received: from asmtp3.iomartmail.com (asmtp3.iomartmail.com [62.128.201.159]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E9B671B2C1B; Fri, 29 May 2015 11:57:49 -0700 (PDT)
Received: from asmtp3.iomartmail.com (localhost.localdomain [127.0.0.1]) by asmtp3.iomartmail.com (8.13.8/8.13.8) with ESMTP id t4TIvjqE031264; Fri, 29 May 2015 19:57:45 +0100
Received: from 950129200 (jplon-nat12.juniper.net [193.110.55.12]) (authenticated bits=0) by asmtp3.iomartmail.com (8.13.8/8.13.8) with ESMTP id t4TIvfO6031231 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Fri, 29 May 2015 19:57:44 +0100
From: Adrian Farrel <adrian@olddog.co.uk>
To: 'Charlie Kaufman' <charliekaufman@outlook.com>
References: <554CAAE8.9090800@pi.nu> <BAY405-EAS3675C46A1A113881AD230F6DFCD0@phx.gbl> <5564375E.9060306@pi.nu>
In-Reply-To: <5564375E.9060306@pi.nu>
Date: Fri, 29 May 2015 19:57:40 +0100
Message-ID: <00b601d09a41$58cdd2e0$0a6978a0$@olddog.co.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 14.0
Thread-Index: AQF5eSexDRNWQp3PbXquwiAO8nDK8AG1NIBxAwpgEWKeGt5TUA==
Content-Language: en-gb
X-TM-AS-MML: disable
X-TM-AS-Product-Ver: IMSS-7.1.0.1576-8.0.0.1202-21578.002
X-TM-AS-Result: No--19.096-10.0-31-10
X-imss-scan-details: No--19.096-10.0-31-10
X-TMASE-MatchedRID: 8HTFlOrbAtGnykMun0J1wtcjCbPZgQnFQrO4XR6BRQPwZxaFJX+r1Q9W gBEShsusNJRL3ObC9T403lLuu4Ngvwr0iJbTVMrQVUIE0/jxA/0pWss5kPUFdFpbYq2f4jz+tNM q9uo9SGSdUQQhPyoTsFFO3CvbVp5Y3kon++iVNT3Rc75iroKqApSlv/9klkDi0mAM2eipqlpxQ9 CNI5RA3XndTfZ2f9trubF1G61WsDK2jsN8aguKvIhaKK0I26FpeJ1OirYwzAPqLnOUXH9QdN/LI yZs19OqD4fkXZtjSA5IGIywrjubdcaZnhgjGx375cQFbdjxan6imsR6hkcJAhZ50KsQddqXnUqX H4EzL8J2zheu5Rrnt1Jf31s+j+06/zkYJHv4a2FgP1dNF1ow7QkN8Uvsy+nt2oLGTNKlb9eGXWN Bqn1KYugqahDxmMqz/2Km2iZ9UFITtP2F86umWBD3+0w1DhqKviRliDV2nyxb6PBUqmq+UjtjAP WAT9k7mfH8FreQYWD5uD6QwNqXa/PnSD6On2CewCZxkTHxcclWjiXAsVR2K0iO8DX9hL7R4d2Na uEDjqzpw6f4ioqa6Z0K9Xn3Ln5CDL2trK/H+w4pa6LJktEjgOEpCHUsKYYGobx/SIoF+OYy5PBt qoQlk1/wODk/m7aHNDDF3FEnVHCWHmpvkeKJB1Pjo7D4SFg4YM9jZ5ImeaeA+ITQt7D1AHfDoi9 9VAHrkO2RcZLzfFxIKOYV2FoClO+Qm7Tg9jG3oxWB033D5MKBA/jzcz3nAVVgGGTe6VdACwgUPj ccZ/Dqumt0gZE/iphzqJ5nm6DdwwTYGyiIokyeAiCmPx4NwLTrdaH1ZWqCpvI8UZOf47jUZxEAl FPo846HM5rqDwqtpkzYWdbnR1BaewVHaiHXFPxXrdqkuzUuSUHWbFS8puGgJwEy2zguUIAjJblo AwAwShAy7Ao/AUv4OkKftdT/BMkjQlxoxv9QJeJ1WMCERkGtftyYo2KwDjKpoRvzNKOP9DB8M7t iaMCEN0PsxMBbpmcjFnImzvyS
Archived-At: <http://mailarchive.ietf.org/arch/msg/secdir/wZFbIwC3aeqeUaLx7Vi4_5m5Cos>
Cc: draft-farrelll-mpls-opportunistic-encrypt@tools.ietf.org, mpls@ietf.org, mpls-chairs@tools.ietf.org, 'secdir' <secdir@ietf.org>
Subject: Re: [secdir] [mpls] FYI - Early review of draft-farrelll-mpls-opportunistic-encrypt
X-BeenThere: secdir@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: adrian@olddog.co.uk
List-Id: Security Area Directorate <secdir.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/secdir>, <mailto:secdir-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/secdir/>
List-Post: <mailto:secdir@ietf.org>
List-Help: <mailto:secdir-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/secdir>, <mailto:secdir-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 29 May 2015 18:57:53 -0000

Charlie,

Thanks for this. Forgive me for stumbling through the security aspects: I'm sure
Stephen will pick me up on whatever I get wrong.

> All--
> Draft-farrelll-mpls-opportunistic-encrypt-04 specifies the details of a
> protocol for doing opportunistic encryption of MPLS connections. It permits
> encryption at any of two scopes: between adjacent Label Switching Routers
> (LSRs) on an MPLS Label Switched Path (LSP), and/or between end points of an
> LSP. Opportunistic encryption in this case means that there is no mechanism
> specified for authenticating the endpoints of the encrypted channel. The two
> endpoints do an anonymous Diffie-Hellman exchange and use the resulting key
> to encrypt the connection. The protocol is not protected from a
> man-in-the-middle attack (though some mechanisms for detecting such an
> attack after the fact are suggested and a keying infrastructure could be
> added later).
>
> The encryption aspects of the protocol seem well thought out and
> appropriate. The question at hand is whether to adopt this document as a
> working group document and it easily meets that bar (at least from a
> security standpoint). I have a number of questions about operational aspects
> of the protocol (perhaps due to my limited understanding of MPLS) and I have
> some suggestions for enhancements that will probably be necessary eventually
> and might be easier to make before there is widespread deployment:
>
> There is an issue that came up in the design of IKEv2 that may be an issue
> here as well. I don't know whether MPLS connections are bi-directional or
> whether separate connections need to be established in the two directions.
>
> If they are bi-directional, then there are race conditions that can occur if
> both ends attempt to initialize a connection simultaneously and there must
> be some tie-breaking mechanism to assure that exactly one of the connection
> attempts succeeds. If they are uni-directional, and if the connection is
> always initialized by the sending end, then this is not a problem (though it
> is replaced with the problem that messages of this protocol sent in the
> reverse direction cannot be tunneled over the MPLS connection). (This
> document seems to imply that MPLS connections can be either uni-directional
> or bi-directional, but I don't understand MPLS well enough to have
> understood it). Even if the connections are bi-directional, it will make
> your life simpler if you use different symmetric keys in the two directions.
> This can be done easily by getting two independent keys from the key
> expansion process.

Right. LSPs may be unidirectional or bidirectional.

Section 4 and particularly 4.3 describe how the return path is selected for the
case of a unidirectional LSP.

So we have four questions:

1. Is the return path secure?
2. Who initiates the use of OS?
3. How do we handle race conditions?
4. Should we have different keys in different directions?

In fact, the key exchange does not itself need to be secure, but it would be
better if it was. 4.2.1 and 4.4 say how to do this if possible, but notes it
will likely not be possible in the case of OS. So that's Q1.

In the case of a unidirectional LSP, only the source node (i.e. upstream from
the perspective of data flow) can be the initiator for the key exchange because
the key exchange requires the use of a message flowing on the LSP itself. So,
for Q2 we only have to worry about bidirectional LSPs, and that takes us to Q3.

But, in fact, a bidirectional LSP is in fact (from the point of view of the
forwarding plane) the association of two unidirectional LSPs. The association
may be so tight (in the control plane or the management plane, and with fate
sharing) that the LSP is referred to as *a* single bidirectional LSP, but that
doesn't change the forwarding plane behavior. And, indeed, in the bidirectional
case, there is no reason to not have encryption in one direction and not in the
other direction (except, of course, that more is better :-).  So that means that
each direction of the bidirectional LSP is responsible for initiating its own
OS. 

Hence Q3 is not a problem, and Q4 takes care of itself.

We should definitely clarify this in the draft (and thank you for making me
describe it here), but I'd like some more discussion with the WG to check I am
right about this.

> A second issue relates to algorithm negotiation. While the protocol allows
> for any of the crypto algorithms to be replaced, and the algorithms are
> indicated on the wire, it does not appear to allow for a smooth upgrade
> where the two ends are updated independently and everything must continue
> to work when only one end has been updated. To accomplish that, there
> should be an algorithm negotiation (as takes place in IKE and TLS) where one
> end presents a list of algorithms is can support and the other end chooses the
> algorithms it prefers. A simpler variation would be for a responder to be
> able to reject the algorithms assumed by the initiator and send back a list
> of algorithms it will accept. Note: it's possible that MPLS already operates
> with the restriction that the two ends of a connection must be consistent
> and operations will halt if the two ends are updated non-simultaneously. If
> that's true, then adding crypto doesn't make the situation any worse and it
> would be acceptable to continue to operate that way.

I'm so far from being an expert in this matter that I am probably making a fool
of myself (again), but is algorithm replacement actually any different from key
change? That is, the key negotiation protocol negotiates the key and algorithm
to use and so can also negotiate changes in both key and algorithm. 

Section 4.2.3 mentions this, but is exceptionally week. I'll add some text
(assuming what I just wrote is not complete lunacy).
The key ID identifies the key and the algorithm in one field, so being able to
change the key ID was intended to also allow changing the algorithm.

> A possible problem with Key Identifiers: the Key Identifier is only 4 bits
> long, which should be sufficient because at most two keys should be active
> at any given time. The Key Identifier, however, is chosen effectively
> randomly, which means that one time in 16 it will be the same as the Key
> Identifier it is replacing. While the protocol could be modified to do
> something special in that last (like adding one to the Key Identifier if it
> matches the previous value or redoing the key negotiation in that case), it
> would probably be better to get the Key-ID from the key expansion when
> there is no previous connection and add one (mod 16) when rekeying.

Yes, I had assumed that if the key ID was reselected then some form of secondary
choice would be made. Not sure that the predictability of simply adding one is
good idea (not that I can think of  specific associated risk).

> There is mention of the possibility of reusing g^i and g^r between
> connections. Some crypto purists would object to that, but I wouldn't. If
> you want to allow implementations that option, however, you should also
> include in the exchange nonce values Ni and Nr that are not reused between
> connections rather than depending on unique values for the other parameters
> to prevent reuse of keys.

Ah, hmm, OK.
Stephen?
Help!

> In section 3.5 (MTU considerations), I suspect you may be underestimating
> the effect on MTU. I believe AES_GCM_128 always adds between 1 and 16 pad
> bytes to make the encrypted payload size a multiple of 16 bytes. There are
> algorithm variants that do not add any padding, but they are somewhat
> controversial and difficult to implement in hardware. Further, the total
> overhead will be dependent of the crypto algorithm chosen, and the text
> should indicate that so that readers don't assume that there is some maximum
> number of bytes that can be wired into protocols that run above this.

That's helpful.
Stephen, I need you to help with this.

> I would suggest that most or all of sections 5 and 7 should be moved to
> Security Considerations. Failing that, the Security Considerations section
> should reference them.

Thanks. Since 5 is growing, I've put  back pointer from 6.
7.1 is already referenced from 6.2 and 6.3

> Typos:
>
> P4: "and if may be advisable" -> "and it may be advisable"
> P4: "an alternative key derivation functions" -> "alternative key derivation
> functions"
> P5: "key definition function" -> "key derivation function"
> P5: "attck vecotrs" -> "attack vectors"
> P5: "descirption" -> "description"
> P19: "opostie" -> "opposite"

Good.

vmt
Adrian