All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: amit.shah@redhat.com, qemu-devel@nongnu.org, quintela@redhat.com
Subject: Re: [Qemu-devel] RFC: Universal encryption on QEMU I/O channels
Date: Wed, 4 Feb 2015 14:02:59 +0000	[thread overview]
Message-ID: <20150204140259.GR3032@redhat.com> (raw)
In-Reply-To: <20150204130821.GH2329@work-vm>

On Wed, Feb 04, 2015 at 01:08:21PM +0000, Dr. David Alan Gilbert wrote:
> * Daniel P. Berrange (berrange@redhat.com) wrote:
> > In QEMU there are a number of features which involve communication with an
> > external system over an I/O channel of some form. The features include
> > migration, NBD, VNC and character devices. The I/O channel in question might
> > might be a FIFO pipe, a PTY, a TCP socket, a UNIX domain socket, RMDA channel
> > or something else, while the external system can be another QEMU, libvirt, an
> > NBD server, or something else.
> 
> > Currently the only place where there is any meaningful level of security is
> > the VNC server, which supports the VeNCrypt extension providing TLS sessions
> > for data encryption and x509 cert validation for authentication, and the SASL
> > extension which also provides either encryption of authentication or both.
> > The migration data channel is more or less completely unprotected unless it
> > is tunnelled via libvirt or equivalent external secure channel. The same is
> > true for NBD, though there was a recent discussion about defining an extension
> > to use TLS. Likewise serial ports, parallel ports, virtio consoles all use the
> > chardev backends which offer no security features.
> 
> I think fixing this for migration might simplify stuff for users a lot as well;
> the choice of whether libvirt does tunneling or not and what it means
> for how block migration happens etc can get very confusing.

Yes, and not helped by the fact that no single current impl offers all
desired features - they are all partially overlapping sets :-(


> > Since this TLS/SASL code is non-trivial (and obviously security critical), I
> > really don't want to end up with 4 separate places to implement it in QEMU.
> > IMHO the only practical / sensible approach is to define some kind of standard
> > I/O channel API internally to QEMU which migration, NBD, chardev and VNC all
> > use. That gives us a single place to integrate all the security mechanisms
> > we need to support.  In libvirt we did something like this a little while
> > ago by defining a standard internal sockets API[1], with plugins for things
> > like SASL[2], TLS[4] and SSH[5] and it has been very successful in simplifying
> > the code by centralizing the hairy logic, though I wouldn't aim for exactly
> > the same design if doing it again - a more layered approach like QEMU blockdev
> > drivers is probably better in retrospect.
> > 
> > So my idea would be that we define a QEMUChannel object and set of APIs to
> > standardize all interaction with sockets, pipes, RDMA, whatever $channel,
> 
> I'm not sure if it makes sense for RDMA; it already has a couple of hooks
> that go around the back of QEMUFile in migration, and it's transferring the
> data via DMA so the page data doesn't go through the same path.

Could you ever anticipate any need for authentication or encryption in
the RDMA based channel ? I don't know enough about RDMA myself to know
if it makes sense or not, other than the fact that any channel between
two separate hosts needs security at some level in the stack.


> Some things to keep in mind:
>   1) The current patch from Liang Li doing multi threaded compression
>      It just strikes me as an exmaple of another type of filter in the migration
>      stream.

Yes, that does make sense in that way,

>   2) Postcopy and fault tolerance need a bidirectional channel; and that back
>      channel tends to be small messages.

TLS will require bidirectional channels too in order to perform the
handshake. SASL will require bidirectional channels too. So this
seems rather inevitable.

>   3) I'd considered making a separate socket/fd for passing page data
>      in the hope of maybe making that page take data via splice; but am not
>      sure yet.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

  reply	other threads:[~2015-02-04 14:03 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04 11:32 [Qemu-devel] RFC: Universal encryption on QEMU I/O channels Daniel P. Berrange
2015-02-04 12:43 ` Paolo Bonzini
2015-02-04 13:00   ` Daniel P. Berrange
2015-02-04 13:42     ` Paolo Bonzini
2015-02-04 14:08       ` Daniel P. Berrange
2015-02-04 14:23         ` Paolo Bonzini
2015-02-04 14:34           ` Daniel P. Berrange
2015-02-04 15:04             ` Paolo Bonzini
2015-02-04 15:11               ` Daniel P. Berrange
2015-02-04 15:22                 ` Paolo Bonzini
2015-02-04 15:26                   ` Daniel P. Berrange
2015-02-04 16:46                     ` Paolo Bonzini
2015-02-05 14:38       ` Stefan Hajnoczi
2015-02-05 14:44         ` Cornelia Huck
2015-02-05 14:45         ` Peter Maydell
2015-02-04 13:49     ` Markus Armbruster
2015-02-04 13:55       ` Peter Maydell
2015-02-04 16:33         ` Markus Armbruster
2015-02-04 16:41           ` Daniel P. Berrange
2015-02-04 20:41           ` Peter Maydell
2015-02-04 21:06             ` Paolo Bonzini
2015-02-05  7:57             ` Markus Armbruster
2015-02-04 13:08 ` Dr. David Alan Gilbert
2015-02-04 14:02   ` Daniel P. Berrange [this message]
2015-02-04 14:28     ` Paolo Bonzini
2015-02-04 14:48       ` Marcel Apfelbaum
2015-02-04 14:50         ` Daniel P. Berrange
2015-02-04 18:34     ` Eric Blake
2015-02-05  9:11       ` Dr. David Alan Gilbert
2015-02-04 14:27   ` Paolo Bonzini
2015-02-04 14:37     ` Dr. David Alan Gilbert
2015-03-06 17:18 ` Daniel P. Berrange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150204140259.GR3032@redhat.com \
    --to=berrange@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.