freedomofpress / securedrop-workstation

Qubes-based SecureDrop Journalist Workstation environment for submission handling
GNU Affero General Public License v3.0
141 stars 43 forks source link

Consider consolidating and simplifying sd-whonix/sd-proxy #456

Open eloquence opened 4 years ago

eloquence commented 4 years ago

Because sd-proxy does not use a browser, there are only limited security benefits in the split VM architecture we currently use to access Tor. The complexity cost is significant. Post-beta, we should consider the advantages and disadvantages of different approaches:

1) No change 2) Using a single Whonix-based VM to run the proxy 3) Using a single Debian-based VM to run the proxy and managing Tor access / Firewall rules ourselves 4) Other options

conorsch commented 4 years ago

A balanced approach would still get us quite a reduction in complexity:

Since we merged #447, we're customizing the underlying whonix-gw-15 TemplateVM, but perhaps we could avoid that by changing the log aggregation approach (#463).

eaon commented 2 years ago

Given the workstation's limited needs, I think it's feasible to do this with Tor's transparent proxy support (see: TransPort and maybe MapAddress in the torrc manual) while using iptables/nftables to lock down requests the securedrop.Proxy calls can make. Happy to draw up a proposal when you'd like to look at this again.

eloquence commented 2 years ago

As one data point, most of my recent updater run failures have been due to update failures specifically on the Whonix templates, usually due to an "Invalid response from proxy: Unable to connect" tinyproxy error. This is with the clearnet repos configured, not the onion service ones. If this is a common experience, it may be more grist for the mill of either simplifying our Whonix config our eliminating the dependency on Whonix altogether.

eaon commented 2 years ago

Removing our dependency on Whonix would …

Practical aspects of replacing our use of Whonix gateway

Option 1

Connect sd-proxy to the internet directly, but isolate it as best as possible.

sd-proxy should:

Option 2

Create a new qube called sd-tor, essentially a simpler version of the Whonix gateway, which acts as a no-GUI netvm that transparently proxies traffic via Tor.

sd-tor should:

Implementation

There's some overlap between the two so I tried to summarise it, let me know if splitting this up would be helpful:

Personal preferences

While removing features (or fortuitous side effects) is hardly ever great, I think the trade-off here is worth it. I'd opt for Option 1. Please note, that would probably affect our threat model, but I think it'd be the setup that is easiest to understand/maintain and most "future proof" for when arti becomes viable.

In addition, I think there is an argument to be made that Option 1 should really be sd-proxy-dvm with sd-proxy being a "named DispVM" (not sure about the terminology here), because really we don't want persistence in every day operation (a mitigation not too dissimilar to Qubes' new default of making sys-usb disposable)

legoktm commented 2 years ago

I am a big +1 on this solely for "decrease the overall complexity of the workstation".

Minor nit: I think we should re-host tor debs for the workstation just like we do for the server. Or just grab them from bullseye-backports, which are kept roughly up to date with new Tor releases.

eaon commented 2 years ago

Regarding Option 1, I realised that we could use Qubes' firewall system for outgoing connections, which I think would be preferable, because it allows us to block access to private network addresses (10/8, 100.64/10, 172.16/12, 192.168/16 subnets) "outside" of sd-proxy. Blocking outgoing network access per-user (as in, only allow debian-tor to connect to anything but 127.0.0.1) would still have to live "inside" the qube though.

zenmonkeykstop commented 6 months ago

Still into this, will probably proceed with an arti-enhanced proxy, dropping the whonix requirement, once arti is stable and in general use.