-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On Thu, Apr 19, 2018 at 10:20:08PM +0200, viq wrote:
> Salt tools give a nice way to configure system (make sure templates exist
> with certain packages, prepare AppVMs based on them, etc). But I'd prefer
> to edit them in a customized editor, with syntax highlighting, etc, which
> is strongly discouraged from being put into dom0. I also feel that having
> version control over those files is the way to go, preferably synced
> somewhere so I can for example easily replicate this when setting up
> another computer or reinstalling.
>
> My understanding is that this is a perfect use case for new Admin API -
> have a machine with editor and git set up to adjust salt files, and either
> give admin permissions to that one, or use something like split-git that
> was mentioned to pull the repo into another VM and execute there.
Yes, exactly. In theory it should be easily possible to setup management
VM with appropriate policy (see [1]) and use salt from that VM. The
thing you need to change is to make qvm salt module [2] working in vm,
right now it explicitly checks if its running in dom0. Hopefully this is
the only change you need.
But there is one thing you can't that easily do over Admin API - various
dom0 settings. This include installing packages in dom0, editing various
configuration files (pam? bootloader? qrexec policy?). We're working on
the last one, but others are not solved right now. For multiple dom0
changes you still need to run salt in dom0.
For some cases, we use rpm packages to distribute salt formulas - this
include default setup (virtual-machines formula[3]) and our
infrastructure[4].
For my personal machine, I use salt in dom0 and synchronize this
configuration using signed tarballs, manually...
> Am I on the right track here? If so:
> 1) What packages do I need on admin VM to be able to do this?
Most likely qubes-mgmt-salt-dom0-qvm[2] with its dependencies and
probably minor changes will be enough. The dependencies include at least
python2-qubesadmin. Oh, and qubesctl itself is in
qubes-mgmt-salt-admin-tools[5].
> 2) Where and how should I be executing this? A quick test of running
> qubesctl inside a VM didn't even produce logs in dom0 journal, the command
> just complained it can't reach a daemon.
Client side of Admin API use /etc/qubes-release file to find if its
running in dom0 (and can take a shortcut to talk directly to qubesd), or
not. So I guess you installed package containing /etc/qubes-release,
which normally isn't present in VM. Simply remove the file and retry.
You should see some messages about denied admin.* qrexec calls.
> 3) What would be a good way to track and distribute necessary changes to
> /etc/qubes-rpc/policy/ on dom0?
See linked post[1] what changes are required. Normally I'd say, lets
package it in rpm, but since qrexec policy doesn't support .d
directories, it may not work that well. In many places we use salt's
file.prepend to adjust policy files, so maybe use it here too? This
start being quite complex:
1. Salt formula installed (via rpm?) in dom0, to configure management VM
2. Management VM running rest of salt formulas to configure other VMs
[1]
https://www.qubes-os.org/news/2017/06/27/qubes-admin-api/
[2]
https://github.com/QubesOS/qubes-mgmt-salt-dom0-qvm/
[3]
https://github.com/QubesOS/qubes-mgmt-salt-dom0-virtual-machines/
[4]
https://github.com/QubesOS/qubes-infrastructure/
[5]
https://github.com/QubesOS/qubes-mgmt-salt
- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAlrZ1FcACgkQ24/THMrX
1yzccAf/bInV6KALR82K9mt0yHYrE4N1IlHLyoaBmBi1QyNX/rqY+6/NInKl7Sit
VWpp4HBXcZBcqH9u0j9G1cJBQX3XrN84BLWLFJcRYUNRJkcqWH/DnOusDGuhCdvs
XC8sbwHtkRIueUFgMNpBSyWgyy8GjjSIoQItE7JxGkHMin5AGiNxlNZVY+TuFxV+
B59goJIjzuuUXZTXgkzasXeSLBUKVLUPKMOrgt6Jw1REV6WGwrl6ZDG3T4h7kGBY
zldTYhnxFbiBVX0GWVwGqSfEWjYJxX1/Yh5yNv7TTcZGQFFfBLex8MvMVwE/DEYq
kJ4qiQsj2iGVgFnNchQVB/KFz8eCbg==
=uBDd
-----END PGP SIGNATURE-----