Skip to content
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

Private networks aren't really private #19378

Closed
WinstonPrivacy opened this issue Apr 2, 2019 · 5 comments
Closed

Private networks aren't really private #19378

WinstonPrivacy opened this issue Apr 2, 2019 · 5 comments

Comments

@WinstonPrivacy
Copy link

We are using the go-ethereum p2p library, discv4 and a custom protocol. We have determined that the recommended method for creating a private network doesn't really work.

Specifically, the p2p/protocols library permits you to assign a version # to your protocol. Nodes that do not agree on protocol or version will not negotiate an RLPx handshake, which is good.

However, we have traced the code down to the p2p/discover library and found that nodes will still respond to ping, pong and findnode packets from peers which do not agree on RLPx protocol or version. This is bad.

Given the above, it seems almost trivial to write an ethereum powered crawler which can determine the existence of all ethereum nodes which are connected to the internet.

Please let me know if I am incorrect in this understanding. It would be excellent news to hear that ethereum nodes can be configured to respond only to other nodes on a private network and not to unknown peers (potential attackers).

@WinstonPrivacy
Copy link
Author

##15358

@holiman
Copy link
Contributor

holiman commented Apr 3, 2019

I think it's a fair assessment that private networks aren't private. It's in the basic design. Correct, @fjl ?

@WinstonPrivacy
Copy link
Author

WinstonPrivacy commented Apr 3, 2019 via email

@fjl
Copy link
Contributor

fjl commented May 3, 2019

The purpose of the discovery protocol is finding all the other nodes on the Internet. The term 'private network' is commonly used to describe non-mainnet blockchains but doesn't imply that the participants can't be discovered. If you fork the discovery to create your own small DHT and run it on the Internet, your system will have low security because small DHTs can be overtaken easily.

You have several options for peer discovery in a private chain setting:

  • If you run a network with few, known participants just connect everyone together with static nodes and disable the DHT using --nodiscover.
  • If your network runs within a single cloud environment, use --netrestrict or just close the firewall.
  • If you need communication among multiple parties, set up a VPN with dedicated IP range, then run all clients with the --netrestrict flag to only allow communication with nodes in that range.

@fjl fjl closed this as completed May 3, 2019
@WinstonPrivacy
Copy link
Author

WinstonPrivacy commented May 3, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants