From: Eric Blake <eblake@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>, qemu-devel@nongnu.org
Cc: "Andreas Färber" <afaerber@suse.de>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 08/11] authz: add QAuthZList object type for an access control list
Date: Thu, 21 Jun 2018 10:28:23 -0500 [thread overview]
Message-ID: <48a79954-a9a7-cd76-40f2-c99e69ffb087@redhat.com> (raw)
In-Reply-To: <20180615154203.11347-9-berrange@redhat.com>
On 06/15/2018 10:42 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.
>
>
> It is not currently possible to create this via -object, since there is
> no syntax supported to specify non-scalar properties for objects. This
> is likely to be addressed by later support for using JSON with -object,
> or an equivalent approach.
Is this statement slightly stale, since we have JSON support with
--object already?
>
> In any case the future "authz-listfile" object can be used from the
> CLI and is likely a better choice, as it allows the ACL to be refreshed
> automatically on change.
>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
> +++ 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: 3.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
The shell also has [] globbing: a[bc]d matches 'abd' and 'acd'. Worth
mentioning?
> +#
> +# Since: 3.0
> +##
> +{ 'enum': 'QAuthZListFormat',
> + 'prefix': 'QAUTHZ_LIST_FORMAT',
> + 'data': ['exact', 'glob']}
> +
> +##
> +# @QAuthZListRule:
> +#
> +# A single authorization rule.
> +#
> +# @match: a glob to match against a user identity
> +# @policy: the result to return if @match evaluates to true
> +# @format: (optional) the format of the @match rule (default 'exact')
> +#
> +# Since: 3.0
> +##
> +{ 'struct': 'QAuthZListRule',
> + 'data': {'match': 'str',
> + 'policy': 'QAuthZListPolicy',
> + '*format': 'QAuthZListFormat'}}
> +
> +##
> +# @QAuthZListRuleListHack:
> +#
> +# Not exposed via QMP; hack to generate QAuthZListRuleList
> +# for use internally by the code.
Someday, it would be nice if qom-set were fully specified rather than
requiring hacks like this. Oh well, not new to your patches. I take it
this is one case where order matters: the first rule that matches is
applied (with no further rules tested), even if later rules in the list
would also match.
> +#
> +# Since: 3.0
> +##
> +{ 'struct': 'QAuthZListRuleListHack',
> + 'data': { 'unused': ['QAuthZListRule'] } }
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2018-06-21 15:28 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-15 15:41 [Qemu-devel] [PATCH v2 00/11] Add a standard authorization framework Daniel P. Berrangé
2018-06-15 15:41 ` [Qemu-devel] [PATCH v2 01/11] util: add helper APIs for dealing with inotify in portable manner Daniel P. Berrangé
2018-06-15 15:41 ` [Qemu-devel] [PATCH v2 02/11] qom: don't require user creatable objects to be registered Daniel P. Berrangé
2018-06-15 15:41 ` [Qemu-devel] [PATCH v2 03/11] hw/usb: don't set IN_ISDIR for inotify watch in MTP driver Daniel P. Berrangé
2018-06-15 15:41 ` [Qemu-devel] [PATCH v2 04/11] hw/usb: fix const-ness for string params " Daniel P. Berrangé
2018-06-15 15:41 ` [Qemu-devel] [PATCH v2 05/11] hw/usb: switch MTP to use new inotify APIs Daniel P. Berrangé
2018-06-15 15:41 ` [Qemu-devel] [PATCH v2 06/11] authz: add QAuthZ object as an authorization base class Daniel P. Berrangé
2018-06-15 15:41 ` [Qemu-devel] [PATCH v2 07/11] authz: add QAuthZSimple object type for easy whitelist auth checks Daniel P. Berrangé
2018-06-15 15:42 ` [Qemu-devel] [PATCH v2 08/11] authz: add QAuthZList object type for an access control list Daniel P. Berrangé
2018-06-21 15:28 ` Eric Blake [this message]
2018-06-21 15:39 ` Daniel P. Berrangé
2018-06-21 16:36 ` Markus Armbruster
2018-06-22 8:41 ` Daniel P. Berrangé
2018-06-15 15:42 ` [Qemu-devel] [PATCH v2 09/11] authz: add QAuthZListFile object type for a file " Daniel P. Berrangé
2018-06-21 15:30 ` Eric Blake
2018-06-21 15:40 ` Daniel P. Berrangé
2018-06-15 15:42 ` [Qemu-devel] [PATCH v2 10/11] authz: add QAuthZPAM object type for authorizing using PAM Daniel P. Berrangé
2018-06-15 15:42 ` [Qemu-devel] [PATCH v2 11/11] authz: delete existing ACL implementation 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=48a79954-a9a7-cd76-40f2-c99e69ffb087@redhat.com \
--to=eblake@redhat.com \
--cc=afaerber@suse.de \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=dgilbert@redhat.com \
--cc=kraxel@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 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).