Open conorsch opened 6 years ago
@conorsch Finally!!! I was waiting for this ticket for some time now :) I would love to work on this.
This ticket was raised in the context of https://github.com/freedomofpress/securedrop-workstation/pull/324#issuecomment-554007697 where we have opted, for now, for a udev-rule-based approach in sys-usb
and qubes-rpc grants to allow sys-usb
to attach usb mass storage devices and printers to sd-export-usb
We have not opted for the Qubes Python API approach (for now), based on a discussion during the Nov 14th engineering meeting:
dom0
requires high degree of reliability and assurance. The udev solution in #324 simply requires RPC policies in dom0, attach logic is run in sys-usb.dom0
(e.g.: qvm-usb-attach
) can override Qubes RPC policies, we would need to manage our own policies and enforce these. Since Qubes provides these policies for inter-vm communication, we have opted for this upstream-maintained authorization for now.sd-export-usb
mirror the attachment to sys-usb
(the drives aren't auto mounted) , there is no incremental risk in doing this (sd-export-usb
is grsecurity-hardened, disposable, and should generally last for a session at most).Once we use Qubes Admin API for other tasks, it may be worth re-investigating the way devices are attached to sd-export-usb
Discussed briefly in backlog review today with @creviera and @conorsch . For configuration management, Salt remains our best option. VM creation and preference management seem good candidate for refactoring to use the Python API in the near future.
Keeping this around, as we're reducing overall use of Salt we can take an incremental approach here.
The Salt management logic (YAML files stored in
dom0/*.{sls,top}
) has proven rather problematic to work with. See this recent qubes-users thread (in which the SecureDrop Workstation project is named as one of the few examples of Salt usage in Qubes) for examples of community frustration. We can reasonably summarize the relevant pain points with Salt in terms of our needs as:dom0
configsqvm-run
.We already use the Qubes Python API for running a small suite of config tests in
dom0
. Expanding the use of the API to enforce state, rather than simply validate it, would dramatically reduce complexity of the VM config.We have several near-term changes incoming on the VM setup, so we should first push forward with the packaging logic in order to reduce the amount of Salt we're currently maintaining (by offloading the file-management logic into packages, for example). Once that work is done, we'll be left with a relatively small amount of Salt logic to port to Python.