Actions

Onionizing Repositories

About this Onionizing Repositories Page
Support Status stable
Difficulty easy
Maintainer 0brand
Support Support

Introduction[edit]

Starting with Whonix 14, Debian and Whonix packages are preferably updated using available onion services. Clearnet is used as a fallback. [1] However, users can opt to manually configure Debian and Whonix updates to take place exclusively via a Tor onion service for better security. This is currently undocumented.

Qubes package updates still point to repositories with a http:// URI. However, users can opt to manually configure Qubes package updates to take place via a Tor onion service.

There are several security and privacy benefits of using Tor onion services: [2]

  • The user cannot be uniquely targeted for malicious updates (attackers are forced to attack everyone requesting the update).
  • The package repository, or observers watching it, can't track what programs are installed.
  • The ISP cannot easily learn what packages are fetched.
  • End-to-end authentication and encryption provides protection against man-in-the-middle attacks (like version downgrade attacks).

Qubes Packages[edit]

Configuring Qubes to use Tor onion service repositories for updates is a simple process. Since Qubes .onion repositories definitions are installed by default, users only need to comment out the http:// URI repository definitions and uncomment the Tor .onion repositories definitions.

If the term "comment" is unfamiliar, please follow this link to learn how to comment / uncomment lines in a configuration file.

dom0[edit]

1. In a dom0 terminal, open the qubes-dom0.repo configuration file in a text editor.

sudo nano /etc/yum.repos.d/qubes-dom0.repo

Next, comment out (#) the 4 lines that contain qubes-os.org

Then, uncomment the 4 lines that contain sik5nlgfc5qylnnsr57qrbm64zbdx6t4lreyhpon3ychmxmiem7tioad.onion

When completed each of the 4 code blocks will have http repository lines similar to the following example.

#baseurl = http://yum.qubes-os.org/r$releasever/current/dom0/fc25
baseurl = http://yum.sik5nlgfc5qylnnsr57qrbm64zbdx6t4lreyhpon3ychmxmiem7tioad.onion/r$releasever/current/dom0/fc25

Save and exit.

2. In a dom0 terminal, open the qubes-templates.repo configuration file in a text editor.

sudo nano /etc/yum.repos.d/qubes-templates.repo

Next, comment out (#) all lines that contain qubes-os.org

Then, uncomment all lines that contain sik5nlgfc5qylnnsr57qrbm64zbdx6t4lreyhpon3ychmxmiem7tioad.onion

When completed each of the 2 code blocks will have http repository lines similar to the following example.

#baseurl = http://yum.qubes-os.org/r$releasever/templates-itl
baseurl = http://yum.sik5nlgfc5qylnnsr57qrbm64zbdx6t4lreyhpon3ychmxmiem7tioad.onion/r$releasever/templates-itl

Save and exit.

3. In dom0 terminal, confirm both onionized repositories are functional.

sudo qubes-dom0-update

Fedora Template[edit]

1. In Fedora TemplateVM, open the qubes-r4.repo configuration file in a text editor.

sudo gedit /etc/yum.repos.d/qubes-r4.repo

Next, comment out (#) all lines that contain qubes-os.org

Then, uncomment all lines that contain an sik5nlgfc5qylnnsr57qrbm64zbdx6t4lreyhpon3ychmxmiem7tioad.onion

When completed each of the 4 code blocks will have http repository lines similar to the following example.

#baseurl = http://yum.qubes-os.org/r4.0/current/vm/fc$releasever
baseurl = http://yum.sik5nlgfc5qylnnsr57qrbm64zbdx6t4lreyhpon3ychmxmiem7tioad.onion/r4.0/current/vm/fc$releasever

Save and exit.

2. In Fedora terminal, confirm the onionized repositories are functional.

sudo dnf update

Debian and Whonix Templates[edit]

1. In Debian and Whonix TempateVMs, open the sources.list file in a text editor.

sudo nano /etc/apt/sources.list.d/qubes-r*.list

2. Comment out (#) the first line under Main qubes updates repository.

The first code block should look similar to this.

 # Main qubes updates repository
#deb [arch=amd64] http://deb.qubes-os.org/r4.0/vm stretch main
#deb-src http://deb.qubes-os.org/r4.0/vm stretch main

3. Uncomment the corresponding line under Qubes Tor updates repositories.

The first code block should look similar to this.

# Qubes Tor updates repositories
# Main qubes updates repository
deb [arch=amd64] http://deb.sik5nlgfc5qylnnsr57qrbm64zbdx6t4lreyhpon3ychmxmiem7tioad.onion/r4.0/vm stretch main
#deb-src http://deb.sik5nlgfc5qylnnsr57qrbm64zbdx6t4lreyhpon3ychmxmiem7tioad.onion/r4.0/vm stretch main

Save and exit.

Fedora Packages[edit]

Updating Fedora packages in Qubes Fedora Template exclusively over onions is unavailable since Fedora does not provide updates over onions.

Whonix and Debian Packages[edit]

Whonix Templates[edit]

Debian Templates[edit]

Advanced Qubes-Whonix users may want to edit the sources.list of their Debian TemplateVM, so that it points to the Debian .onion mirrors. This is a more secure method for updates or general software installation.

1. Edit sources.list

Edit the debian.list file using an editor with root rights.

sudo nano /etc/apt/sources.list.d/debian.list

2. Reference the onionized Debian repositories.

Note: This setting below is for Debian stretch. Modify it accordingly if Debian buster is in use.

Cut and paste the following .onion mirrors and comment out (#) the corresponding http repositories.

#deb http://ftp.debian.org/debian stretch main contrib non-free
deb http://vwakviie2ienjx6t.onion/debian stretch main contrib non-free

#deb http://security.debian.org stretch/updates main contrib non-free
deb http://sgvtcaew4bxjd7ln.onion stretch/updates main contrib non-free

#Optional Backports
#deb http://ftp.debian.org/debian stretch-backports main contrib non-free
deb http://vwakviie2ienjx6t.onion/debian stretch-backports main contrib non-free

Save and exit.

3. Confirm the onionized repositories are functional.

sudo apt-get update && sudo apt-get dist-upgrade

Optionally repeat steps 1 to 3 for any other Debian templates in use.

Onionize Tor Project Updates[edit]

Only complete this step if the Newer Tor versions from The Tor Project Repository are being used. The Tor Project deb apt signing key must be added first (see the link above), or the user will receive error messages when completing these steps.

Non-Qubes-Whonix and Qubes-Whonix R3.2[edit]

The following commands are run in either the Whonix-Gateway or whonix-gw-14 TemplateVM.

To onionize Tor Project updates first create a torproject.list file using an editor with root rights.

If you are using a graphical Whonix or Qubes-Whonix, run.

kdesudo kwrite /etc/apt/sources.list.d/torproject.list

If you are using a terminal-only Whonix, run.

sudo nano /etc/apt/sources.list.d/torproject.list

Next, cut and paste the following text and comment out (#) the corresponding http repository.

#Tor Project Mirror
#deb http://deb.torproject.org/torproject.org stretch main
deb http://sdscoq7snqtznauu.onion/torproject.org stretch main

Save and exit.

Qubes R4[edit]

Add the Tor Signing Key[edit]

To work around this issue, users can fetch the Tor apt singing key from a (networked) anon-whonix AppVM, then copy the key over to whonix-gw-14 in a text file.

To add the Tor Project deb apt signing key, run the following in anon-whonix:

sudo apt-key adv --keyserver jirk5u4osbsr34t5.onion --recv-keys A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89

To display the keys fingerprint, run.

sudo apt-key adv --fingerprint A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89

Compare the fingerprint displayed in the terminal with the one listed on this website https://www.torproject.org/docs/signing-keys.html (v2 onion).

In anon-whonix, copy the Tor singing key to a new text file named tor.key

sudo apt-key export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 > /tmp/tor.key

In anon-whonix, copy the tor.key text file over to whonix-gw-14.

qvm-copy /tmp/tor.key whonix-gw-14

If the following error appears, it can be safely ignored (hit "OK" when prompted).

 qfile-agent: Fatal error: stat whonix-gw-14-version (error type: No such file or directory)

In whonix-gw-14, add the Tor signing key to the list of trusted keys.

sudo apt-key add ~/QubesIncoming/anon-whonix/tor.key

Onionize the Sources File[edit]

To onionize Tor Project updates first create a torproject.list file using an editor with root rights.

If you are using a graphical Whonix or Qubes-Whonix, run.

kdesudo kwrite /etc/apt/sources.list.d/torproject.list

If you are using a terminal-only Whonix, run.

sudo nano /etc/apt/sources.list.d/torproject.list

Next, cut and paste the following text and comment out (#) the corresponding http repository.

#Tor Project Mirror
#deb http://deb.torproject.org/torproject.org stretch main
deb http://sdscoq7snqtznauu.onion/torproject.org stretch main

Save and exit.

Footnotes[edit]


Random News:

Did you know that anyone can edit the Whonix wiki to improve it?


https | (forcing) onion

Share: Twitter | Facebook

This is a wiki. Want to improve this page? Help is welcome and volunteer contributions are happily considered! See Conditions for Contributions to Whonix, then Edit! IP addresses are scrubbed, but editing over Tor is recommended. Edits are held for moderation.

Whonix is a licensee of the Open Invention Network. Unless otherwise noted, the content of this page is copyrighted and licensed under the same Libre Software license as Whonix itself. (Why?)