Skip to content
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

formalize qrexec RPC semantics #1175

Open
cfm opened this issue Sep 22, 2024 · 2 comments
Open

formalize qrexec RPC semantics #1175

cfm opened this issue Sep 22, 2024 · 2 comments

Comments

@cfm
Copy link
Member

cfm commented Sep 22, 2024

After freedomofpress/securedrop-engineering#82 and freedomofpress/securedrop-client#1777, this is a stub proposal to suggest that we could formalize an RPC convention of JSON, CBOR, etc., over qrexec, such that:

  1. the standard input is a single-line (e.g.) JSON "request" object; and
  2. the standard output (exit code 0) is either (a) a single-line (e.g.) JSON "response" object or (b) a "raw" lower-level blob or stream;
  3. the standard error (any other exit code) is a single-line (e.g.) JSON error object.

Formalizing this would let us reuse rather than reinvent it, possibly including a minimal Python and/or Rust (a) library for the caller and (b) framework for the post-qrexec entrypoint.

Affected components

  • SecureDrop Client (sd-app)
  • proxy (sd-proxy)
  • GPG (sd-gpg)

People and roles

Problem Statement

Solution impact

Requirements and constraints

Exploration

Initial proposal

Selected proposal


See also

@cfm
Copy link
Member Author

cfm commented Sep 22, 2024

Notes from discussions at the Qubes OS Summit this week:

Type stdin stdout stderr rc We should it use for... ...with... ...for example...
Process Local, blocking RPC UNIX-process semantics Split GPG
Socket 0 Local, nonblocking streaming ??? freedomofpress/securedrop-client#1719
TCP1 0 Remote/networked proxying Transparency/agnosticism to the underlying wire protocol securedrop-proxy v3 (HTTP)

It's still an open question what serialization to use: that is, whether qrexec should insert a standard serialization between its call semantics (process, socket, TCP) and the callee's qrexec-oblivious I/O channels.

Footnotes

  1. From https://github.com/QubesOS/qubes-issues/issues/9037.

@cfm cfm changed the title formalize JSON-over-qrexec RPC formalize qrexec RPC semantics Sep 30, 2024
@cfm
Copy link
Member Author

cfm commented Sep 30, 2024

I've finished my notes in #1175 (comment) and updated the top of the ticket to reflect the following shift in my thinking since the Qubes OS Summit. Where I was originally focused on the input/output de/serialization (JSON, CBOR, etc.), I now think the most important question for us to consider here is whether we always want UNIX-process semantics for our qrexec calls. For example, in freedomofpress/securedrop-engineering#82, if we're fundamentally concerned with HTTP and especially REST endpoints upstream, why bother with process semantics (standard input, output, error; return code) when we could just do HTTP via a socket- or TCP-based qrexec service?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant