Skip to content

Commit

Permalink
Implement layer 2 and layer 3 guard pinning via torrc.
Browse files Browse the repository at this point in the history
Block circuit canibalization when HSRendezvousMiddleNodes is active.
Also make it apply to all HS circuits, not just rends.
  • Loading branch information
Mike Perry committed Jan 19, 2018
1 parent a86324d commit 20a3f61
Show file tree
Hide file tree
Showing 7 changed files with 426 additions and 14 deletions.
4 changes: 4 additions & 0 deletions changes/bug13837
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
o Major features (Onion Services):
- Provide torrc options to pin the second and third hops of onion service
circuits to a list of nodes. The option HSLayer2Guards pins the second hop,
and the option HSLayer3Guards pins the third hop. Closes ticket 13837.
94 changes: 94 additions & 0 deletions doc/tor.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1531,6 +1531,100 @@ The following options are useful only for clients (that is, if
If no nodes in Tor2webRendezvousPoints are currently available for
use, Tor will choose a random node when building HS circuits.

[[_HSLayer2Nodes]] **_HSLayer2Nodes** __node__,__node__,__...__::
A list of identity fingerprints, nicknames, country codes, and
address patterns of nodes that are allowed to be used as the
second hop in all client or service-side Onion Service circuits.
This option mitigates attacks where the adversary runs middle nodes
and induces your client or service to create many circuits, in order
to discover your primary guard node.
(Default: Any node in the network may be used in the second hop.)
+
(Example:
_HSLayer2Nodes ABCD1234CDEF5678ABCD1234CDEF5678ABCD1234, \{cc}, 255.254.0.0/8) +
+
When this is set, the resulting hidden service paths will
look like:
+
C - G - L2 - M - Rend +
C - G - L2 - M - HSDir +
C - G - L2 - M - Intro +
S - G - L2 - M - Rend +
S - G - L2 - M - HSDir +
S - G - L2 - M - Intro +
+
where C is this client, S is the service, G is the Guard node,
L2 is a node from this option, and M is a random middle node.
Rend, HSDir, and Intro point selection is not affected by this
option.
+
This option may be combined with _HSLayer3Nodes to create
paths of the form:
+
C - G - L2 - L3 - Rend +
C - G - L2 - L3 - M - HSDir +
C - G - L2 - L3 - M - Intro +
S - G - L2 - L3 - M - Rend +
S - G - L2 - L3 - HSDir +
S - G - L2 - L3 - Intro +
+
ExcludeNodes have higher priority than _HSLayer2Nodes,
which means that nodes specified in ExcludeNodes will not be
picked.
+
This option is meant to be managed by a Tor controller such as
https://github.com/mikeperry-tor/vanguards that selects and
updates this set of nodes for you. Hence it does not do load
balancing if fewer than 20 nodes are selected, and if no nodes in
_HSLayer2Nodes are currently available for use, Tor will not work.
Please use extreme care if you are setting this option manually.

[[_HSLayer3Nodes]] **_HSLayer3Nodes** __node__,__node__,__...__::
A list of identity fingerprints, nicknames, country codes, and
address patterns of nodes that are allowed to be used as the
third hop in all client and service-side Onion Service circuits.
This option mitigates attacks where the adversary runs middle nodes
and induces your client or service to create many circuits, in order
to discover your primary or Layer2 guard nodes.
(Default: Any node in the network may be used in the third hop.)
+
(Example:
_HSLayer3Nodes ABCD1234CDEF5678ABCD1234CDEF5678ABCD1234, \{cc}, 255.254.0.0/8) +
+
When this is set by itself, the resulting hidden service paths
will look like: +
C - G - M - L3 - Rend +
C - G - M - L3 - M - HSDir +
C - G - M - L3 - M - Intro +
S - G - M - L3 - M - Rend +
S - G - M - L3 - HSDir +
S - G - M - L3 - Intro +
where C is this client, S is the service, G is the Guard node,
L2 is a node from this option, and M is a random middle node.
Rend, HSDir, and Intro point selection is not affected by this
option.
+
While it is possible to use this option by itself, it should be
combined with _HSLayer2Nodes to create paths of the form:
+
C - G - L2 - L3 - Rend +
C - G - L2 - L3 - M - HSDir +
C - G - L2 - L3 - M - Intro +
S - G - L2 - L3 - M - Rend +
S - G - L2 - L3 - HSDir +
S - G - L2 - L3 - Intro +
+
ExcludeNodes have higher priority than _HSLayer3Nodes,
which means that nodes specified in ExcludeNodes will not be
picked.
+
This option is meant to be managed by a Tor controller such as
https://github.com/mikeperry-tor/vanguards that selects and
updates this set of nodes for you. Hence it does not do load
balancing if fewer than 20 nodes are selected, and if no nodes in
_HSLayer3Nodes are currently available for use, Tor will not work.
Please use extreme care if you are setting this option manually.

[[UseMicrodescriptors]] **UseMicrodescriptors** **0**|**1**|**auto**::
Microdescriptors are a smaller version of the information that Tor needs
in order to build its circuits. Using microdescriptors makes Tor clients
Expand Down
Loading

0 comments on commit 20a3f61

Please sign in to comment.