Replies: 33 comments
-
If you don't want to use the wallet password, there's the As you note, it depends on your threat model though. If the attacker doesn't have the power to backdoor their running |
Beta Was this translation helpful? Give feedback.
-
if you use |
Beta Was this translation helpful? Give feedback.
-
That's correct. |
Beta Was this translation helpful? Give feedback.
-
@Roasbeef But why would I have the database on a Dropbox account? Lightning doesn't really do backups at this point. Equally, even in a normal wallet, I'd just use GPG for that encryption. |
Beta Was this translation helpful? Give feedback.
-
here's a workaround: https://github.com/Stadicus/RaspiBolt/blob/master/raspibolt_6A_auto-unlock.md |
Beta Was this translation helpful? Give feedback.
-
How to automate the current unlock with the rest api without relying on timing? The unlockwallet endpoint seems to return many things in success cases such as |
Beta Was this translation helpful? Give feedback.
-
just in case this helps anyone, this expect script and systemd unit file I believe are at least a reliable way to automate it even without an optional password. For example on a raspberry pi of mine: /home/pi/lnd/lnd_expect.sh
/etc/systemd/system/lnd.service
|
Beta Was this translation helpful? Give feedback.
-
Peter is right, anyone sensible running something like LND on a server would want this setup:
Encryption enforced in LND is not only annoyance, but goes directly against "restart if it crashes" requirement. If an attacker can break isolation, he can read memory of LND, or kill LND and spawn a proces in its place pretending to be LND in order to sniff the password. (It can read TLS private key and the key must stay readable.) Would you be willing to marge a PR providing an option to disable encryption based on these arguments? The unlock scripts complicate the system needlessly and increase attack surface. |
Beta Was this translation helpful? Give feedback.
-
If anyone is not convinced yet, I may have found the ultimate argument for this: admin macaroon is stored in the same directory. It's astronomically unlikely that the macaroon will be better protected than the wallet file. Funnily enough, attacking admin macaroon might be even preferable to an attacker as he can trivially use it to send transactions, without any file copying or other complicated setups. |
Beta Was this translation helpful? Give feedback.
-
Came here to voice my agreement. Here's a scenario: The folks at myNode do a nice job with an automated unlocker script. To make it easy, they automatically generate the password and save it in another folder. What security does this provide if we save our passwords in the clear for our unlocker scripts? They fail to mention that the password is different from the main myNode login password. User (me) attempts to transfer the .lnd folder, moving the node to a new machine. Forgets/doesn't know the wallet.db password is elsewhere. User wipes SSD, because 1TB SSDs aren't cheap and I don't exactly have a bunch of extra ones lying around. Now have no password, OhNo.gif, must resort to recoverchanbackup and SCB. This is a foot gun. --noencryptwallet should be a first class flag. |
Beta Was this translation helpful? Give feedback.
-
@realspencerdupre great point, sometimes too much "security" can cause loss. Forgetting being more probable than theft is considered common knowledge by all Bitcoin security experts I know. Why shouldn't it apply here? |
Beta Was this translation helpful? Give feedback.
-
I don't necessarily disagree with the point that the wallet password should be optional.
To make a long story short: Yes, we might want to allow not needing to set a password. But first we need to refactor quite some code to disentangle the two effects of |
Beta Was this translation helpful? Give feedback.
-
@guggero AFAIK everyone in this thread is aware of current working of I am very happy that you're willing to accept such change. Maybe I will be able to find some time to help with it but I'm currently very busy. |
Beta Was this translation helpful? Give feedback.
-
I'd like to move this forward, so here's a proposal to resolve it: The main goal is to get rid of the unreliability of automatic unlocking via unlocker scripts. The unlocking mechanism must allow consumers to get a seed or set their own It'd also be great to make migration from existing unlocker scripts easy. The mechanism must not introduce unreliability or block consumers from writing their scripts reliably. That means if the consumer wants to make the operation safe even in presence of power failure at any instruction, the API must make this possible.
If this is accepted I will codify these requirements as tests written in bash. I will also provide an example of safe, reliable init/unlock script with comments explaining all relevant details. Rationale
|
Beta Was this translation helpful? Give feedback.
-
This makes sense
But for the rest, I don't see the need for initializing/generating a wallet automatically. Sounds scary. |
Beta Was this translation helpful? Give feedback.
-
Correct, it would create the wallet DB file directly (nothing else,
Maybe that's something more common in Docker/Kubernetes environments where you don't want hard coded secrets in files (because that's harder to setup/maintain in a "stateless" environment) or command line flags (because they could be visible even to non-privileged cluster users), so secrets injected in environment variables are quite common.
Just to turn Cool, I feel like we have a possible way here that could cover all use cases of this thread while remaining fully backward compatible. And to be honest, this would also make our cluster setup way easier. We definitely also started feeling the pain of this. |
Beta Was this translation helpful? Give feedback.
-
I'm not sure about argument, it's quite a big footgun. I contributed to I will leave the decision to you just please document the footgun if you decide to allow argument.
Yeah, I think the presence of password option should do it automatically.
I agree, I will try to write a test script so the implementors can use it to check the implementation. |
Beta Was this translation helpful? Give feedback.
-
@Kixunil: I created a PoC in #5150. Everything file based should work, the k8s stuff is mostly for our own cluster setup and is not yet implemented. Please let me know what you think and whether this would work for your use case. |
Beta Was this translation helpful? Give feedback.
-
Whoa, great speed! I started writing the example script and test script but didn't finish. I guess I will publish the draft and then improve it. |
Beta Was this translation helpful? Give feedback.
-
Personally I would love it if there was a single flag added to While I hear this argument @guggero :
Perhaps just this single flag (rather than a set of interdependent flags) might be ok? I don't like the idea of having different behavior required to init or unlock the wallet, and I think it might be nice to compress these into a single flag. In the past I wrote a script that did this and it worked nicely for my Lnd deployment. Perhaps I'm missing something though :) |
Beta Was this translation helpful? Give feedback.
-
That sounds very dangerous. Wouldn't that mean that you never even see your seed? If your |
Beta Was this translation helpful? Give feedback.
-
Good point about the seed, I think that's what I was missing - thanks! Just also took a look at your PR #5150 and left a question there. Re: the script, if It remember, I think I manually backed up the mnemonic after writing it to the disk... not great haha |
Beta Was this translation helpful? Give feedback.
-
This is great! |
Beta Was this translation helpful? Give feedback.
-
Please do me a favor and check whether that is the case asap! If you don't have the seed there's still a way to extract the |
Beta Was this translation helpful? Give feedback.
-
@guggero the node that used that script was swept and inactivated almost two years ago :) |
Beta Was this translation helpful? Give feedback.
-
Thinking of closing this as we have the wallet file option, and also |
Beta Was this translation helpful? Give feedback.
-
Thinking of closing this as we have the wallet file option, and also `lndinit` that will fully automated the creation and storage of the password itself.
I do not agree. There are lots of security postures where the password is
totally pointless. Personally I set mine to abcdefgh on every lnd wallet I
have. I'm far more likely to lose funds from it being inconvenient to
auto-restart lnd on reboot - followed by exploitation by a peer - than I am
having my backups be compromised.
|
Beta Was this translation helpful? Give feedback.
-
@petertodd there is wallet-pasword-unlock-file now so the problems associated with mandatory password are solved except for minor annoyance. |
Beta Was this translation helpful? Give feedback.
-
...and using that ends up in pretty the same situation as a passwordless wallet file. But more convoluted and with a risk that the password will be lost.
Not to mention, calling this a "password" is misleading anyway. Since the threat model is offline decryption, we actually need something with significantly more entropy than what would normally be considered a password to resist cracking efforts.
On August 20, 2022 10:02:43 AM GMT+03:00, "Martin Habovštiak" ***@***.***> wrote:
***@***.*** there is [wallet-pasword-unlock-file](https://github.com/lightningnetwork/lnd/blob/a58553d1bd239f0ba8bf2fe267112b964ee6bc3c/sample-lnd.conf#L259-L264) now so the problems associated with mandatory password are solved except for minor annoyance.
…
--
Reply to this email directly or view it on GitHub:
#899 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Converting this to a discussion. Can be reverted to the issue or a new one opened up if any development is planned for this. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
If the attacker has a copy of your wallet, in most sane threat models they probably also backdoor lnd to capture the password later anyway, rendering it pointless.
I set mine to 12345678, but really, an empty password should be accepted.
Beta Was this translation helpful? Give feedback.
All reactions