-
Notifications
You must be signed in to change notification settings - Fork 5
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
Secret Management - Subcommands to interact with Secrets #30
Comments
Rewrote the above for some secret command interaction. @ll-aashwin-ll your opinion? |
As for editing something like this might be possible: https://unix.stackexchange.com/a/282384/56970 It seems in general, it might be possible to pipe the output into an editor. Or pipe it to a file, where you then open the file descriptor but delete the file contents (thus you end up with a read/write descriptor). Then pipe that file back into the same command. Note that one has to be careful with concurrent usage. We should expect similar concurrency issues. Also note the usage of |
I really want to be able to run a polykey command to create a secret, that launches the Oh it seems |
Based on my reading of https://en.wikipedia.org/wiki/Uniform_Resource_Identifier I think this should mean that we can just use |
Launches editor for secret, and allows one to save the file. It works! tmpfile=$(mktemp /tmp/abc.XXXXXX)
exec {fd}<> "$tmpfile"
rm -f "$tmpfile"
vim "/proc/self/fd/$fd"
cat <&${fd} The above works in ZSH and Bash using automatic fd allocation. We would do this inside JS which should be alot more robust. |
@robert-cronin Given that you've created the demo already, could we get an update on the status of this issue? In relation to #3 as well. |
The cli now exposes a sub-command for interacting with secrets, the pattern looks like this:
Under this sub command, the user can manipulate secrets with the following commands:
There is still the option of doing away with command options like The other thing that is useful is environment variables to set default values:
|
secrets are now referenced on the CLI with the format
|
After a vault is created. We should be able to get/put secrets into the filesystem.
If we were able to expose the filesystem a real FUSE filesystem on Unix systems, then we would be able to make use any Unix CLI tool to create secrets. However I think this feature can be pushed till later, since the CLI is just a prototype while we focus on releasing a GUI as well (and in the GUI we'll end up translating GUI actions into low level commands that doesn't even touch the real filesystem anyway).
This is why we end up with a few basic commands to put secrets in and get secrets out. Almost like FTP in a way.
Note that vaults are always the root path. So
/a/file
means we are referring to a vault address. However since many commands need to refer to the real filesystem and the polykey filesystem, then we need some way to disambiguate. We can do something similar to AWS CLI with a special protocol used.Note that we can do all these operations within 1 keynode. But interactions between keynodes is different as that means we are using the vault sharing system.
Note that I'm not sure I like the usage of
pk://
to disambiguate path for polykey paths vs the normal paths. It's possible we might be able to make use of another sigil similar to~
is used to refer to the home directory. Potential sigils for us to use:@
,%
,+
,-
. All the other symbols are commonly used for various things in the shell.The above commands are just sub commands that cover copying, reading, moving, deleting, and listing directories. We can add more into it. We don't actually re-implement all the shell commands in Polykey. Just to cover the basics for now. For more advanced uses, it's better to then present a FUSE interface.
A very important command is the ability to edit file. Now we could do something like use
$EDITOR
. But the problem is that this expects a real file somewhere. Doing this means the secret has to be leaked onto disk for random access unless we present a FUSE interface. Otherwise you have to pipe the contents to the editor, but then the editor cannot pipe back out to Polykey without some other kind of wrapper. See: https://loige.co/aws-command-line-s3-content-from-stdin-or-to-stdout/ This is a difficult problem to solve, and the GUI won't have to deal with it obviously as it can have its own editor.Another thing is that we may be able to make use of the multiaddr in libp2p so that means keynodes themselves have a p2p peer ID, but then each vault within should also have a unique id as well. I'm thinking some content-addressed ID but I'm not sure... if that may leak secrets. Otherwise what we end up is instead with some sort of unique id generation that we want to be unique across the network. So you have to ensure that each peer has a unique id (probabilistic via the public key), and then each vault also has a unique id also probabilistic via a public key as well (but if we aren't using public keys then...?). Anyway then you can have a globally unique id for vault and globally unique id for peer. So a peer could have
/a
vault, and any peer could have that. But one could also then refer to vaults regardless of the peer itself for "vault discovery".The text was updated successfully, but these errors were encountered: