I was messing with the RPC policy to get all DispVMs created by default-dvm to use split-gpg2.
In the guide server-qube and client qube is used. I used gpg-server and gpg-client.
First I went for:
qubes.Gpg2 * @anyvm @anyvm ask default_target=gpg-server or qubes.Gpg2 * @anyvm gpg-server
In addition to creating a config file the template that backs default-dvm and adding sudo bash -c 'echo "gpg-server" > /rw/config/gpg-split-domain'
Then I tried the same with Tags since I was thinking it’s a pretty wide net using @anyvm to ping my gpg-server. Am I right in thinking that a compromised VM could make requests to the gpg-server with the above policy?
With Tags the following worked well, and I’m thinking it gives far better isolation. That led me to think that it could be a good idea to update the split-gpg2 installation guide using this approach. If not, I’m happy to take on any comments or observations.
- Install split-gpg2 package in template for default-dvm and enable Service split-gpg2-client in default-dvm.
- Tag default-dvm in dom0 with
qvm-tags default-dvm add gpg-client. Now every DispVM spawned by default-dvm will inherit the tag gpg-client. - Update policy file in dom0 (/etc/qubes/policy.d/30-user-gpg2.policy) with:
# Allow only tagged VMs to ask to connect to gpg-server
qubes.Gpg2 * @tag:gpg-client @anyvm ask default_target=gpg-server
# Explicitly deny every other VM
qubes.Gpg2 * @anyvm @anyvm deny
This gives a pop-up to confirm any request between a tagged gpg-client and the gpg-server. I guess it could be a PITA to some work flows. If so, a more convenient approach without the pop-up (as long as the VM has the gpg-client tag), but less secure would be:
qubes.Gpg2 * @tag:gpg-client gpg-server allow
qubes.Gpg2 * @anyvm @anyvm deny
Would I be right in thinking that this approach gives far stricter isolation? Any disadvantages?
The original policy from the guide needed deleting to prevent conflict. Delete: qubes.Gpg2 + client-qube @default allow target=server-qube
And an additional tag was needed if you plan to keep the gpg-client laid out in the guide. qvm-tags gpg-client add gpg-client
In addition, I found that assigned tags can be inspected in dom0 with: qvm-tags --list | grep gpg-client or qvm-tags default-dvm to check individual VMs.
I’d love your input and opinions. Many thanks.