From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPZNZ-0003U8-6R for qemu-devel@nongnu.org; Thu, 04 Sep 2014 11:55:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPZNT-0008KS-0d for qemu-devel@nongnu.org; Thu, 04 Sep 2014 11:55:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30060) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPZNS-0008KI-Pi for qemu-devel@nongnu.org; Thu, 04 Sep 2014 11:55:14 -0400 Message-ID: <54088B4C.1070001@redhat.com> Date: Thu, 04 Sep 2014 11:54:52 -0400 From: John Snow MIME-Version: 1.0 References: <20140903164417.GA32748@stefanha-thinkpad.redhat.com> <20140904141916.GA28417@irqsave.net> <20140904143459.GN772@redhat.com> In-Reply-To: <20140904143459.GN772@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [libvirt] NBD TLS support in QEMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" , =?UTF-8?B?QmVub8OudCBDYW5l?= =?UTF-8?B?dA==?= Cc: Stefan Hajnoczi , libvir-list@redhat.com, qemu-devel@nongnu.org, Max Reitz , Hani Benhabiles , nick@bytemark.co.uk, w@uter.be, Paolo Bonzini On 09/04/2014 10:34 AM, Daniel P. Berrange wrote: > On Thu, Sep 04, 2014 at 04:19:17PM +0200, Beno=C3=AEt Canet wrote: >> The Wednesday 03 Sep 2014 =C3=A0 17:44:17 (+0100), Stefan Hajnoczi wro= te : >>> Hi, >>> QEMU offers both NBD client and server functionality. The NBD protoc= ol >>> runs unencrypted, which is a problem when the client and server >>> communicate over an untrusted network. >>> >>> The particular use case that prompted this mail is storage migration = in >>> OpenStack. The goal is to encrypt the NBD connection between source = and >>> destination hosts during storage migration. >> >> I agree this would be usefull. >> >>> >>> I think we can integrate TLS into the NBD protocol as an optional fla= g. >>> A quick web search does not reveal existing open source SSL/TLS NBD >>> implementations. I do see a VMware NBDSSL protocol but there is no >>> specification so I guess it is proprietary. >>> >>> The NBD protocol starts with a negotiation phase. This would be the >>> appropriate place to indicate that TLS will be used. After client an= d >>> server complete TLS setup the connection can continue as normal. >> >> Prenegociating TLS look like we will accidentaly introduce some securi= ty hole. >> Why not just using a dedicated port and let the TLS handshake happen n= ormaly ? > > The mgmt app (libvirt in this case) chooses an arbitrary port when > telling QEMU to setup NBD, so we don't need to specify any alternate > port. I'd expect that libvirt just tell QEMU to enable NBD at both > ends, and we immediately do the TLS handshake upon opening the > connection. Only once TLS is established, should the NBD protocol > start running. IOW we don't need to modify the NBD protocol at all. This is my understanding of how, for example, the IRC protocol added SSL=20 support. the SSL/TLS handshake happens first, but the very next thing=20 the client/server expects to see is the usual IRC protocol talk, encrypte= d. If it sees incorrect magic after the SSL shake, both ends hang up. If it sees IRC magic prior to the SSL shake, it either allows an=20 unencrypted session, or if the user or server has requested SSL-only,=20 one or both ends hang up. > > If the mgmt app tells QEMU to enable TLS at one end and not the > other, the mgmt app gets what it deserves (a failed TLS handshake). > We certainly would not want QEMU to auto-negotiate and fallback > to plain text in this case. > > Regards, > Daniel >