Opened 5 months ago

Last modified 5 months ago

#30229 new enhancement

Automatically set the scanner country and AS

Reported by: teor Owned by:
Priority: Medium Milestone: sbws: 1.2.x-final
Component: Core Tor/sbws Version:
Severity: Normal Keywords: needs-proposal
Cc: juga Actual Points:
Parent ID: #30255 Points:
Reviewer: Sponsor:

Description

We should automatically set the scanner country using Tor's GeoIP, and let the operator override it if they want.

Manual editing is not very reliable:

# ISO 3166-1 alpha-2 country code. To be edited.
# Default to a non existing country to detect it was not edited.
country = AA

Child Tickets

TicketTypeStatusOwnerSummary
#30253enhancementnewWork out how to specify the country and AS for a CDN

Change History (8)

comment:1 Changed 5 months ago by juga

This adds more complexity to the code. Irl proposed to add the ASN in #30196.
Another issue is that in debian stable there is python3-geoip2 (i think the one that ooni uses), but it uses Maxmind files, not tor-geoip. I don't think we have a python script for tor-geoip?.

comment:2 in reply to:  1 Changed 5 months ago by teor

Replying to juga:

This adds more complexity to the code. Irl proposed to add the ASN in #30196.

Does the Tor control port let you look up a country from any IP address?
It doesn't let you look up an AS.

I suggest that the complexity is worth it, to get a correct answer.

Another issue is that in debian stable there is python3-geoip2 (i think the one that ooni uses), but it uses Maxmind files, not tor-geoip.

tor-geoip is a summary of the Maxmind database, using a python script:
https://gitweb.torproject.org/tor.git/tree/src/config/mmdb-convert.py

I don't think we have a python script for tor-geoip?.

No, we don't.

comment:3 Changed 5 months ago by teor

Keywords: needs-proposal added

There are a few different ways of implementing country and AS.
So let's write a short change proposal with the different options.

comment:4 Changed 5 months ago by teor

Milestone: sbws: unspecifiedsbws: 1.2.x-final

Let's think about this ticket in the next feature release.

comment:5 Changed 5 months ago by teor

Summary: Automatically set the scanner country using Tor's GeoIPAutomatically set the scanner country and AS

comment:6 Changed 5 months ago by teor

Parent ID: #30255

comment:7 Changed 5 months ago by teor

Type: defectenhancement

comment:8 Changed 5 months ago by teor

Copied from #30196:

juga:

irl:

  • The need for AS as well as country allows us to correlate BGP events with bandwidth changes. Ideally we can know both the AS of the scanner and the target. Tor Metrics already knows the AS of the relay.

When we decided to include the country (#29299) i remember arma commenting in irc to just add it in the configuration to don't make the code more complicated. I'm commenting more on this in (#30229)

Note: See TracTickets for help on using tickets.