-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Proposal: Add support for proxying p2p connections to/from lnd #6843
base: master
Are you sure you want to change the base?
Conversation
bfa8967
to
39a73a2
Compare
This commit adds a new `brontide/proxy` subpackage containing two new structs. `proxy.Mux` is a multiplexer that allows multiple `proxy.Conn` connections to be handled over a single brontide connection. This can be used to allow a proxy running in a separate process to handle connections to and from peers, freeing up the node's process and dedicated hardware to ensuring the safety of money entrusted to it.
39a73a2
to
0eec1e8
Compare
Hi Alex, very cool stuff! I'm happy to hear y'all are looking into ways to further harden lnd's network stack.
So this actually isn't the case. All The Lines 268 to 280 in 9d04b0c
A more restricted version that only works with a single key also exists: Lines 282 to 293 in 9d04b0c
The Lines 394 to 395 in 9d04b0c
So today someone could instantiate a proxy that uses the existing The missing component here would then be feeding the decrypted messages into lnd itself. One generic way to do that would be to extend the Today the custom message routing just goes between the endpoint, it would then need to be extended to contextually deliver the message to the relevant sub-system (funding to fundingmgr, channel updates to the link, etc, etc). This switch statement in the peer's FWIW, will the path laid out (which has a lot of overlap w/ this PR), I don't necessarily think something like this needs to live within lnd, given we can add some extra APIs to make it possible to do it all fully externally. This would let the project move at a quicker pace in its early days, as it finds its sweet spot w.r.t the needs of node operators and services. |
We're considering ways to reduce the attack area in LND deployments. In addition to existing work on external signing, we are interested in adding support for decoupling Brontide and using a proxy running in a separate process for peer-to-peer connections. This would enable doing some transport-level checks away from the LND process/hardware, preventing several types of resource exhaustion/denial of service attacks. However, there is also a trade-off in that the node key will need to be copied to the Brontide proxy.
The way we envision this working is to add an option such as
proxylisten
orproxymux
tolnd
, which would connect over a single Brontide connection (or TLS or something) to the proxy and allow incoming/outgoing connections to be multiplexed over the connection. The proxy would allow connections only to and from known nodes, verifying ECDH for the connection before decrypting the traffic and proxying it over the multiplexed connection. This draft PR starts with proof of concept brontide proxy which multiplexes multiple connections over a single one.There are several questions to consider and other TODOs. A non-exhaustive list follows:
MessageConnWithPubkey
interface (maybe in the peer package?)/cmd
?)We would love feedback on the direction this is taking or additional suggestions. If this looks like it's going in the right direction, I'll keep moving forward with the TODOs listed above under this PR until it's usable.