New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix architecture diagram on Admin API #2883

Closed
woju opened this Issue Jul 4, 2017 · 7 comments

Comments

Projects
None yet
3 participants
@woju
Member

woju commented Jul 4, 2017

The diagram https://www.qubes-os.org/attachment/wiki/AdminAPI/admin-api-architecture.svg is wrong in that policy query directly parses policy files (this is not done via qubesd), but from qubesd it only gets all vm's state dumped.

Cc: @marmarek @andrewdavidwong

@andrewdavidwong

This comment has been minimized.

Show comment
Hide comment
@andrewdavidwong

andrewdavidwong Jul 8, 2017

Member

@rootkovska: Are you the correct assignee for this task? If not, who is?

Member

andrewdavidwong commented Jul 8, 2017

@rootkovska: Are you the correct assignee for this task? If not, who is?

@rootkovska

This comment has been minimized.

Show comment
Hide comment
@rootkovska

rootkovska Jul 24, 2017

Member

I will make a new diagram as part of my upcoming new post about Core3.

Member

rootkovska commented Jul 24, 2017

I will make a new diagram as part of my upcoming new post about Core3.

@rootkovska

This comment has been minimized.

Show comment
Hide comment
@rootkovska

rootkovska Aug 17, 2017

Member

I've created a new diagram :) This is mainly intended for the upcoming post on core3, but should work for this page also.
Cc: @woju @marmarek
qubesd-arch

Member

rootkovska commented Aug 17, 2017

I've created a new diagram :) This is mainly intended for the upcoming post on core3, but should work for this page also.
Cc: @woju @marmarek
qubesd-arch

@woju

This comment has been minimized.

Show comment
Hide comment
@woju

woju Aug 17, 2017

Member
  • Policy check dashed arrow ("query about VMs [...]") should end at bot qubesd.sock and qubesd.internal.sock. It calls admin.vm.CreateDisposable and admin.vm.Start from qubesd.sock. I think this is an important detail that this is not just "query" but this can initiate some non-trivial actions, irrespective of the fact that this won't happen in typical AdminAPI scenario, which doesn't have $dispvm as permitted policy destination.
  • Currently qrexec services use qubesd-query-fast, not qubesd-query(.py).
  • Third case is when someone is using AdminAPI-enabled tools (like qvm-* CLI) from dom0 itself). Then the tool calls /etc/qubes-rpc/admin.* scripts via subprocess module and the policy is not evaluated.
Member

woju commented Aug 17, 2017

  • Policy check dashed arrow ("query about VMs [...]") should end at bot qubesd.sock and qubesd.internal.sock. It calls admin.vm.CreateDisposable and admin.vm.Start from qubesd.sock. I think this is an important detail that this is not just "query" but this can initiate some non-trivial actions, irrespective of the fact that this won't happen in typical AdminAPI scenario, which doesn't have $dispvm as permitted policy destination.
  • Currently qrexec services use qubesd-query-fast, not qubesd-query(.py).
  • Third case is when someone is using AdminAPI-enabled tools (like qvm-* CLI) from dom0 itself). Then the tool calls /etc/qubes-rpc/admin.* scripts via subprocess module and the policy is not evaluated.
@rootkovska

This comment has been minimized.

Show comment
Hide comment
@rootkovska

rootkovska Aug 21, 2017

Member

And here comes another iteration :)
qubesd-arch

Member

rootkovska commented Aug 21, 2017

And here comes another iteration :)
qubesd-arch

@woju

This comment has been minimized.

Show comment
Hide comment
@woju

woju Aug 22, 2017

Member

Ymmm, the third point from my previous comment is still pending. qvm-tools from dom0 run those yellow scripts (/etc/qubes-rpc/admin.vm.*), not the qubesd-query* tool. This is for those calls that have some logic in those scripts. Currently some storage calls have non-trivial scripts, for example *.volume.Import does not pipe the whole payload through qubesd like every other call, but saves it directly. (For simplicity of parser qubesd buffers whole call before handling it, so it is clamped at IIRC 64KiB, so we can't process multiple GB image).

For subconscious clarity, I'd also move the "AdminVM internal scripts..." node to the left of the yellow box, because those scripts run "in parallel" to "the other qvm-tools" from "GUI VM".

In every other respect, the graph is perfect. :)

Member

woju commented Aug 22, 2017

Ymmm, the third point from my previous comment is still pending. qvm-tools from dom0 run those yellow scripts (/etc/qubes-rpc/admin.vm.*), not the qubesd-query* tool. This is for those calls that have some logic in those scripts. Currently some storage calls have non-trivial scripts, for example *.volume.Import does not pipe the whole payload through qubesd like every other call, but saves it directly. (For simplicity of parser qubesd buffers whole call before handling it, so it is clamped at IIRC 64KiB, so we can't process multiple GB image).

For subconscious clarity, I'd also move the "AdminVM internal scripts..." node to the left of the yellow box, because those scripts run "in parallel" to "the other qvm-tools" from "GUI VM".

In every other respect, the graph is perfect. :)

@rootkovska

This comment has been minimized.

Show comment
Hide comment
@rootkovska

rootkovska Aug 23, 2017

Member

There are some limits to how much details one can put on a diagram, before its value diminishes greatly (after all the whole point of a diagram is to be some kind of a simplification of the sources, or else we would just link to the sources ;).

For the diagram above I've even debated whether to depict the qubesd-query* tool, as it really changes nearly nothing for the (security) arch (unlike e.g. qrexec vs socket calling, which implies policy protection or not), but I left it since it might be useful in debugging/playing with the qubesd API manually, so wanted it to be obvious that there is a tool for this.

(Yet your comment about policy check being able to create/start VMs was an important one).

Member

rootkovska commented Aug 23, 2017

There are some limits to how much details one can put on a diagram, before its value diminishes greatly (after all the whole point of a diagram is to be some kind of a simplification of the sources, or else we would just link to the sources ;).

For the diagram above I've even debated whether to depict the qubesd-query* tool, as it really changes nearly nothing for the (security) arch (unlike e.g. qrexec vs socket calling, which implies policy protection or not), but I left it since it might be useful in debugging/playing with the qubesd API manually, so wanted it to be obvious that there is a tool for this.

(Yet your comment about policy check being able to create/start VMs was an important one).

@rootkovska rootkovska closed this Aug 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment