The following patch enables one-hop intro point and rendezvous connections for onion service servers. It is compatible with current tor clients and relays.
Use the following torrc lines to make intro point and rendezvous point connections one-hop on the server:
This is an alternate design and implementation of the "Stream latency is reduced on a 4-hop circuit" feature of #prop252. (It reduces the path length, but does it in a different way to the proposal, by building a one-hop path to hidden/onion service introduction points and rendezvous points.)
These one-hop introduction point and rendezvous paths are compatible with the existing hidden service implementation, and it works on the existing tor network without any changes to older relays or clients.
Some sites wish to scale up public ".onion" sites within the next 6 months, using the existing Tor network and Tor clients. This patch enables their use case, until #prop252 is implemented and deployed widely enough.
The one-hop circuits that were created by this code weren't marked as one-hop, which caused a info-level bug log message in the pathbias code.
I've pushed a fixup to the branch hs-route-len-v2.
There's also a branch with the same changes based on Tor 0.2.6.10 at hs-route-len-02610.
I think this code needs a redesign (and a proposal) before it is merged, to:
get community consensus on the tradeoffs between efficiency, features, and splitting the hidden service anonymity set
collapse the two experimental options into a single option like OnionServerOneHop 1, which would do the equivalent of __OnionSrvIntroRouteLength 1 __OnionSrvRendRouteLength 0
(I also dislike that one-hop paths need to have one of these settings as 1, and the other as 0. This should be handled internally and not exposed to operators.)
Trac: Severity: N/Ato Normal Status: needs_review to needs_revision
when RendezvousSingleOnionServiceNonAnonymousServer is changed at runtime, tor attempts to re-use introduction points and introduction point circuits after a HUP. It should close the circuits and discard the intro points.
The proposal has been updated and posted to tor-dev.
The proposal is available in the branch “feature-17178-rsos” at https://github.com/teor2345/torspec.git as
torspec/proposals/ideas/xxx-rend-single-onion.txt
This can be tested with the chutney branch "feature-17178-rsos” at https://github.com/teor2345/chutney.git using the command:
src/test/test-network.sh --flavor rsos-min
Hello teor, what can I do here to help? What's the current status here? I can spend a few hours this week on this ticket.
The code works and has been tested using chutney.
It doesn't behave correctly when RendezvousSingleOnionServiceNonAnonymousServer Is changed at runtime (using torrc and a HUP, or over the control port). The current code attempts to re-use introduction points and introduction point circuits after a HUP. But if the value of RendezvousSingleOnionServiceNonAnonymousServer has changed, the circuits are the wrong length. Tor should close the circuits and discard the intro points (this needs to be coded), then post a fresh descriptor (this likely already happens anyway after a config change).
There aren't any specific unit tests, but any existing unit tests pass.
Hello teor, what can I do here to help? What's the current status here? I can spend a few hours this week on this ticket.
The code works and has been tested using chutney.
It doesn't behave correctly when RendezvousSingleOnionServiceNonAnonymousServer Is changed at runtime (using torrc and a HUP, or over the control port). The current code attempts to re-use introduction points and introduction point circuits after a HUP. But if the value of RendezvousSingleOnionServiceNonAnonymousServer has changed, the circuits are the wrong length. Tor should close the circuits and discard the intro points (this needs to be coded), then post a fresh descriptor (this likely already happens anyway after a config change).
This can be done yes, but it's some moderate engineering complexity. Are we sure we want RendezvousSingleOnionServiceNonAnonymousServer to be hotpluggable like that? We think HS operators would enjoy that, or can we just fail and warn the user if RSOS was enabled after a HUP?
And also there is the opposite direction. What happens if RSOS is disabled after a HUP? Then you need to kill all 1-hop circuits and make 3-hop ones? Do we want people to think it's so easy to switch between these two modes?
Hello teor, what can I do here to help? What's the current status here? I can spend a few hours this week on this ticket.
The code works and has been tested using chutney.
It doesn't behave correctly when RendezvousSingleOnionServiceNonAnonymousServer Is changed at runtime (using torrc and a HUP, or over the control port). The current code attempts to re-use introduction points and introduction point circuits after a HUP. But if the value of RendezvousSingleOnionServiceNonAnonymousServer has changed, the circuits are the wrong length. Tor should close the circuits and discard the intro points (this needs to be coded), then post a fresh descriptor (this likely already happens anyway after a config change).
This can be done yes, but it's some moderate engineering complexity. Are we sure we want RendezvousSingleOnionServiceNonAnonymousServer to be hotpluggable like that? We think HS operators would enjoy that, or can we just fail and warn the user if RSOS was enabled after a HUP?
That's a really good point. The existing design deliberately doesn't support mixing HS and RSOS for security reasons. (See below.)
And also there is the opposite direction. What happens if RSOS is disabled after a HUP? Then you need to kill all 1-hop circuits and make 3-hop ones?
If we were to close all connections, it would have to happen on both RSOS to HS, and HS to RSOS. But that's not secure.
Do we want people to think it's so easy to switch between these two modes?
You're right, we really can't allow hot-plugging securely and safely.
I think we need secure defaults here:
a Tor instance can only run all RSOS, or all HS at one time (RendezvousSingleOnionServiceNonAnonymousServer is global)
after an onion service is launched, a Tor instance can only run all RSOS, or all HS, until Tor is restarted (RendezvousSingleOnionServiceNonAnonymousServer is persistent on first RSOS/HS launch)
These rules protect operators from inadvertent disclosure by either simultaneously or sequentially running onion services with 1 and 3 hop paths on the same Tor instance. But they also support the ephemeral use-case, where the operator launches Tor, sets or unsets RendezvousSingleOnionServiceNonAnonymousServer, then launches an onion service.
I have implemented 1, but I haven't implemented 2 yet. To implement it, Tor needs to check: if RendezvousSingleOnionServiceNonAnonymousServer is changed, and there are any onion services active (excluding deleted/inactive services, if this is a feature of (ephemeral) services), then reject the change and warn the user. Tell them to restart if they really want to change it.
teorIs it OK to make operators restart their tor instance to switch to/from (Rendezvous) Single Onion Services?nickmIMO absolutely yes; and in fact... the same datadirectory probably shouldn't let you do that without some kind of a "yes I know what I'm doing"err,the same hidden service directory