From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Kevin Wolf <kwolf@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
qemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>,
Juan Quintela <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v6 1/3] qemu-nbd: add support for authorization of TLS clients
Date: Wed, 27 Feb 2019 16:50:10 +0000 [thread overview]
Message-ID: <20190227165010.GP31688@redhat.com> (raw)
In-Reply-To: <29dfdc31-9e4d-88be-13f0-53e3f33d6800@redhat.com>
On Wed, Feb 27, 2019 at 10:43:40AM -0600, Eric Blake wrote:
> On 2/27/19 10:20 AM, Daniel P. Berrangé wrote:
> > From: "Daniel P. Berrange" <berrange@redhat.com>
> >
> > 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.
> >
>
> > +++ b/qemu-nbd.c
>
> > @@ -103,6 +105,7 @@ static void usage(const char *name)
> > " --object type,id=ID,... define an object such as 'secret' for providing\n"
> > " passwords and/or encryption keys\n"
> > " --tls-creds=ID use id of an earlier --object to provide TLS\n"
> > +" --tls-authz=ID use id of an earlier --object to provide authorization\n"
>
> Usage line exceeds 80 columns; I don't mind splitting the line.
Odd that checkpatch.pl didn't complain about this.
> > +== check TLS with authorization ==
> > +qemu-img: Could not open 'driver=nbd,host=127.0.0.1,port=10809,tls-creds=tls0': Failed to read option reply: Cannot read from TLS channel: Software caused connection abort
> > +qemu-img: Could not open 'driver=nbd,host=127.0.0.1,port=10809,tls-creds=tls0': Failed to read option reply: Cannot read from TLS channel: Software caused connection abort
>
> A rather uninformative message for the client to figure out why it
> failed, but (as with all things security-related), giving too many
> details may in itself be an improper information leak. At any rate, I
> don't know that you could make it work any better, so it is not a
> problem with this patch. It may be the sign of a server bug for closing
> the socket too soon (before the client has a chance to read an actual
> error message), where we could tweak things to provoke a nicer error
> than 'Software caused connection abort', but that would be a separate patch.
I'm not sure how we'd do anything better here. From NBD's pov the TLS
handshake failed to complete. At that point NBD can't assume that it is
able to successfully able to send anything over the connection, so has
little choice but to close it.
To some extent this is a result of the QIOChannelTLS API design, because
in acutal fact we've completed the TLS protocol handshake, so we do
actually have an established TLS connection, but we don't consider the
client authorized.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2019-02-27 16:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-27 16:20 [Qemu-devel] [PATCH v6 0/3] nbd: support for authorization control on TLS connections Daniel P. Berrangé
2019-02-27 16:20 ` [Qemu-devel] [PATCH v6 1/3] qemu-nbd: add support for authorization of TLS clients Daniel P. Berrangé
2019-02-27 16:43 ` Eric Blake
2019-02-27 16:50 ` Daniel P. Berrangé [this message]
2019-02-28 18:20 ` Eric Blake
2019-02-28 18:11 ` Eric Blake
2019-02-28 18:18 ` Daniel P. Berrangé
2019-02-28 18:27 ` Eric Blake
2019-02-27 16:20 ` [Qemu-devel] [PATCH v6 2/3] nbd: allow authorization with nbd-server-start QMP command Daniel P. Berrangé
2019-02-27 16:20 ` [Qemu-devel] [PATCH v6 3/3] nbd: fix outdated qapi docs syntax for tls-creds Daniel P. Berrangé
2019-02-27 16:44 ` Eric Blake
2019-02-28 18:41 ` [Qemu-devel] [PATCH v6 0/3] nbd: support for authorization control on TLS connections Eric Blake
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=20190227165010.GP31688@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).