After the blocking of Tor in Russia in December 2022, the number of
Snowflake users rapidly increased. Eventually the tor process became the
limiting factor for performance, using all of one CPU core.
In a thread on tor-relays, we worked out a design where we run multiple
instances of tor on the same host, all with the same identity keys, in
order to effectively use all the server's CPU resources. It's running on
the live bridge now, and as a result the bridge's bandwidth use has
roughly doubled.
Design thread
https://forum.torproject.net/t/tor-relays-how-to-reduce-tor-cpu-load-on-a-s…
Installation instructions
https://gitlab.torproject.org/tpo/anti-censorship/team/-/wikis/Survival-Gui…
Two details came up that are awkward to deal with. We have workaround
for them, but they could benefit from support from core tor. They are:
1. Provide a way to disable onion key rotation, or configure a custom
onion key.
2. Provide a way to set a specific authentication cookie for ExtORPort
SAFE_COOKIE authentication, or a new authentication type that doesn't
require credentials that change whenever tor is restarted.
I should mention that, apart from the load-balancing design we settled
on, we have brainstormed some other options for scaling the Snowflake
bridge or bridges. At this point, none of these ideas can immediately be
put into practice, because there's no way to tell tor "connect to one of
these bridges at random, but only one," or "connect to this bridge, but
accept any of these fingerprints."
https://bugs.torproject.org/tpo/anti-censorship/pluggable-transports/snowfl…
# Disable onion key rotation
Multiple tor instances with the same identity keys will work fine for
the first 5 weeks (onion-key-rotation-days + onion-key-grace-period-days),
but after that time the instances will have independently rotated their
onion keys, and clients will have connection failures unless the load
balancer happens to connect them to the instance whose descriptor they
have cached. This post investigates what the failure looks like:
https://lists.torproject.org/pipermail/tor-relays/2022-January/020238.html
Examples of what could work here are a torrc option to set
onion-key-rotation-days to a large value, an option to disable onion key
rotation, an option to set a certain named file as the onion key.
What we are doing now is a bit of a nasty hack: we create a directory
named secret_onion_key.old, so that a failed replace_file causes an
early exit from rotate_onion_key.
https://gitweb.torproject.org/tor.git/tree/src/feature/relay/router.c?h=tor…
There are a few apparently benign side effects, like tor trying to
rebuild its descriptor every hour, but it's effective at stopping onion
key rotation.
https://lists.torproject.org/pipermail/tor-relays/2022-January/020277.html
# Stable ExtORPort authentication
ExtORPort (extended ORPort) is a protocol that lets a pluggable
transport attach transport and client IP metadata to a connection, for
metrics purposes. In order to connect to the ExtORPort, the pluggable
transport needs to authenticate using a scheme like ControlPort
authentication.
https://gitweb.torproject.org/torspec.git/tree/proposals/217-ext-orport-aut…
tor generates a secret auth cookie and stores it in a file. When the
pluggable transport process is managed by tor, tor tells the pluggable
transport where to find the file by setting the TOR_PT_AUTH_COOKIE_FILE
environment variable.
In the load-balanced configuration, the pluggable transport server
(snowflake-server) is not run and managed by tor. It is an independent
daemon, so it doesn't have access to TOR_PT_AUTH_COOKIE_FILE (which
anyway would be a different path for every tor instance). The bigger
problem is that tor regenerates the auth cookie and rewrites the file on
every restart. All the tor instances have different cookies, and
snowflake-server does not know which it will get through the load
balancer, so it doesn't know what cookie to use.
Examples of what would work here are an option to use a certain file as
the auth cookie, an option to leave the auth cookie file alone if it
already exists, or a new ExtORPort authentication type that can use the
same credentials across multiple instances.
What we're doing now is using a shim program, extor-static-cookie, which
presents an ExtORPort interface with a static auth cookie for
snowflake-server to authenticate with, then re-authenticates to the
ExtORPort of its respective instance of tor, using that instance's auth
cookie.
https://lists.torproject.org/pipermail/tor-relays/2022-January/020183.html
Hi all,
I've spent some time working on ACME for Tor hidden services (you may have
seen discussion of this work on the onion-advisors mailing list). Full
details of the project are available at https://e.as207960.net/w4bdyj/AX8Ffqsd
Attached is my proposal for a change to the Tor Rendezvous Specification to
support the inclusion of CAA records in hidden service descriptors.
My fork of Tor implementing publishing these records is available at
https://e.as207960.net/w4bdyj/XMN03dmD
Thanks,
Q
------------------------------
Any statements contained in this email are personal to the author and are
not necessarily the statements of the company unless specifically stated.
AS207960 Cyfyngedig, having a registered office at 13 Pen-y-lan Terrace,
Caerdydd, Cymru, CF23 9EU, trading as Glauca Digital, is a company
registered in Wales under № 12417574
<https://find-and-update.company-information.service.gov.uk/company/12417574>.
ICO register №: ZA782876 <https://ico.org.uk/ESDWebPages/Entry/ZA782876>.
UK VAT №: GB378323867. EU VAT №: EU372013983. Turkish VAT №: 0861333524.
South Korean VAT №: 522-80-03080. Glauca Digital and the Glauca logo are
registered trademarks in the UK, under № UK00003718474 and № UK00003718468,
respectively.
Hi Raph,
Whilst I agree that in an ideal world CAs would be irrelevant, we do not
live in an ideal world. My proposal is one of many ways that a certificate
could be issued to hidden services.
Issuing standard TLS certificates to .onion domains allows HTTPS without
modification to the browser. This allows non Tor Browsers user agents to
access the Tor network via a proxy (SOCKS etc), doing otherwise would
require all browsers to understand Tor. It also opens up new opportunities
such as payment processing as current PCI DSS requirements do not allow
non-standard TLS.
Current hidden services with HTTPS such as the BBC already use standard TLS
certificates, however the process for these is extremely involved with
current CAs. My IETF draft aims to make this a much simpler process via the
already well-proven ACME.
Thanks,
Q
------------------------------
Any statements contained in this email are personal to the author and are
not necessarily the statements of the company unless specifically stated.
AS207960 Cyfyngedig, having a registered office at 13 Pen-y-lan Terrace,
Caerdydd, Cymru, CF23 9EU, trading as Glauca Digital, is a company
registered in Wales under № 12417574
<https://find-and-update.company-information.service.gov.uk/company/12417574>.
ICO register №: ZA782876 <https://ico.org.uk/ESDWebPages/Entry/ZA782876>.
UK VAT №: GB378323867. EU VAT №: EU372013983. Turkish VAT №: 0861333524.
South Korean VAT №: 522-80-03080. Glauca Digital and the Glauca logo are
registered trademarks in the UK, under № UK00003718474 and № UK00003718468,
respectively.
On Thu, 27 Apr 2023 at 13:59, Raphaël Fabre <contact(a)fabco.tech> wrote:
> Hey
>
> I've read your proposal, although I'm not sure to grap the totality of it.
> I'm Raph the lead dev of this project -> https://e.as207960.net/w4bdyj/YG6dkkyr
>
> I have a question, since .onion is basically a non ICANN domain name
> system, why do you care about using Certificate Authorities ? Could you
> instead store the TLS certificates in the name system, as TXT / CERT
> records (similar to DANE) ?
>
> Doing this would allow TOR service providers to not rely on certificate
> authorities, control their TLS certificates directly (self signed) and *do
> not need at all to renew it*.
>
> happy to chat further
> Raph
>
> ------- Original Message -------
> Le jeudi 27 avril 2023 à 14:45, Q Misell via tor-dev <
> tor-dev(a)lists.torproject.org> a écrit :
>
> Hi all,
>
> I've spent some time working on ACME for Tor hidden services (you may have
> seen discussion of this work on the onion-advisors mailing list). Full
> details of the project are available at https://e.as207960.net/w4bdyj/xqviywZW
> <https://e.as207960.net/w4bdyj/yBzJUPTT>.
>
> Attached is my proposal for a change to the Tor Rendezvous Specification
> to support the inclusion of CAA records in hidden service descriptors.
>
> My fork of Tor implementing publishing these records is available at
> https://e.as207960.net/w4bdyj/ItcJLhNd <https://e.as207960.net/w4bdyj/LmAkW3uG>.
>
> Thanks,
> Q
> ------------------------------
>
> Any statements contained in this email are personal to the author and are
> not necessarily the statements of the company unless specifically stated.
> AS207960 Cyfyngedig, having a registered office at 13 Pen-y-lan Terrace,
> Caerdydd, Cymru, CF23 9EU, trading as Glauca Digital, is a company
> registered in Wales under № 12417574
> <https://e.as207960.net/w4bdyj/pIFzAYXo>. ICO register №: ZA782876
> <https://e.as207960.net/w4bdyj/pZ2mD5UQ>. UK VAT №: GB378323867. EU VAT
> №: EU372013983. Turkish VAT №: 0861333524. South Korean VAT №:
> 522-80-03080. Glauca Digital and the Glauca logo are registered trademarks
> in the UK, under № UK00003718474 and № UK00003718468, respectively.
>
>
>