migration: add support for a "tls-authz" migration parameter
commitd2f1d29b95aa45d13262b39153ff501ed6b1ac95
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 27 Feb 2019 14:53:24 +0000 (27 14:53 +0000)
committerJuan Quintela <quintela@redhat.com>
Mon, 25 Mar 2019 17:13:47 +0000 (25 18:13 +0100)
treef3e4876310eb34b62d3d3d87c16768b124cdff67
parentcbfd6c957a4437d4759ca660e621daa381bf2898
migration: add support for a "tls-authz" migration parameter

The QEMU instance that runs as the server for the migration data
transport (ie the target QEMU) needs to be able to configure access
control so it can prevent unauthorized clients initiating an incoming
migration. This adds a new 'tls-authz' migration parameter that is used
to provide the QOM ID of a QAuthZ subclass instance that provides the
access control check. This is checked against the x509 certificate
obtained during the TLS handshake.

For example, when starting a QEMU for incoming migration, it is
possible to give an example identity of the source QEMU that is
intended to be connecting later:

  $QEMU \
     -monitor stdio \
     -incoming defer \
     ...other args...

  (qemu) object_add tls-creds-x509,id=tls0,dir=/home/berrange/qemutls,\
             endpoint=server,verify-peer=yes \
  (qemu) object_add authz-simple,id=auth0,identity=CN=laptop.example.com,,\
             O=Example Org,,L=London,,ST=London,,C=GB \
  (qemu) migrate_incoming tcp:localhost:9000

Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
hmp.c
migration/migration.c
migration/tls.c
qapi/migration.json