-
Notifications
You must be signed in to change notification settings - Fork 707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add whitelist support #1946
Comments
You mean, when you are full, you disconnect another connection to connect to the whitelisted ip ? |
Either that, or you always keep some slots for whitelisted IPs. What's your take @damip ? |
Here is a possible spec:
Warning: node-node communications are not encrypted nor authenticated/signed. Whitelisted connections are sensitive to man-in-the-middle attacks and should NOT be trusted more than other connections |
That seems like a lot, what's the real purpose of whitelisting ? |
I already added something very similar for bootstrap peers, in order to ensure that our bootstrap nodes are always connected all together, and also that normal users don't make more than 1 connection towards a bootstrap node. https://github.com/massalabs/massa/blob/main/massa-node/base_config/config.toml#L99-L102 It took 2 or 3 hours to implement
when there are some nodes you know about, and absolutely want to be connected to in order to ensure that you cannot be connected only to attackers (that can happen statistically, especially if attackers are advertising many IP addresses and simulating many nodes). This feature is present in all major cryptos and heavily used. |
Do we need to whitelist IP+nodeID to prevent man in the middle ? |
Yes but it's not enough. To prevent MITM and replay attacks we need chained message authentication like we do for bootstrap. This adds overhead (eg. hashing every received message and verifying its signature) |
I was more thinking about having a whitelist in the client that would mean, I want to to connect to this ip, even if it means dropping another connection. As for the persistence, I'm not really sure about that. @z80dev do you have any intake on what would be the best for this kind of feature ? |
In the client ? Here it will only be happening in the node. According to the spec above, it will behave just like we currently do with bootstrap node connections: it will not supersede any connections, the node will just try to always have a given number of extra whitelist connections active. Persistence: same thing as bootstrap nodes. We could maybe go further and decide to have no file persistence for bootstrap and whitelist nodes. |
Wait for #2297 to be merged and then
|
2297: Refactor to prepare whitelist peers r=AureliaDolo a=AureliaDolo To prepare for #1946 I mostly created the PeerType variant and refactored a lot accordingly. In a nutshell, instead of having many not so related indexes, we have now one index and one config per peer type. I tried my best match on peer types and avoid if as much as possible (if you see something other than stuff == PeerType::default() , there may be an underlying issue), and hide complexity is smaller methods. Co-authored-by: Aurelia <[email protected]>
At some point it would be nice to add a whitelist option. You could provide a list of IP and connections from nodes corresponding to these IP would always be accepted.
The text was updated successfully, but these errors were encountered: