qemu-e2k/include
Daniel P. Berrange b25e12daff qemu-nbd: add support for authorization of TLS clients
Currently any client which can complete the TLS handshake is able to use
the NBD server. The server admin can turn on the 'verify-peer' option
for the x509 creds to require the client to provide a x509 certificate.
This means the client will have to acquire a certificate from the CA
before they are permitted to use the NBD server. This is still a fairly
low bar to cross.

This adds a '--tls-authz OBJECT-ID' option to the qemu-nbd command which
takes the ID of a previously added 'QAuthZ' object instance. This will
be used to validate the client's x509 distinguished name. Clients
failing the authorization check will not be permitted to use the NBD
server.

For example to setup authorization that only allows connection from a client
whose x509 certificate distinguished name is

   CN=laptop.example.com,O=Example Org,L=London,ST=London,C=GB

escape the commas in the name and use:

  qemu-nbd --object tls-creds-x509,id=tls0,dir=/home/berrange/qemutls,\
                    endpoint=server,verify-peer=yes \
           --object 'authz-simple,id=auth0,identity=CN=laptop.example.com,,\
                     O=Example Org,,L=London,,ST=London,,C=GB' \
           --tls-creds tls0 \
           --tls-authz authz0 \
	   ....other qemu-nbd args...

NB: a real shell command line would not have leading whitespace after
the line continuation, it is just included here for clarity.

Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <20190227162035.18543-2-berrange@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: split long line in --help text, tweak 233 to show that whitespace
after ,, in identity= portion is actually okay]
Signed-off-by: Eric Blake <eblake@redhat.com>
2019-03-06 11:05:27 -06:00
..
authz authz: add QAuthZPAM object type for authorizing using PAM 2019-02-26 15:32:19 +00:00
block qemu-nbd: add support for authorization of TLS clients 2019-03-06 11:05:27 -06:00
chardev char: move SpiceChardev and open_spice_port() to spice.h header 2019-02-21 14:09:17 +01:00
crypto Don't talk about the LGPL if the file is licensed under the GPL 2019-01-30 10:51:20 +01:00
disas target/mips: Add disassembler support for nanoMIPS 2018-10-25 22:13:33 +02:00
exec migration: Add an ability to ignore shared RAM blocks 2019-03-06 10:49:17 +00:00
fpu softfloat: Implement float128_to_uint32 2019-02-26 14:05:19 +00:00
hw Migation pull 2019-03-06 2019-03-06 14:50:33 +00:00
io io: Make qio_channel_yield() interruptible 2019-02-25 15:03:19 +01:00
libdecnumber Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
migration migration/ram.c: add the free page optimization enable flag 2019-03-06 10:49:18 +00:00
monitor monitor: Remove "x-oob", offer capability "oob" unconditionally 2018-12-12 10:28:27 +01:00
net net: Add a network device specific self-announcement ability 2019-03-05 11:27:41 +08:00
qapi qapi: remove qmp_unregister_command() 2019-02-18 14:44:05 +01:00
qemu Migation pull 2019-03-06 2019-03-06 14:50:33 +00:00
qom arm: Clarify the logic of set_pc() 2019-02-01 14:55:46 +00:00
scsi avoid TABs in files that only contain a few 2019-01-11 15:46:56 +01:00
standard-headers * cpu-exec fixes (Emilio, Laurent) 2019-02-05 19:39:22 +00:00
sysemu migration: Switch to using announce timer 2019-03-05 11:27:41 +08:00
ui spice: set device address and device display ID in QXL interface 2019-02-21 10:15:26 +01:00
elf.h pvh: Boot uncompressed kernel using direct boot ABI 2019-02-05 16:50:16 +01:00
glib-compat.h slirp: Move g_spawn_async_with_fds_qemu compatibility to slirp/ 2019-02-07 15:49:08 +02:00
qemu-common.h qemu-common.h: Update copyright string for 2019 2019-02-06 15:45:23 +01:00
qemu-io.h qemu-io: Let command functions return error code 2018-06-11 16:18:45 +02:00
trace-tcg.h trace: get rid of generated-events.h/generated-events.c 2016-10-12 09:54:52 +02:00