Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

Add timeout constraint to macaroon when making RPC calls #12

Open
alevchuk opened this issue Mar 29, 2019 · 1 comment
Open

Add timeout constraint to macaroon when making RPC calls #12

alevchuk opened this issue Mar 29, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@alevchuk
Copy link

alevchuk commented Mar 29, 2019

https://github.com/lightningnetwork/lnd/blob/master/docs/macaroons.md mentions

lncli also adds a caveat which makes it valid for only 60 seconds by default to help prevent replay in case the macaroon is somehow intercepted in transmission.

I think we could also do this to match the security protections of lncli. This is an enhancement request to add time caveat when using the macaroon.

Suggested way to implement this:

  1. Use pymacaroons library https://github.com/ecordell/pymacaroons
  2. Before every RPC call
from pymacaroons import Macaroon

m = Macaroon.deserialize(original_macaroon)
m.add_first_party_caveat('X=Y')
m.serialize()
@alevchuk alevchuk changed the title add timeout constraint to macaroon when making RPC calls Add timeout constraint to macaroon when making RPC calls Mar 29, 2019
@adrienemery adrienemery added the enhancement New feature or request label Apr 3, 2019
@adrienemery
Copy link
Owner

@alevchuk thanks for pointing this out. I also notice lncli adds support for locking to a specific IP address which could be a nice addition as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants