-
Notifications
You must be signed in to change notification settings - Fork 275
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
SECIO: [Feature Request] Possibilty of dumping keys #46
Comments
I take it you want the internal symmetric session keys? We use DH so extracting the private keys ahead of time won't be sufficient. FYI, you can actually disable encryption entirely with the |
Yes
That's why I want to add this |
Can you think of a way to do this non-invasively? I.e., in a way that doesn't add a bunch of hacks? |
One way would be to add an environment variable like |
I wonder if this functionality could be part of a dedicated control plane protocol for libp2p, e.g. In this manner, we use libp2p's own mechanisms to provide meta-functionality like dumping secrets, or metrics, for debugging and monitoring tools. In the future we could do other things. Such a solution would avoid making libp2p depend on the filesystem, as that comes with complexities of its own (e.g. cleanup). Just a fleeting thought, not married to the idea ;-) |
The problem here is that this needs access to ephemeral, internal, secio-specific secrets. However, we generally do need some form of "stats" feature so we could expose these secrets that way (it's just that wiring all this up will be non-trivial). |
I don't think it should be anywhere in stats.
I wouldn't ever recommend exposing this via the network The best way to implement this, would be by using an environment variable (or in the case of the browser a globally defined variable that contains a function that is called whenever new keymaterial is available, so an extension could move it to a file - but this is the only exception since the browser lacks an FS api) So basically something like an environment variable named Effectively a stream of:
with the following .proto: message SECIODump {
bytes keys = 1;
bytes peerIDRemote = 2;
bytes peerIDLocal = 3;
} |
What if we had a build flag, environment variable, and then a loud message printed on start? Rebuilding with a custom flag is usually easy enough. |
It's a bit cumbersome having to rebuild ipfs, unless official debug releases get published with that flag, so one can easily switch the binaries Additionally js doesn't have build flags |
Assuming go is installed, IPFS can be built and installed with.
Given that this should only be used by people who really know what they're doing, I'd like to optimize for redundant checks over ease of use. |
Why I'd like this to be a build flag: https://textslashplain.com/2019/08/11/spying-on-https/ |
My argument wasn't strictly against the build flag, but instead I proposed that prebuilt binaries with that flag (so as to be useable as a drop-in replacement for debugging purposes) should be available |
Ah. Fair enough. |
@michaelvoronov has a fork of go-libp2p-secio that dumps keys in a keylog file here: libp2p/go-libp2p-secio@master...michaelvoronov:master |
Hi, after spending some time with dissecting IPFS traffic, I realized that it is also needed to dump timestamps when keys were generated (especially if we want a heuristic dissector). I'm experimenting with IPFS now, but ready to discuss and prepare PR if needed. |
@michaelvoronov Hey! Yes, it would be fantastic to get a PR on the secio repo for this! |
I am closing here since SECIO has been deprecated. Please open up a new issue in case you would like to see a similar feature for another authentication / encryption protocol or would like to continue the discussion on the metaprotocol |
Currently there is no way to dump the keys in order to decrypt traffic for debugging purposes.
I am currently writing https://github.com/mkg20001/libp2p-dissector so I wanted to request this here instead of creating my own unofficial hack.
The text was updated successfully, but these errors were encountered: