Replace Whonix in favor of arti in sd-proxy#2561
Conversation
9a008e1 to
e277488
Compare
|
Can we do the Python key/conversion part as a one-time systemd service on VM boot (before arti starts) instead of for every proxy request? |
8c25c9d to
9317ef5
Compare
Companion PR for client change [1] with the aim of deprecating whonix,
in favor of delegating the tor connectivity aspect to sd-proxy running
arti.
Changes introduced:
1. sd-proxy connects to 'sys-firewall' directly:
since sd-proxy is now handling tor connections, it must connect
directly to the internet.
It keeps the original goal of preventing the client from being able
to connect to arbitrary domains. This is also something that
sd-whonix did not guarantee (it could connect to arbitrary domains,
albeit via Tor).
2. sd-whonix has access to onion service auth key
Access done via qubes feature vm-config.SD_PROXY_ORIGIN_KEY
3. sd-whonix removed
4. Install `securedrop-proxy-config` in sd-proxy template
[1]: freedomofpress/securedrop-client#2561
Test in ci: openqa
As mentioned earlier, this is exactly what I was trying to do after I got the base thing working. Even though we're still missing tests (fixing the old and adding new) and checking in on the apparmor situation, I'd say this is ready for initial review. But under the expectation that there will be further changes, if that sounds good @legoktm. |
|
legoktm
left a comment
There was a problem hiding this comment.
Just a first pass review, I will try to test this tomorrow.
|
On Wed, Aug 20, 2025 at 01:52:36PM -0700, Kunal Mehta wrote:
> what should we do regarding securedrop-qubesdb-tools
`rm -rf` IMO if there's no use for it, we can always restore it later on if we do have another use case.
Not only that: #2032 came about entirely to help configure Tor on the
Whonix gateway. If we no longer need to do QubesDB configuration at
boot, because everything we need to configure from QubesDB can do it at
runtime, that's a Good Thing. :-)
|
Per suggestion in [1], and following the conclusions in this pull request [2] [1]: #2561 (comment) [2]: freedomofpress/securedrop#7404
Companion PR for client change [1] with the aim of deprecating whonix,
in favor of delegating the tor connectivity aspect to sd-proxy running
arti.
Changes introduced:
1. sd-proxy connects to 'sys-firewall' directly:
since sd-proxy is now handling tor connections, it must connect
directly to the internet.
It keeps the original goal of preventing the client from being able
to connect to arbitrary domains. This is also something that
sd-whonix did not guarantee (it could connect to arbitrary domains,
albeit via Tor).
2. sd-whonix has access to onion service auth key
Access done via qubes feature vm-config.SD_PROXY_ORIGIN_KEY
3. sd-whonix removed
4. Install `securedrop-proxy-config` in sd-proxy template
[1]: freedomofpress/securedrop-client#2561
Test in ci: openqa
Companion PR for client change [1] with the aim of deprecating whonix,
in favor of delegating the tor connectivity aspect to sd-proxy running
arti.
Changes introduced:
1. sd-proxy connects to 'sys-firewall' directly:
since sd-proxy is now handling tor connections, it must connect
directly to the internet.
It keeps the original goal of preventing the client from being able
to connect to arbitrary domains. This is also something that
sd-whonix did not guarantee (it could connect to arbitrary domains,
albeit via Tor).
2. sd-whonix has access to onion service auth key
Access done via qubes feature vm-config.SD_PROXY_ORIGIN_KEY
3. sd-whonix removed
4. Install `securedrop-proxy-config` in sd-proxy template
[1]: freedomofpress/securedrop-client#2561
Test in ci: openqa
Companion PR for client change [1] with the aim of deprecating whonix,
in favor of delegating the tor connectivity aspect to sd-proxy running
arti.
Changes introduced:
1. sd-proxy connects to 'sys-firewall' directly:
since sd-proxy is now handling tor connections, it must connect
directly to the internet.
It keeps the original goal of preventing the client from being able
to connect to arbitrary domains. This is also something that
sd-whonix did not guarantee (it could connect to arbitrary domains,
albeit via Tor).
2. sd-whonix has access to onion service auth key
Access done via qubes feature vm-config.SD_PROXY_ORIGIN_KEY
3. sd-whonix removed
4. Install `securedrop-proxy-config` in sd-proxy template
[1]: freedomofpress/securedrop-client#2561
Test in ci: openqa
Companion PR for client change [1] with the aim of deprecating whonix,
in favor of delegating the tor connectivity aspect to sd-proxy running
arti.
Changes introduced:
1. sd-proxy connects to 'sys-firewall' directly:
since sd-proxy is now handling tor connections, it must connect
directly to the internet.
It keeps the original goal of preventing the client from being able
to connect to arbitrary domains. This is also something that
sd-whonix did not guarantee (it could connect to arbitrary domains,
albeit via Tor).
2. sd-whonix has access to onion service auth key
Access done via qubes feature vm-config.SD_PROXY_ORIGIN_KEY
3. sd-whonix removed
4. Install `securedrop-proxy-config` in sd-proxy template
[1]: freedomofpress/securedrop-client#2561
Test in ci: openqa
|
@legoktm FYI, the complementary workstation PR is not yet fully working. But to test this you can manually set the following:
|
129f8ec to
5044df3
Compare
Great! I'll remove it, then. I've added it as a TODO item in the first post. |
Companion PR for client change [1] with the aim of deprecating whonix,
in favor of delegating the tor connectivity aspect to sd-proxy running
arti.
Changes introduced:
1. sd-proxy connects to 'sys-firewall' directly:
since sd-proxy is now handling tor connections, it must connect
directly to the internet.
It keeps the original goal of preventing the client from being able
to connect to arbitrary domains. This is also something that
sd-whonix did not guarantee (it could connect to arbitrary domains,
albeit via Tor).
2. sd-proxy has access to onion service auth key
Access done via qubes feature vm-config.SD_PROXY_ORIGIN_KEY
[1]: freedomofpress/securedrop-client#2561
Test in ci: openqa
|
I got all of CI passing today; I meant to rebase it into a cleaner git history but didn't get to that today; will do so tomorrow and mark this as formally ready for review. I'll also test integration with #2644. |
|
I got this working today and ran into two things:
|
Companion PR for client change [1] with the aim of deprecating whonix,
in favor of delegating the tor connectivity aspect to sd-proxy running
arti.
Changes introduced:
1. sd-proxy connects to 'sys-firewall' directly:
since sd-proxy is now handling tor connections, it must connect
directly to the internet.
It keeps the original goal of preventing the client from being able
to connect to arbitrary domains. This is also something that
sd-whonix did not guarantee (it could connect to arbitrary domains,
albeit via Tor).
2. sd-proxy has access to onion service auth key
Access done via qubes feature vm-config.SD_PROXY_ORIGIN_KEY
[1]: freedomofpress/securedrop-client#2561
Test in ci: openqa
|
I didn't realize that systemd-sysusers doesn't create the home directory of |
c0a3ccc to
edce2a0
Compare
|
I've cleaned up the Git history and verified that it works as expected, should be actually ready for review :) |
Run `make build-debs-arti` to build a `securedrop-arti` package. We build it separately since it's pretty slow with high resource requirements and will be changing at a different schedule than our current release schedule (like how we handle Tor on the server). The version is set in arti/debian/changelog, it clones the upstream Git repo, verifies the PGP signature against arti/upstream-keys (fetched from keys.openpgp.org), builds the `arti` binary and includes it in a Debian package. The package creates an `_arti` user with the same home directory as Arti upstream intends to use. No systemd unit is included in this commit, for now it's being shipped in the securedrop-proxy package (see #2561).
Run `make build-debs-arti` to build a `securedrop-arti` package. We build it separately since it's pretty slow with high resource requirements and will be changing at a different schedule than our current release schedule (like how we handle Tor on the server). The version is set in arti/debian/changelog, it clones the upstream Git repo, verifies the PGP signature against arti/upstream-keys (fetched from keys.openpgp.org), builds the `arti` binary and includes it in a Debian package. The package creates an `_arti` user with the same home directory as Arti upstream intends to use. No systemd unit is included in this commit, for now it's being shipped in the securedrop-proxy package (see #2561).
edce2a0 to
1aa0d25
Compare
cfm
left a comment
There was a problem hiding this comment.
This works great. Just a few questions and suggestions inline.
Assuming running in a qube connected to sys-firewall (will be a workstation PR of its own) and with arti running in proxy mode, this allows the proxy to connect direct to the onion address. This is coupled with workstation PR that: - sets sd-proxy to connect to sys-firewall instead of sys-vpn - installs arti package in sd-proxy's template - starts arti in proxy mode in sd-proxy on startup - sets via qubesdb vm-config.SD_PROXY_ORIGIN value Setting the onion service authentication key is done in a follow-up. Developers can set a `DISABLE_TOR` environment variable to avoid using a SOCKS proxy, and both the client and app do so. Towards freedomofpress/securedrop-workstation#456
Onion service key passed as "SD_PROXY_ORIGIN_KEY" via qubesdb (production) or environment variables (testing), following project standards. The "get_env()" function was duplicated from securedrop-qubesdb-tools, since it was not usable directly as a library. On top of that, its only use-case was securedrop-whonix-config, which is now going to be removed. We need to convert the key from the CTor format to Arti, which isn't yet available from upstream. This is based on @lsd-cat's initial conversion script[1]. For more context see [2]. Fixes freedomofpress/securedrop-workstation#1382. [1]: https://gist.github.com/lsd-cat/d3bd05412d83628be7145462081462f9 [2]: freedomofpress/securedrop-workstation#1382 (comment) Co-authored-by: lsd-cat <giulio@gmx.com>
The previous qubesdb-templated file was replaced with a boilerplate python script, since a templated file is not good enough for the key conversions necessary to convert an ctor client key to an arti one. A securedrop-arti systemd service was added, it's based on upstream's [1], but systemd mitigations regarding read/read-write directories were not included due to not working out-of-the box, combined with the fact that the proxy is expected not to keep any state. It runs as a separate `_arti` user. For now we're not protecting it with apparmor, but can take advantage of whatever upstream does later. [1]: https://gitlab.torproject.org/tpo/core/arti/-/blob/084c2dee/debian/systemd/arti.service
* Remove a postinst edge-case since securedrop-workstation-config is no longer installed on any whonix-based VM. * Remove from mermaid diagrams; this was checked against the proxy v3 implementation in [1] and adapted from the previous diagrams that had added a bit more detail to what was originally proposed. [1]: #2453
1aa0d25 to
d5fdbb4
Compare
There was a problem hiding this comment.
All persuasive! Thanks, @deeplow and @legoktm. Merging to unblock freedomofpress/securedrop-workstation#1414 per freedomofpress/securedrop-workstation#1414 (comment).
Description
Towards freedomofpress/securedrop-workstation#456
sd-proxyto connect tosys-firewallinstead ofsys-vpninstalls arti package in sd-proxy's template(out of scope)sd-proxyon startup (via systemd)vm-config.SD_PROXY_ORIGIN_KEYvaluewhonix-configintoproxy-configcheck apparmor situationhandling in Build a securedrop-arti package #2644Test Plan
Preparation:
make devwith Prepares path forsd-whonixwhonix removal securedrop-workstation#1414 (companion workstation PR)sd-small-bookworm-templateunder/usr/bin/articargo build --release --locked --bin arti)sd-small-bookworm-template(try-client-prshould work here)sd-small-bookworm-templatesd-proxyTest: