Create new UI command to retrieve detailed infomap of country_codes in the Patch
This UI command will trigger Node to send collection of country codes from Neighborhood DB wtith number of Nodes in particular countries.
Front-End team want's to show the flags of available countries in the MASQ Browser for users to see waht countries are available for exit and how many exit nodes is available in particular country.
I'd like to see this command designed to send the entire Neighborhood Database graph to the front end, so that they can use it for more purposes than just extracting a list of country codes. I recommend that a few fields from each Node be withheld (for example, the encrypted Gossip and the binary signature) because they're large and unwieldy and the front end would have no use for them; but there shouldn't be any security issues with providing all the information in the database.
Note from later: I no longer believe this. I do believe that the entire Neighborhood Database graph should be sent to the front end, but I don't believe it should be done in response to this command: I think it should be done whenever the Node sends Gossip on the network. As a matter of fact, I no longer think this command should even exist.
At the time of this writing, the Node is constrained to listen for UI connections only on the loopback adapter (127.0.0.1), so there's no way any attacker could connect a UI over the Internet.
If this ever changes, so that connections are accepted over the default NIC, this command will become a security liability because an attacker will be able to collect the IP addresses of all our immediate neighbors...and then probably connect to those neighbors and collect their neighbors' IP addresses, and so on, until he's got all the IP addresses in the network.
So: A) don't change the adapter that listens for UI connections, or B) if you do, make sure you bring at least username/password authorization to bear, and preferably multi-factor authorization as well. But...preferably...don't change it. Syther: this means you.
From a Sunday meeting:
{
"neighborhood_database": {
"<public key 1>": {
"version": 252,
"country_code": "UK",
"exit_service": true,
"unreachable_hosts": ["facebook.com", "x.com", ...],
"rate_pack": {
"routing_byte_rate": 8372839,
"routing_service_rate": 1238347845,
"exit_byte_rate": 9284754,
"exit_service_rate": 2938587785,
},
[ ...other stuff... ]
},
"<public key 3>": {
"version": 2,
"country_code": "UK",
"exit_service": true,
"unreachable_hosts": ["facebook.com", "x.com", ...],
"rate_pack": {
"routing_byte_rate": 8372839,
"routing_service_rate": 1238347845,
"exit_byte_rate": 9284754,
"exit_service_rate": 2938587785,
}
},
"<public key 2>": {
"version": 5,
"country_code": "CZ",
"exit_service": false,
"unreachable_hosts": ["facebook.com", "x.com", ...],
"rate_pack": {
"routing_byte_rate": 8372839,
"routing_service_rate": 1238347845,
"exit_byte_rate": 9284754,
"exit_service_rate": 2938587785,
}
},
...
}
}
1. As I understand we want to provide ExitLocation for all routes made from the selection of ExitLocation flag in Electron app. This selection will be based on message from the Node about the Neighborhood as is described and newly adjusted on #469 card in the Project Board here https://github.com/MASQ-Project/Node/issues/469#issuecomment-2282896051.
This message will contain all nodes in Neighborhood DB with informations about their country_code, exit_service and probably unreachable_hosts. These 3 pieces of information I will explain in item 2., here we want to conclude weather we want this ExitLocation to be blocking, or not. That means, as I understand the request for this feature, tahat this ExitLocation should be blocking type, which means, if we do not find any route by Nodes in particular ExitLocation, we will inform about it the user and let him decide, weather he will wait until this host will be reachable by Nodes in particular Country, or if he switch this feature off and use any Country for exiting. We can also implement something like "preferred country", that will tell routing_engine that if he could not find particular host in selected Country, we will provide for this particular host rout thru different Country. In that case user will not know about it, otherwise we need to implement some other functionality to inform user about situation, that we are routing thru different Country, than which he selected in Electron app.
2. We have updated the card and the JSON structure for card mentioned aboce #469, that contains following informations:
-
Public Keyof the Node -
Version- number indicates how many times informations about the Node has changed. Could indicate the change of other informations exept the Public Key -
country_codeof the Node to create UI interface to select the country -
exit_serviceboolean that indicates if particular node can provideexit service -
unreachable_hosts- is optional as offering. This piece of information can provide information about hosts that can't be reached thru this particular Node, that means, if all the nodes in particularCountrywill have commonunreacable_hostin this array, the Electron app can show user, that if he pick this country forExitLocation, those hosts will be unreachable for him.
In general, we want to decide and argue, how we want to proceed with this Feature. Do we want, if user is selecting for example Gabon as ExitLocation, and there will be e.g. Twitter unreachable by all Exit Nodes, to perform the request to the Node for compute routing, or not? In case the ExitLocation will be blocking the routing_engine, user will get back something like 404 site not found, and if it will be non-blocking, then user can exit in any other Country, which could be confusing for him.