Opened 4 weeks ago
Last modified 8 days ago
#32511 needs_information enhancement
Add features improving onion services' interaction with Tor.
Reported by: | moonsikpark | Owned by: | |
---|---|---|---|
Priority: | Medium | Milestone: | |
Component: | Core Tor/Tor | Version: | Tor: 0.4.2.4-rc |
Severity: | Normal | Keywords: | tor-hs |
Cc: | Actual Points: | ||
Parent ID: | Points: | ||
Reviewer: | dgoulet | Sponsor: |
Description
Tor lacks features allowing onion services' interaction with it, mainly because it is a tunneling protocol, not an application layer protocol. I think this aspect of Tor should be addressed more.
I suggest three directives that can improve onion services' interaction with Tor.
- HiddenServiceExportRendPoint
With HiddenServiceExportCircuitID and this directive enabled, Tor exports IP and port of rendezvous point, along with the circuit ID, to the onion service. With this, operators can easily aggregate, analyze and monitor their services' rendezvous point connections.
- HiddenServiceExportInstanceID
With HiddenServiceExportCircuitID and this directive enabled, Tor exports a user-provided instance ID, along with the circuit ID, to the onion service. With this, operators running multiple instances of Tor can accurately differentiate traffics with the same circuit ID. Fixes #32428.
- HiddenServiceEnableClosingCircuit
This might be controversial because this feature exclusively targets the HTTP application protocol, and I know there are ways to close a circuit using the control protocol. But it's nearly impossible and too much error-prone to implement it in real environments.
With this directive enabled, when onion services' backend returns an HTTP status code of 447, it marks the circuit to be closed. It's lightweight, straightforward and easy to configure.
I've crudely implemented them. Please feel free to leave ideas or comments below.
Child Tickets
Change History (7)
comment:1 Changed 4 weeks ago by
comment:3 Changed 3 weeks ago by
Reviewer: | → dgoulet |
---|
comment:4 Changed 3 weeks ago by
Thanks moonsikpark! I hope to provide useful feedback here. I have several questions also. We can move to tor-dev@ at some point if the discussion expands since over a Trac ticket, it can become painful :).
(FYI, the following has been discussed a bit with ahf which implemented the HiddenServiceExportCircuitID
feature and had discussions with Cloudflare about it)
- HiddenServiceExportRendPoint
The reasoning seems reasonable to have this.
- HiddenServiceExportInstanceID
Same, this also seems reasonable especially if you end up running many onion services.
Both of the above, it would need a bit of tweaking on the patch but that is easy.
- HiddenServiceEnableClosingCircuit
This one is a bit more controversial. We are unsure if _in_ tor is the right place to parse every single payload coming in from a client.
The right place to do such an action is really through the ControlPort but you mention that it seems complicated and error-prone on your side. If you could expand there so we can maybe try to make it better?
Another option that ahf raised is that probably a sort of "tor agent" would be more desirable that is you would tell the agent on a socket to "terminate circuit <ID>" and then it tells tor. That agent can aggregate multiple tor instances if needed, and so on.
Unfortunately, we don't have such an "agent" but making tor do "payload inspection" for specific behaviors is not really what we think should be done here.
We would _really_ love for you to expand on your needs and complications you had with the control port + CLOSECIRCUIT
.
comment:5 Changed 3 weeks ago by
Status: | needs_review → needs_information |
---|
comment:6 Changed 2 weeks ago by
OK now this is splitted into two tickets. This ticket is for the third controversial ticket, and #32604 is for the other two.
comment:7 Changed 8 days ago by
I have made a [tor-dev] thread about the third feature as I'd like to see progress here ASAP: https://lists.torproject.org/pipermail/tor-dev/2019-December/014097.html
Nick asked a good question that would be great to have answers to. moonsikpark or anyone else please chime in if you have feedback :)
I've made a pull request. https://github.com/torproject/tor/pull/1543