Commit Graph

64 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
64393335db Merge pull request #25 from Roasbeef/auto-cert-bugfix
kirin: fix bug when using pure autocert
2020-01-22 18:10:14 -08:00
Olaoluwa Osuntokun
b18e4baed1 kirin: fix bug when using pure autocert
When using the `autocert` route, we actually don't need to pass anything
into `ListenAndServeTLS`, instead we can pass blank strings.
2020-01-22 17:35:31 -08:00
Olaoluwa Osuntokun
4b60be65ee challenger: rename macaroon name 2020-01-22 17:03:46 -08:00
Olaoluwa Osuntokun
de6be5daff Merge pull request #24 from Roasbeef/invoiceonly-mac
challenger: modify to only use invoice macaroon
2020-01-22 17:02:14 -08:00
Olaoluwa Osuntokun
e86965f6f9 challenger: modify to only use invoice macaroon 2020-01-22 16:56:03 -08:00
Olaoluwa Osuntokun
1d57c19fd1 Merge pull request #23 from guggero/update-readme
readme: clarify install instructions
2020-01-22 14:45:00 -08:00
Oliver Gugger
d1096b1df8 readme: clarify install instructions 2020-01-22 11:30:02 +01:00
Oliver Gugger
b002512fc3 Merge pull request #21 from guggero/install-doc
doc: update installation instructions
2020-01-16 13:06:14 +01:00
Olaoluwa Osuntokun
3b3af0a719 Merge pull request #22 from guggero/autocert
Add autocert functionality to get certificate through Let's Encrypt
2020-01-15 19:36:09 -08:00
Oliver Gugger
712168f38d doc: update installation instructions 2020-01-15 22:42:57 +01:00
Oliver Gugger
5276c1b850 kirin: add autocert functionality 2020-01-14 09:41:00 +01:00
Oliver Gugger
e539e6306f mod: add autocert library 2020-01-10 14:16:41 +01:00
Oliver Gugger
9af8647028 config: add autocert options 2020-01-10 14:00:36 +01:00
Oliver Gugger
156ca9589a Merge pull request #20 from guggero/lsat-header-rfc
multi: change WWW-Authenticate header format
2020-01-09 09:46:11 +01:00
Oliver Gugger
76a5ed5f2a multi: change WWW-Authenticate header format
To be compliant with RFC 7235 section 4.1 we change the format of the
WWW-Authenticate header field to double quoted and comma separated
fields.
2020-01-07 15:38:22 +01:00
Oliver Gugger
8b731e87e4 Merge pull request #19 from guggero/server-interceptor
auth: add server interceptor
2020-01-07 14:37:48 +01:00
Oliver Gugger
a402e403bc auth+log: add log subsystem name as constant 2020-01-07 14:37:07 +01:00
Oliver Gugger
45e4bb49d5 auth: add server interceptor 2020-01-07 14:37:07 +01:00
Oliver Gugger
02584d1f38 mod: update to latest loop and lnd versions 2020-01-03 16:44:08 +01:00
Oliver Gugger
f4d62e0a7f Merge pull request #17 from guggero/makefile
make: add Makefile and linter configuration
2019-12-04 11:00:21 +01:00
Oliver Gugger
c6c62b9472 multi: fix all linter errors 2019-12-04 10:58:04 +01:00
Oliver Gugger
41cd93c319 make: add Makefile and linter configuration 2019-12-04 10:47:59 +01:00
Oliver Gugger
a6a5a0e302 Merge pull request #16 from guggero/auth-whitelist
proxy: add authentication whitelist
2019-12-04 10:46:39 +01:00
Oliver Gugger
b60460feee proxy: add test for auth whitelist 2019-12-04 10:45:08 +01:00
Oliver Gugger
51c7deac05 proxy: replace certificate generation with cert package 2019-12-04 10:45:07 +01:00
Oliver Gugger
c2e9d540ba proxy: add auth whitelist for paths 2019-12-04 10:45:07 +01:00
Oliver Gugger
3e2d486f75 auth: add auth level constant 2019-11-29 17:12:53 +01:00
Oliver Gugger
d58c70588d auth: remove unused constant 2019-11-29 16:15:40 +01:00
Oliver Gugger
8928e68bf2 Merge pull request #12 from wpaulino/lsat-mint
multi: introduce proper LSAT creation and verification
2019-11-28 14:25:46 +01:00
Wilmer Paulino
831a41b33e macaroons: remove temporary macaroon creation and verification logic 2019-11-26 11:14:11 -08:00
Wilmer Paulino
530894a5ed auth: remove unused Challenger interface 2019-11-26 11:13:45 -08:00
Wilmer Paulino
38cd0e7847 auth: integrate proper macaroon creation and verification
We move the proxy from using its placeholder macaroon creation and
verification to instead use the agreed upon macaroon design. Much of
this is solely a refactor, but some new functionality has also been
introduced as part of integrating the LSAT mint:

1. A request's target service is now verified to ensure its attached
   LSAT is authorized.

2. The preimage is now checked against the token's committed payment
   hash to ensure it has been paid for.
2019-11-26 11:13:19 -08:00
Wilmer Paulino
95c405b0c7 auth+proxy: extend Authenticator methods with target service name
The target service name remains unused in its current form, but will be
required in order to verify that an incoming request with an LSAT
attached is authorized to access the service being attempted. We can
derive this from the request's host field, but we choose to extend the
methods with the additional parameter in order to prevent parsing the
host field again to determine which service is being accessed.
2019-11-26 11:12:48 -08:00
Wilmer Paulino
7b676b8b91 auth: use concrete preimage type in FromHeader and SetHeader 2019-11-26 11:12:20 -08:00
Wilmer Paulino
25851ae16d kirin: add static service limiter
The service limiter holds all of the constraints that should be applied
to a given service at the base tier. These are currently static and are
parsed from the proxy's configuration file as a temporary work-around.
Eventually, we plan to integrate this with etcd as well in order to
achieve dynamic service discovery.
2019-11-25 17:08:35 -08:00
Wilmer Paulino
02f2a287b0 kirin: add etcd-backed secret store
This will store the secret of each LSAT minted by the proxy, which is
crucial for LSAT verification. The secrets are stored under a new
"secrets" key prefixed by the top level LSAT etcd key, and each secret
can be found by its unique identifier prefixed with the secrets key.
2019-11-25 17:08:34 -08:00
Wilmer Paulino
401c0e2d38 kirin: add etcd client configuration
Allows the ability for the proxy to connect to an etcd cluster for any
reliable data storage purposes. No data is being stored yet as of this
commit, but we'll be storing LSAT secrets at a later commit.

One key component in this commit is that we introduce a new top level
key that will serve to hold all LSAT proxy-related data. Any nested keys
should be prefixed with said top level key.

Co-authored-by: Oliver Gugger <gugger@gmail.com>
2019-11-25 17:08:32 -08:00
Wilmer Paulino
9f291ddbf9 mint: introduce proper LSAT creation and verification
This package adheres to the agreed upon internal design document of the
macaroon portion of an LSAT. It is able to mint LSATs for a set of
services at any tier, each containing their desired set of constraints.

LSAT verification so far only ensures the that token was minted by us
and that the target service attempted to be accessed is authorized
according to the white-listed services contained in the token.
2019-11-25 17:07:08 -08:00
Wilmer Paulino
abcd7a9828 build: update to loop version containing loop utilities 2019-11-25 17:07:02 -08:00
Wilmer Paulino
c317071270 build: downgrade to loop-compatible lnd version
This addresses a build issue when importing kirin into nautilus.

Co-authored-by: Oliver Gugger <gugger@gmail.com>
2019-11-25 17:05:56 -08:00
Olaoluwa Osuntokun
21471bb9b7 Merge pull request #15 from wpaulino/travis
build: set up travis
2019-11-25 18:52:21 -06:00
Wilmer Paulino
2aa9d7ae85 build: set up travis 2019-11-22 17:08:45 -08:00
Olaoluwa Osuntokun
9da38301ec Merge pull request #14 from guggero/cert
kirin: auto create self-signed cert if none is provided
2019-11-19 17:55:34 -08:00
Oliver Gugger
d8ed6bb449 kirin: auto create self-signed cert if none is provided 2019-11-19 15:32:42 +01:00
Olaoluwa Osuntokun
b90299ed4c Merge pull request #10 from guggero/loop-ready
prepare for loop integration
2019-11-18 17:55:08 -08:00
Oliver Gugger
aef413da0a auth+proxy: forward auth to backend 2019-11-18 10:41:12 +01:00
Oliver Gugger
8f4dfc5d57 auth+macaroons: allow authorization by macaroon only 2019-11-18 10:41:11 +01:00
Oliver Gugger
4b0a83b46a proxy: test HTTP and gRPC proxying 2019-11-15 09:45:06 +01:00
Oliver Gugger
00f661318f proxy: send error as gRPC error 2019-11-15 09:45:06 +01:00
Wilmer Paulino
a20e47e79b Merge pull request #9 from guggero/proxy-demo
initial proxy with freebie DB and lnd backend
2019-11-12 18:59:42 -08:00