Re: [tor-relays] Questions about 4 Relays per IP and the ddos mitigation scripts

2023-02-06 Thread nusenu

Hi,

thanks for raising these questions and trying to understand before 
deploying/changes to filters.

A good understanding of how tor relays and connections work is important when 
trying
to defend against overload attacks, without breaking functionality
with packet filters that cause false positive blocks, especially when such a
long standing limit like the relays per IPv4 address limit is changed.


- I have a few Exit relays as permanent residents in my block list, not
because I want them to be there but because, no matter how many times I
remove them, day or night, they'll be back in seconds for making too
many concurrent attempts.


As a relay operator you should allow all other relays
to connect to your relay's ORPort no matter what flags or onionoo
guard/middle/exit probability they might have.
Place known relay IPs on an exception list so your filters don't block them
and update that list at least every hour.

If you have a problem on your relay's ORPort with a source IP that
is also used by an exit relay please try to contact
the operator by looking at their contactinfo, if they don't
have a contactinfo, join the 'require a usable contactinfo' lobby ;)
for this very reason and maybe ask on this list if they can drop you an email.

You can also not be sure whether it is an actual authenticated relay to relay
connection or a client to relay connection just by looking at the source IP.
Some upcoming MetricsPort enhancement might help you there in the future
not per source IP but as a general overview for your relay's ORPort connections.
An exit can share it's source IP with tor clients for example behind NAT,
but I don't think that is common and it is also discouraged. Exits should have 
dedicated
IPs that is not shared for unrelated things.

Blocking relay to relay communication should not be done
as it breaks a core assumption of the tor network (every relay can talk
to all other relays ORPorts). Upcoming tooling that detects
broken relay to relay links might also detect and flag your relay
if your filters break relay to relay communication.

As an option of last resort - after verifying it is an authenticated
relay to relay connection that is causing you trouble and not some tor client 
using the same source IP
you might contact the bad-relays list. That is still better than blocking
another relay from reaching your relay's ORPort.

I've seen other problematic filter practices for relay to relay connections and 
I'll
write up some recommendations in a separate email so it doesn't get lost in 
this lengthy email.


I'm assuming this is due to the fact that
Exits are being used to attack other relays 


In a vanilla current tor version it is not possible to use a tor client
to connect via an exit to another relay's ORPort so this is very unlikely. The 
background here
is that tor does not allow such connections to prevent an attacker from 
reentering
the tor network via an exit relay.

You can test that by opening this URL in tor browser, you will get a
"Unable to connect" very fast:

https://185.220.102.242/
because it is this ORPort:
https://metrics.torproject.org/rs.html#details/0A2366980A2842D770EF8E136A7DA14876360447

the answer is very fast and not a slow timeout because a tor client can predict
that is inaccessible before even trying to create a stream
because exits will not allow such connections to relay ORPorts.


I have 2 Established connections to two Or Ports of an exit relay


I was not able to follow you there. I was unable to find any exit relay that
has more than one ORPort on IPv4 (I identify relays by fingerprint not by IP 
address).
Maybe you can list the specific exit relay fingerprint and timestamp so I can 
cross
check for bugs in my tooling/onionoo?


- Each relay has Established connections to many other relays and if
they're guard they will also have many connections to regular users and
their Tor browsers until they have enough traffic to reach their
MaxAdvertisedBandwidth. Obviously we don't Establish connections to all
6300 relays out there.


It is best to actually expect that.


So if we do not allow each IP more than two
connections and they need 4, They'll have two from us and they'll move
on to another relay and get the other two and get the job done and we
will reach our Max Bandwidth anyway by accepting traffic from other
relays. Diversity of relays as opposed to concentration of some relays.
Am I correct in my assumption that this will have little to no effect on
the health of the Tor network as a whole?


I think there is a misunderstanding there. One important point to take away:
Relays do not chose the next hop in a circuit, tor clients do.
So if my tor clients picks a circuit with these relays:
client -> A -> B -> C -> example.com
and B can not reach C, B can not say "oh I can not reach C I'll pick D instead for 
you",
a relay has no say in that. I hope that helps to reinforce the importance of
ubiquitous reachability between relays. Relays have to obey a 

[tor-relays] Questions about 4 Relays per IP and the ddos mitigation scripts

2023-02-06 Thread Chris Enkidu-6
Hello Everyone,

Before I make changes to [my
scripts](https://github.com/Enkidu-6/tor-ddos), I need to understand a
few things and any help is much appreciated.

- First, Does an Exit relay with zero Guard probability and zero middle
relay probability need to initiate circuits with a Guard or middle relay
and assuming it fails, would that affect my relay, relaying traffic to
that Exit node as a part of my own circuit? To clarify the question, I
have 2 Established connections to two Or Ports of an exit relay, the
relay has no connections to me, Does that break anything?

- I have a few Exit relays as permanent residents in my block list, not
because I want them to be there but because, no matter how many times I
remove them, day or night, they'll be back in seconds for making too
many concurrent attempts. I'm assuming this is due to the fact that
Exits are being used to attack other relays but I may be wrong which is
why I need someone to clarify this for me and hence another reason for
question one.

- Each relay has Established connections to many other relays and if
they're guard they will also have many connections to regular users and
their Tor browsers until they have enough traffic to reach their
MaxAdvertisedBandwidth. Obviously we don't Establish connections to all
6300 relays out there. So if we do not allow each IP more than two
connections and they need 4, They'll have two from us and they'll move
on to another relay and get the other two and get the job done and we
will reach our Max Bandwidth anyway by accepting traffic from other
relays. Diversity of relays as opposed to concentration of some relays.
Am I correct in my assumption that this will have little to no effect on
the health of the Tor network as a whole?

Thanks for reading, I'm not going to make this longer than it is already.

___
tor-relays mailing list
tor-relays@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays


Re: [tor-relays] tor relay shows offline @ tor relay search while running

2023-02-06 Thread Anonforpeace via tor-relays
My bridge was showing the same thing. Then I learned that there is a bug in the 
relay search page and you should only trust \var\log\syslog

Sent from Proton Mail mobile

 Original Message 
On Feb 2, 2023, 4:40 PM, theyarewatching--- via tor-relays wrote:

> Good day,
> My relay shows offline on the Relay Search page but according to NYX the 
> relay is always running. I am running two relays on on Proxmox through my 
> home network. Please inform me of what info/logs you may need to help 
> diagnose this.
> Thank you for your time and help.
>
> TAW___
tor-relays mailing list
tor-relays@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays