While working on Ricochet to make it the a post-TCP/IP IM client, special and I have been considering ways to sandbox it further. We decided it would be nice to have a way to mark a given tor SOCKS (unix socket) listener as only allowing connections to .onion addresses.
This is similar to setting the option to not allow IPv4 - except we don't want DNS, IPv6 or any connection except to an onion service.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items 0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items 0
Link issues together to show that they're related.
Learn more.
Log message should be using safe_str_client. Also, this one is LD_NET, but the others were LD_APP.
--
I really wish we had automated tests to make sure connections actually fail when the port policy should reject them. I guess that might be hard to do right now.
Code looks ok to me other than the above. Haven't tested it myself yet.
Ok I jumped on this one so we can move it forward for 029. The code is good! I've rebased it on master and fixed special's comment in fixup commit c39110f.
I've also added two extra fixup commits for minor syntax issues in comments. I've tested all options and it works fine.
Although, I would really want an explanation for commit a6f8fe9 (like special mentioned). Why is this a fix all of a sudden? Maybe we can improve the comment there telling us why we do that?
log_warn(LD_CONFIG, "You have a %sPort entry with DNSRequest enabled, "
"but IPv4 and IPv6 disabled; DNS-based sites won't work.",
portname);
This is a valid configuration for a SOCKS port that only handles RESOLVE requests, isn't it?
Well, let's not do that then.
But don't they have to use IPv4 or IPv6 to process the resolve? Or do they just ask the Exit?
f63b322a77e41942546675f5229e134f50fc4b63
So if I understand correctly, this is a behavior change: NATD and Trans ports will no longer allow IPv6 traffic by default. Is that right?
Oops, we don't want that.
I think it's better to set these defaults when we process the port configuration line, because otherwise they override the settings in the port configuration itself (you can't turn IPv6 off, at least in the onion-only case, and maybe other cases as well).
This is complicated by the fact that port configs are initialised in 3 different places. It will be easier to keep the NATD and Trans behaviour if that's refactored into one place.
Un-assigning from me because I'm not sure if I can do this patch before 0.2.9.
Trac: Owner: teor toN/A Status: needs_information to assigned
In b311f820 -- what should we do if IPv4Traffic and IPv6Traffic are both disabled, but DNSTraffic is enabled, and we get a hostname? Right now it looks like we accept the request. Is that right? If not, please open a ticket.
In b311f820 -- what should we do if IPv4Traffic and IPv6Traffic are both disabled, but DNSTraffic is enabled, and we get a hostname? Right now it looks like we accept the request. Is that right? If not, please open a ticket.
Yes, this is the intended behaviour - some unusual clients might just want to look up names, and not transmit traffic.