-
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
Implement RPC Authentication #20
Comments
I'll take this one; will continue discussions with @Roasbeef on macaroon implementation. |
Background on MacaroonsMacaroons are described by the paper Macaroons: Cookies with Contextual Caveats for Decentralized Authorization in the Cloud. In essence, they are bearer tokens issued by a target service (in our case, How Macaroons WorkMacaroons start as a nonce value, unique per macaroon, and an HMAC signature with a key known only to the target service. When a caveat is added, the original HMAC signature is removed but used as the key to sign the new caveat, and the new HMAC signature is appended. In this way, the recipient of the macaroon has no way of dropping previous caveats before attaching new ones, and only the target service can issue new macaroons. First vs. Third Party CaveatsA caveat can be anything (some examples are defined by the Go Macaroon Bakery) that restricts actions a user may request a target service to take. For example, a caveat may require that the action requested is a read-only action (thus prohibiting write). This is a first-party caveat because the target service can directly verify the condition specified by the macaroon. A caveat may also require a signature from a known key, attesting to the target service that the owner of the key approves the request based on its own criteria (with optional additional caveats). This is a third-party caveat because it requires the target service to trust the third party which owns the key. There are no use cases described below for third-party caveats, though some may exist. This could be an area with a lot of possibilities but would also require careful security analysis. Potential Uses of Macaroons in
|
Fixed by #250. We'll be making a few follow up issues to implement some more of the advanced functionality outlined in this original issue, as well as Alex's PR. |
…sions travis: update to go versions to 1.8.5, 1.9.2
Currently the RPC server is completely unauthenticated, responding to any and all requests sent to the server. Such behavior is fine for the current pre-alpha state the daemon is in, however future release should introduce a mechanism for authenticating privileged peers to the RPC server.
Two possible paths forward are first a simple password-based authentication mechanism, and a more advanced finer grained auth system which uses macaroons. The first path leads to ACL based security policies, while the second path leads to security policies implemented via bearer credentials.
In either case, gRPC's credentials package will need to be consulted in order to discern exactly how we'd like to integrate a proposed authentication mechanism into the daemon.
A tutorial for adding authentication into gRPC can be found here, and may prove useful in fixing this issue.
Password Hash:
The password based mechanism is likely the simplest option to start out with initially. Fields within the configuration would be added for one, or many
rpcuser
s each with arpcpasshash
field belonging to it. Rather than storing the password in plaintext within the configuration, a hash of the password should instead be stored. This will likely utilize gRPC's transport based security, rather than the per-RPC auth methods.Macaroons:
The second proposed option is more involved, but is much more advanced and provides a very high degree of flexibility. Macaroons are decentralized bearer credentials with support for delegation, attenuation, and several other useful features. In this model, the per-RPC auth method would be used, and created macaroons can have fine-grained access policies. For example, a macaroon could be created that only allows sending 50,000
satoshis
each day, over a particular channel, to a set of white-listed peers. Continuing, that macaroon can then be given to a friend, with a modification restricting it to only 10,000satoshis
a day. There's an existing macaroon implementation written in Go we may want to use. However it's a bit "heavy", therefore we may want to use a lightweight custom implementation for our purposes.The text was updated successfully, but these errors were encountered: