-
Notifications
You must be signed in to change notification settings - Fork 912
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
RPC permissions #1535
Comments
Now it seems to me that, in true
The Then you would set up your tools (Lightning Charge, whatsoever) to use the specific RPCs. |
Please, let's not add yet another daemon. The capabilities enforcement is rather easy to implement (we have similar capabilities for |
You could, and should, write your own daemon to do this! |
In that case having a "how to write your own RPC permission daemon for non-veteran kernel devs.md" would be useful :-) |
I'm currently playing with the idea of having a |
Yes. |
I've been using Lightning Charge a fair bit, but I don't like that it has full control over the lightning node. It would be nice to have a way to limit RPC permissions, for instance just the ability to create and check the status of invoices.
One approach could be to have to multiple
--rpc-file
like arguments, each with their own set of permissions. The default RPC socket is owned by the user/group that launched the process, and permissions are set to600
. The additional RPC sockets should allowing specifying the group owner and set permission to660
. That way e.g. a system could have a grouplightning_rpc_invoices
whose users can use the RPC to create invoices.Specifically this group should have access to:
help
,decodepay
,getinfo
,invoice
,listinvoices
,delinvoice
(?),waitanyinvoice
(?),waitinvoice
, .The above would go a long way. Some additional ideas:
individual RPC users can "own" invoices. With the example of Lightning Charge that would allow it to delete its own invoices, while not being able to mess with - or even see - invoices it doesn't own. That would suggest creating user (in stead of group) specific RPC interfaces, or moving to an authentication model more like what
bitcoind
uses.a group that can manage channels, but not spend funds:
help
,decodepay
,getinfo
,connect
,listnodes
,listpeers
,disconnect
,getroute
,listchannels
,fundchannel
,close
,newaddr
a group that can withdraw funds (on chain and off chain): same as channel manager, plus
sendpay
,waitsendpay
,pay
,withdraw
. Although that's a lot of permissions, at least it can't sabotage the node by physically reading the database from disk and broadcasting illegal states. It could be additionally constrained through an address (and destination node public key) whitelist.The text was updated successfully, but these errors were encountered: