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

Configure securedrop-proxy via QubesDB #853

Closed
legoktm opened this issue Feb 2, 2023 · 7 comments · Fixed by freedomofpress/securedrop-client#1718
Closed

Configure securedrop-proxy via QubesDB #853

legoktm opened this issue Feb 2, 2023 · 7 comments · Fixed by freedomofpress/securedrop-client#1718
Assignees

Comments

@legoktm
Copy link
Member

legoktm commented Feb 2, 2023

(Not my idea, mostly relaying what @eaon told me)

Currently we provision a config.yaml in the sd-proxy VM to configure the securedrop-proxy component. Among other things, this means that sd-proxy has to have persistent storage and can't be a dispVM like sys-firewall.

Instead, we could configure it via QubesDB (see https://www.qubes-os.org/doc/vm-interface/) and read the configuration from there.

Sidenote, this would also take care of freedomofpress/securedrop-client#1684.

@legoktm
Copy link
Member Author

legoktm commented Feb 2, 2023

To register an extension with Qubes via the setuptools entrypoint, something like:

setup(
    name='entrypoint-demo',
    version='0.0.1',
    packages=['entrypoint_demo'],
    entry_points={
        'qubes.ext': [
            'qubes.ext.demo = entrypoint_demo:DemoExtension'
        ],
    }
)

should do it. The catch is that the .egg-info needs to be actually installed, so the entrypoint config is picked up:

$ cat entrypoint_demo.egg-info/entry_points.txt 
[qubes.ext]
qubes.ext.demo = entrypoint_demo:DemoExtension

@rocodes
Copy link
Contributor

rocodes commented Feb 2, 2023

This makes sense to me, but I just want to make sure that I understand the steps (this is as much a question for @eaon as anyone):

  • Add custom Qubes extension defining the qubesdb key(s) that we want to use and their scope (i.e. that they are written to the untrusted vm accessible part of qubesdb)
  • Include the above setuptools entrypoint in an rpm installed on dom0 (our existing dom0 rpm?)
  • Modify Salt provisioning logic to write the correct qubesdb value(s) to the target VM (eg sd-proxy)
  • Modify the target vm (eg sd-proxy) to read from qubesdb

Is this on the right track?

@eaon
Copy link
Contributor

eaon commented Feb 2, 2023

Pretty much!

  1. The qubes-features key-value store extension would only define the "base" namespace (or tree, technically), the keys we use for configuring anything else is up to future-us, and per thing-we-want-to-do.
    • I'm not entirely sure what you mean by untrusted vm though, can you elaborate?
  2. Yes
  3. Yes, technically qubes-features, as they will be then set up for qubesdb automatically when a VM boots
  4. 💯

@rocodes
Copy link
Contributor

rocodes commented Feb 3, 2023

I'm not entirely sure what you mean by untrusted vm though, can you elaborate?

Sorry, just meant the vm-readable part of qubesdb, referred to as "untrusted" in the upstream source code. (i.e. vm.untrusted_qdb.write(my_custom_prefix/my_key, my_value)

@marmarek
Copy link

FYI QubesOS/qubes-issues#8138

@eaon
Copy link
Contributor

eaon commented Apr 14, 2023

Looks like the infrastructure necessary to do this will be taken care of by R4.2 😄 Thank you @marmarta and @marmarek 🙌

@legoktm
Copy link
Member Author

legoktm commented May 2, 2024

The dom0 part of this landed in #1001, proxy side will be in freedomofpress/securedrop-client#1718.

legoktm added a commit to freedomofpress/securedrop-client that referenced this issue May 2, 2024
We are setting the proxy's origin in QubesDB (via dom0 salt), and as
discussed/agreed upon in
<freedomofpress/securedrop-workstation#1013>,
we're reading it directly in the proxy.

We link directly to libqubesdb, generating the Rust wrapper with bindgen
so it stays in sync (at build time at least). As a result, some unsafe
is needed, but it is clearly annotated with relevant SAFETY notes.

If we're not building with QubesDB (for development purposes), we'll
continue to read from the environment and skip the bindgen and linking
steps entirely.

Fixes <freedomofpress/securedrop-workstation#853>.

Co-authored-by: Kunal Mehta <[email protected]>
legoktm added a commit to freedomofpress/securedrop-client that referenced this issue May 2, 2024
We are setting the proxy's origin in QubesDB (via dom0 salt), and as
discussed/agreed upon in
<freedomofpress/securedrop-workstation#1013>,
we're reading it directly in the proxy.

We link directly to libqubesdb, generating the Rust wrapper with bindgen
so it stays in sync (at build time at least). As a result, some unsafe
is needed, but it is clearly annotated with relevant SAFETY notes.

If we're not building with QubesDB (for development purposes), we'll
continue to read from the environment and skip the bindgen and linking
steps entirely.

Fixes <freedomofpress/securedrop-workstation#853>.

Co-authored-by: Kunal Mehta <[email protected]>
legoktm added a commit to freedomofpress/securedrop-client that referenced this issue May 2, 2024
We are setting the proxy's origin in QubesDB (via dom0 salt), and as
discussed/agreed upon in
<freedomofpress/securedrop-workstation#1013>,
we're reading it directly in the proxy.

We link directly to libqubesdb, generating the Rust wrapper with bindgen
so it stays in sync (at build time at least). As a result, some unsafe
is needed, but it is clearly annotated with relevant SAFETY notes.

If we're not building with QubesDB (for development purposes), we'll
continue to read from the environment and skip the bindgen and linking
steps entirely.

Fixes <freedomofpress/securedrop-workstation#853>.

Co-authored-by: Kunal Mehta <[email protected]>
cfm added a commit to freedomofpress/securedrop-client that referenced this issue May 8, 2024
We are setting the proxy's origin in QubesDB (via dom0 salt), and as
discussed/agreed upon in
<freedomofpress/securedrop-workstation#1013>,
we're reading it directly in the proxy.

We link directly to libqubesdb, generating the Rust wrapper with bindgen
so it stays in sync (at build time at least). As a result, some unsafe
is needed, but it is clearly annotated with relevant SAFETY notes.

If we're not building with QubesDB (for development purposes), we'll
continue to read from the environment and skip the bindgen and linking
steps entirely.

Fixes <freedomofpress/securedrop-workstation#853>.

Co-authored-by: Kunal Mehta <[email protected]>
legoktm added a commit to freedomofpress/securedrop-client that referenced this issue May 15, 2024
We are setting the proxy's origin in QubesDB (via dom0 salt), and as
discussed/agreed upon in
<freedomofpress/securedrop-workstation#1013>,
we're reading it directly in the proxy.

We link directly to libqubesdb, generating the Rust wrapper with bindgen
so it stays in sync (at build time at least). As a result, some unsafe
is needed, but it is clearly annotated with relevant SAFETY notes.

If we're not building with QubesDB (for development purposes), we'll
continue to read from the environment and skip the bindgen and linking
steps entirely.

Fixes <freedomofpress/securedrop-workstation#853>.

Co-authored-by: Kunal Mehta <[email protected]>
micahflee pushed a commit to freedomofpress/securedrop-client that referenced this issue May 16, 2024
We are setting the proxy's origin in QubesDB (via dom0 salt), and as
discussed/agreed upon in
<freedomofpress/securedrop-workstation#1013>,
we're reading it directly in the proxy.

We link directly to libqubesdb, generating the Rust wrapper with bindgen
so it stays in sync (at build time at least). As a result, some unsafe
is needed, but it is clearly annotated with relevant SAFETY notes.

If we're not building with QubesDB (for development purposes), we'll
continue to read from the environment and skip the bindgen and linking
steps entirely.

Fixes <freedomofpress/securedrop-workstation#853>.

Co-authored-by: Kunal Mehta <[email protected]>
legoktm added a commit to freedomofpress/securedrop-client that referenced this issue May 17, 2024
We are setting the proxy's origin in QubesDB (via dom0 salt), and as
discussed/agreed upon in
<freedomofpress/securedrop-workstation#1013>,
we're reading it directly in the proxy.

We link directly to libqubesdb, generating the Rust wrapper with bindgen
so it stays in sync (at build time at least). As a result, some unsafe
is needed, but it is clearly annotated with relevant SAFETY notes.

If we're not building with QubesDB (for development purposes), we'll
continue to read from the environment and skip the bindgen and linking
steps entirely.

Fixes <freedomofpress/securedrop-workstation#853>.

Co-authored-by: Kunal Mehta <[email protected]>
@github-project-automation github-project-automation bot moved this from In Progress to Done in SecureDrop dev cycle May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants