I know how to restrict a clearnet qube to a specific host (through “Settings” tab or through qvm-firewall). I also understand that Whonix works through Tor proxy which itself requires connections to the Tor guard to work, so simply restricting a whonix-based qube “the clearnet way” would not work.
So, what is the correct way to restrict access of a whonix-based qube to specific host(s)?
So, what is the correct way to restrict access of a whonix-based qube to specific host(s)?
You should be able to put a firewall qube between the whonix gateway and its clients. Then just use qvm-firewall as usual on the respective client qube you want to restrict.
Possibly there’s already a firewall qube in fron of the whonix hosts by default - I haven’t used it in a while.
I’ve tried this myself and with the setup above if I restrict firewall to fsf.org tcp 443 then it works and it resolves subdomains as well. E.g. it works if you curl https://fsf.org and if you curl https://www.fsf.org.
But in this setup:
The DNS resolving won’t work because Whonix Workstations don’t use Qubes OS Virtual DNS servers (10.139.1.1, 10.139.1.2) and they assume that they are connected directly to sys-whonix and use the qube gateway IP (assuming it’ll be sys-whonix) as DNS server.
If you edit /etc/resolv.conf in client-qube (whonix-ws-17) and add nameserver 10.139.1.1 then it will resolve domains with dig fsf.org but internet won’t work because it’s configured to connect to sys-whonix directly. You’ll need to look for a way to fix these connections to sys-whonix through custom-firewall-qube.
You won’t de-anonymize yourself because that’s how Virtual DNS it works.
All incoming connections to DNS port in sys-whonix are redirected to its own DNS server so when connection request from client-qube to 10.139.1.1 is received by sys-whonix it’ll redirect it to its own DNS server and not to some other external DNS server 10.139.1.1.
Well, on second thought this:
Won’t work as well, because if you do this then your Qubes OS firewall restrictions won’t work as well because Whonix Workstation don’t access the external IPs directly, they use tor proxy in sys-whonix instead.
As @adrelanos stated in the topic on Whonix forum linked in the second post in this topic, you can try to use some filtering proxy in custom-firewall-qube but it won’t be easy to do.
Anyway, I think this topic belongs to Whonix forum since it’s more about how Whonix works and not about how Qubes works.
You explain what will not work.
I hope for an explanation about what will work
Anyway, I think this topic belongs to Whonix forum since it’s more about how Whonix works and not about how Qubes works.
It belongs here because it is about how to do it in Qubes OS. I can also see that same second post in the other forum suggests opening a thread here which is what I have done. That whonix forum thread also links to another thread on this forum and I have read everything in it. So, here we are.
I don’t know much about how Whonix works internally so I can’t help you with that. Only someone who know how Qubes-Whonix networking is done can help here. And it’d be easier to find such people in dedicated Whonix forum category Qubes-Whonix:
Well, I probably misread you used only DNSCrypt, not Anonymized DNSCrypt. Sorry.
While the communications themselves are secure, and while the
stateless nature of the DNSCrypt protocol helps against fingerprinting
individual devices, DNS server operators can still observe client IP
addresses.
A common way to prevent this is to use DNSCrypt over Tor or SOCKS
proxies. However, Tor significantly increases the latency of DNS
responses. And public SOCKS proxies are difficult to operate, as they
can easily be abused for purposes unrelated to DNS.
Anonymized DNSCrypt is a simple extension to the DNSCrypt v2 protocol,
allowing queries and responses to be relayed by an intermediate server.