Add authentication to the RPC layer
Right now, anyone can spend money or otherwise cause havoc via a nitro node's public RPC endpoint.
From duplicate thread:
In the universe of
nitro-as-a-sidecarrather thannitro-as-a-networked-servicethere's the option to only accept connections from the local machine.Good point, but I suppose there might still be attack vectors from malware?
Solving this may involve our supporting wss and https (secure).
Useful resources:
- https://besu.hyperledger.org/stable/public-networks/how-to/use-besu-api/authenticate
- https://medium.com/@terawattled/protecting-ethereum-json-rpc-api-with-password-887f3591d221
We may want to protect different API methods in different ways. For example GetAddress() may require different credentials to CreateLedgerChannel.
The second article suggests that using nginx (reverse proxy) is a good pattern because the authentication built into e.g. go-nitro can then be very simple.