summaryrefslogtreecommitdiffstats
path: root/authz/Makefile.objs
diff options
context:
space:
mode:
authorDaniel P. Berrangé2018-05-11 13:19:59 +0200
committerDaniel P. Berrangé2019-02-26 16:32:18 +0100
commit55d869846de802a16af1a50584c51737bd664387 (patch)
tree31264ae5ec064fdc4c5cde1d5914f3c1e546ef87 /authz/Makefile.objs
parentauthz: add QAuthZList object type for an access control list (diff)
downloadqemu-55d869846de802a16af1a50584c51737bd664387.tar.gz
qemu-55d869846de802a16af1a50584c51737bd664387.tar.xz
qemu-55d869846de802a16af1a50584c51737bd664387.zip
authz: add QAuthZListFile object type for a file access control list
Add a QAuthZListFile object type that implements the QAuthZ interface. This built-in implementation is a proxy around the QAuthZList object type, initializing it from an external file, and optionally, automatically reloading it whenever it changes. To create an instance of this object via the QMP monitor, the syntax used would be: { "execute": "object-add", "arguments": { "qom-type": "authz-list-file", "id": "authz0", "props": { "filename": "/etc/qemu/vnc.acl", "refresh": true } } } If "refresh" is "yes", inotify is used to monitor the file, automatically reloading changes. If an error occurs during reloading, all authorizations will fail until the file is next successfully loaded. The /etc/qemu/vnc.acl file would contain a JSON representation of a QAuthZList object { "rules": [ { "match": "fred", "policy": "allow", "format": "exact" }, { "match": "bob", "policy": "allow", "format": "exact" }, { "match": "danb", "policy": "deny", "format": "glob" }, { "match": "dan*", "policy": "allow", "format": "exact" }, ], "policy": "deny" } This sets up an authorization rule that allows 'fred', 'bob' and anyone whose name starts with 'dan', except for 'danb'. Everyone unmatched is denied. The object can be loaded on the comand line using -object authz-list-file,id=authz0,filename=/etc/qemu/vnc.acl,refresh=yes Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'authz/Makefile.objs')
-rw-r--r--authz/Makefile.objs1
1 files changed, 1 insertions, 0 deletions
diff --git a/authz/Makefile.objs b/authz/Makefile.objs
index 921fa624d7..8351bf181d 100644
--- a/authz/Makefile.objs
+++ b/authz/Makefile.objs
@@ -1,3 +1,4 @@
authz-obj-y += base.o
authz-obj-y += simple.o
authz-obj-y += list.o
+authz-obj-y += listfile.o