-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* extract-template-gui: Use 50-* policy files for salt-managed policy Add other necessary calls into sys-gui's policy Use new policy location for sys-gui's Admin API settings Separated common gui vm state into template-gui.jinja
- Loading branch information
Showing
3 changed files
with
73 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: set syntax=yaml ts=2 sw=2 sts=2 et : | ||
|
||
## | ||
# GUI Virtual Machine Common State Template | ||
# ============================== | ||
## | ||
|
||
{% macro gui_common(vmname) -%} | ||
# Setup Qubes RPC policy | ||
{{ vmname }}-rpc: | ||
file.managed: | ||
- name: /etc/qubes/policy.d/50-gui-{{ vmname }}.policy | ||
- contents: | | ||
qubes.GetImageRGBA * {{ vmname }} @tag:guivm-{{ vmname }} allow | ||
qubes.GetAppmenus * {{ vmname }} @tag:guivm-{{ vmname }} allow | ||
# TODO: limit to templates related to @tag:guivm-{{ vmname }} only | ||
qubes.GetAppmenus * {{ vmname }} @type:TemplateVM allow | ||
qubes.SetMonitorLayout * {{ vmname }} @tag:guivm-{{ vmname }} allow | ||
qubes.StartApp * {{ vmname }} @tag:guivm-{{ vmname }} allow | ||
qubes.StartApp * {{ vmname }} @dispvm:@tag:guivm-{{ vmname }} allow | ||
qubes.SyncAppMenus * @tag:guivm-{{ vmname }} dom0 allow target={{ vmname }} | ||
qubes.WindowIconUpdater * @tag:guivm-{{ vmname }} dom0 allow target={{ vmname }} | ||
qubes.WaitForSession * {{ vmname }} @tag:guivm-{{ vmname }} allow | ||
# Parts of Admin API necessary for GUI-related tools to work | ||
admin.vm.List * {{ vmname }} dom0 allow | ||
admin.vm.List * {{ vmname }} @tag:guivm-sys-gui allow target=dom0 | ||
admin.Events * {{ vmname }} dom0 allow | ||
admin.Events * {{ vmname }} @tag:guivm-sys-gui allow target=dom0 | ||
admin.label.Get * {{ vmname }} dom0 allow | ||
admin.label.Index * {{ vmname }} dom0 allow | ||
admin.vm.property.Get * {{ vmname }} dom0 allow | ||
admin.vm.volume.List * {{ vmname }} dom0 allow | ||
admin.vm.device.pci.Available * {{ vmname }} dom0 allow | ||
admin.vm.feature.Get +internal {{ vmname }} dom0 allow | ||
# TODO: find a way to avoid this one (ram, cpu usage) | ||
admin.vm.CurrentState * {{ vmname }} dom0 allow | ||
# GuiVM (AdminVM) with local 'rwx' permissions | ||
{{ vmname }}-admin-local-rwx: | ||
file.append: | ||
- name: /etc/qubes/policy.d/include/admin-local-rwx | ||
- text: | | ||
{{ vmname }} @tag:guivm-{{ vmname }} allow target=dom0 | ||
{{ vmname }} {{ vmname }} allow target=dom0 | ||
# GuiVM (AdminVM) with global 'ro' permissions | ||
{% if salt['pillar.get']('qvm:' + vmname + ':admin-global-permissions') == 'ro' %} | ||
{{ vmname }}-admin-global-ro: | ||
file.append: | ||
- name: /etc/qubes/policy.d/include/admin-global-ro | ||
- text: | | ||
{{ vmname }} @adminvm allow target=dom0 | ||
{{ vmname }} @tag:guivm-{{ vmname }} allow target=dom0 | ||
{{ vmname }} {{ vmname }} allow target=dom0 | ||
{% endif %} | ||
|
||
{% if salt['pillar.get']('qvm:' + vmname + ':admin-global-permissions') == 'rwx' %} | ||
# GuiVM (AdminVM) with global 'rwx' permissions | ||
{{ vmname }}-admin-global-rwx: | ||
file.append: | ||
- name: /etc/qubes/policy.d/include/admin-global-rwx | ||
- text: | | ||
{{ vmname }} @adminvm allow target=dom0 | ||
{{ vmname }} @tag:guivm-{{ vmname }} allow target=dom0 | ||
{{ vmname }} {{ vmname }} allow target=dom0 | ||
{% endif %} | ||
{%- endmacro %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters