TorVirt/README.md

69 lines
2.8 KiB
Markdown
Raw Permalink Normal View History

2023-05-25 22:12:53 +02:00
# TorVirt
2023-05-28 22:27:17 +02:00
[Whonix](https://www.whonix.org)-like setup with a [libvirt](https://libvirt.org) workstation and a [podman](https://podman.io) container as the [Tor](https://torproject.org) gateway.
2021-03-26 13:56:53 +01:00
2023-05-28 22:27:17 +02:00
![TorVirt illustration digram](images/diagram.svg)
2021-03-26 13:56:53 +01:00
2023-05-28 22:27:17 +02:00
## What are the advantage of this project over original Whonix ?
Whonix uses one VM for the workstation and another VM for the Tor gateway. This can be costly in terms of performance and resource usage. TorVirt improves on this by running the gateway in a lightweight container instead of a full VM.
2021-03-26 13:56:53 +01:00
## Is it as secure as Whonix ?
2023-05-28 22:27:17 +02:00
Containers share the same kernel as the host. This means that if someone manages to exploit a bug in software present in the container (such as the tor daemon) and then uses a vulnerability in the kernel, they could gain access to the host's operating system. To mitigate this risk, some measures have been put in place:
- The gateway container is created using podman in rootless mode
- The container runs with all capabilities dropped (`--cap-drop=ALL`)
- Container processes cannot gain additional privileges (`--security-opt=no-new-privileges`)
- The entry point is executed with normal user privileges
2021-03-26 13:56:53 +01:00
2023-05-31 10:46:29 +02:00
The risk on the workstation side depends on the guest OS, on the hypervisor used and on the interactions between the host and the VM (filesystem sharing, hardware passthrough, etc.)
2021-03-26 13:56:53 +01:00
# Use it !
Install dependencies (debian-based):
```
2023-05-31 10:46:29 +02:00
sudo apt-get install libvirt-daemon libvirt-clients podman
2021-03-26 13:56:53 +01:00
```
2023-05-28 22:27:17 +02:00
## Download
2021-03-26 13:56:53 +01:00
```
2023-05-28 23:19:44 +02:00
git clone --depth=1 https://forge.chapril.org/hardcoresushi/TorVirt.git
2021-03-26 13:56:53 +01:00
```
All commits should be signed with my OpenPGP key available on keyservers. You can import it like this:
```
2023-05-28 22:27:17 +02:00
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys AFE384344A45E13A
2021-03-26 13:56:53 +01:00
```
2023-05-28 22:27:17 +02:00
Fingerprint: `B64E FE86 CEE1 D054 F082 1711 AFE3 8434 4A45 E13A` \
2021-03-26 13:56:53 +01:00
Email: `Hardcore Sushi <hardcore.sushi@disroot.org>`
Once imported, verify the latest commit:
```
2023-05-28 23:19:44 +02:00
cd TorVirt
2021-03-26 13:56:53 +01:00
git verify-commit HEAD
```
2023-05-28 22:27:17 +02:00
This must show you something like:
2021-03-26 13:56:53 +01:00
```
gpg: Signature made <date> CET
2023-05-28 22:27:17 +02:00
gpg: using RSA key B64EFE86CEE1D054F0821711AFE384344A45E13A
2021-03-26 13:56:53 +01:00
gpg: Good signature from "Hardcore Sushi <hardcore.sushi@disroot.org>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
2023-05-28 22:27:17 +02:00
Primary key fingerprint: B64E FE86 CEE1 D054 F082 1711 AFE3 8434 4A45 E13A
2021-03-26 13:56:53 +01:00
```
2023-05-28 22:27:17 +02:00
**Do not continue if the verification fails !**
2021-03-26 13:56:53 +01:00
2023-05-28 22:27:17 +02:00
## Setup
2021-03-26 13:56:53 +01:00
```
2023-05-28 23:19:44 +02:00
./torvirt configure
2021-03-26 13:56:53 +01:00
```
## Create the workstation
2023-05-28 22:27:17 +02:00
You can create the workstation VM any way you like, with any OS, but you must select *torvirt* as the network. You can use [virt-manager](https://virt-manager.org) GUI to do it easily.
2021-03-26 13:56:53 +01:00
2023-05-28 22:27:17 +02:00
Make sure that *torvirt* is the only network configured for the VM, otherwise leaks may occur.
2021-03-26 13:56:53 +01:00
2023-05-28 22:27:17 +02:00
## Start
Start the gateway:
2021-03-26 13:56:53 +01:00
```
2023-05-28 23:19:44 +02:00
./torvirt start
2021-03-26 13:56:53 +01:00
```
2023-05-28 22:27:17 +02:00
Start the workstation !