The Workstation sends cleartext traffic to a local port (e.g., 5555).
stunnel listens on 5555, encrypts the traffic using TLS, and sends it to another local port (e.g., 6666).
A second stunnel process listens on 6666, decrypts the traffic, and hands it to the Gateway’s listening port.
But again somewhat we back to square one issue with local encryption how much it can be protected from local privileged attack (unless we can add linux file permission to where the encryption library (TLS) happening?).
Internal VM to VM Encryption
This will neglect the reliability on KVM or anything on the host, instead it will use an internal tool to encrypt the data in WS (e.g wireguard), send the data encrypted to the GW then read it in the VM.
But this will break stream isolation or any control over any packet coming from WS, as they will be all encrypted before leaving WS.
We are not using sockets to connect VMs. Instead UDP tunneling has been selected since it is readily usable without problems
While possible as almost anything is on Linux, I am not seeing a compelling use case for default implementation of inter VM networking encryption. If the host is compromised, sniffing traffic between guests is the least of your problems.
Stream isolation doesn’t necessarily break. The IP to IP encryption would be at a lower level (such as VPN). But VM to VM isn’t a great solution anyhow because then a secret has to be securely shared between the VMs. For example “copy key fingerprint in Whonix-Gateway, paste in specific file inside Whonix-Workstation”.