All of lore.kernel.org
 help / color / mirror / Atom feed
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>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Michael Roth" <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PULL 08/11] authz: add QAuthZList object type for an access control list
Date: Tue, 26 Feb 2019 15:29:21 +0000	[thread overview]
Message-ID: <20190226152921.GL23014@redhat.com> (raw)
In-Reply-To: <d7c93cff-7973-5248-2194-c386cf145505@redhat.com>

On Mon, Feb 25, 2019 at 08:36:33AM -0600, Eric Blake wrote:
> I missed reviewing this before the pull request, so comments here are
> best for a followup patch:
> 
> On 2/25/19 6:31 AM, Daniel P. Berrangé wrote:
> > From: "Daniel P. Berrange" <berrange@redhat.com>
> > 
> > Add a QAuthZList object type that implements the QAuthZ interface. This
> > built-in implementation maintains a trivial access control list with a
> > sequence of match rules and a final default policy. This replicates the
> > functionality currently provided by the qemu_acl module.
> > 
> 
> > Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> > Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> > Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> > ---
> 
> > +++ b/qapi/Makefile.objs
> > @@ -7,7 +7,7 @@ util-obj-y += qapi-util.o
> >  
> >  QAPI_COMMON_MODULES = block-core block char common crypto introspect
> >  QAPI_COMMON_MODULES += job migration misc net rdma rocker run-state
> > -QAPI_COMMON_MODULES += sockets tpm trace transaction ui
> > +QAPI_COMMON_MODULES += sockets tpm trace transaction ui authz
> 
> Let's keep this list alphabetically sorted (authz before block-core).
> 
> > +++ b/qapi/authz.json
> > @@ -0,0 +1,58 @@
> > +# -*- Mode: Python -*-
> > +#
> > +# QAPI authz definitions
> > +
> > +##
> > +# @QAuthZListPolicy:
> > +#
> > +# The authorization policy result
> > +#
> > +# @deny: deny access
> > +# @allow: allow access
> > +#
> > +# Since: 4.0
> > +##
> > +{ 'enum': 'QAuthZListPolicy',
> > +  'prefix': 'QAUTHZ_LIST_POLICY',
> > +  'data': ['deny', 'allow']}
> > +
> > +##
> > +# @QAuthZListFormat:
> > +#
> > +# The authorization policy result
> > +#
> > +# @exact: an exact string match
> > +# @glob: string with ? and * shell wildcard support
> 
> Does it actually use glob() (in which case it also has [] glob support?)

No, it uses g_pattern_match as glob() isn't cross-platform, and
this only supports ? and *

https://developer.gnome.org/glib/stable/glib-Glob-style-pattern-matching.html

  "The g_pattern_match* functions match a string against a 
   pattern containing '*' and '?' wildcards with similar 
   semantics as the standard glob() function: '*' matches 
   an arbitrary, possibly empty, string, '?' matches an 
   arbitrary character.

   Note that in contrast to glob(), the '/' character can 
   be matched by the wildcards, there are no '[...]' 
   character ranges and '*' and '?' can not be escaped to
   include them literally in a pattern."

> > +##
> > +# @QAuthZListRule:
> > +#
> > +# A single authorization rule.
> > +#
> > +# @match: a glob to match against a user identity
> 
> Should this read 'a string or glob to match...' since...
> 
> > +# @policy: the result to return if @match evaluates to true
> > +# @format: (optional) the format of the @match rule (default 'exact')
> 
> ...format controls which of the two styles it is interpreted as?  The
> use of '(optional)' is not required in the current QAPI doc generator,
> and in fact results in redundant output.

This shows how long this pach series has been waiting to merge....

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 :|

  parent reply	other threads:[~2019-02-26 15:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-25 12:31 [Qemu-devel] [PULL 00/11] Merge authz core patches Daniel P. Berrangé
2019-02-25 12:31 ` [Qemu-devel] [PULL 01/11] util: add helper APIs for dealing with inotify in portable manner Daniel P. Berrangé
2019-02-25 12:31 ` [Qemu-devel] [PULL 02/11] qom: don't require user creatable objects to be registered Daniel P. Berrangé
2019-02-25 12:31 ` [Qemu-devel] [PULL 03/11] hw/usb: don't set IN_ISDIR for inotify watch in MTP driver Daniel P. Berrangé
2019-02-25 12:31 ` [Qemu-devel] [PULL 04/11] hw/usb: fix const-ness for string params " Daniel P. Berrangé
2019-02-25 12:31 ` [Qemu-devel] [PULL 05/11] hw/usb: switch MTP to use new inotify APIs Daniel P. Berrangé
2019-02-25 12:31 ` [Qemu-devel] [PULL 06/11] authz: add QAuthZ object as an authorization base class Daniel P. Berrangé
2019-02-25 12:31 ` [Qemu-devel] [PULL 07/11] authz: add QAuthZSimple object type for easy whitelist auth checks Daniel P. Berrangé
2019-02-25 12:31 ` [Qemu-devel] [PULL 08/11] authz: add QAuthZList object type for an access control list Daniel P. Berrangé
2019-02-25 14:36   ` Eric Blake
2019-02-26  6:04     ` Markus Armbruster
2019-02-26 15:29     ` Daniel P. Berrangé [this message]
2019-02-25 12:31 ` [Qemu-devel] [PULL 09/11] authz: add QAuthZListFile object type for a file " Daniel P. Berrangé
2019-02-25 12:31 ` [Qemu-devel] [PULL 10/11] authz: add QAuthZPAM object type for authorizing using PAM Daniel P. Berrangé
2019-02-25 12:31 ` [Qemu-devel] [PULL 11/11] authz: delete existing ACL implementation Daniel P. Berrangé
2019-02-26 19:04 ` [Qemu-devel] [PULL 00/11] Merge authz core patches Peter Maydell
2019-02-26 19:07   ` Philippe Mathieu-Daudé
2019-02-26 19:09     ` Peter Maydell
2019-02-27 11:12       ` Daniel P. Berrangé
2019-02-27  9:31     ` Daniel P. Berrangé

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=20190226152921.GL23014@redhat.com \
    --to=berrange@redhat.com \
    --cc=afaerber@suse.de \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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.