-
Notifications
You must be signed in to change notification settings - Fork 511
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
Option for protecting keystore passphrase #1091
Comments
In principle I agree with adding better ways to retrieve passwords. My initial suggestion would be to not simply add callbacks, but define an interface and implement the appropriate concrete types implementing that interface for each mechanism.
IMO this is clearer than using a bunch of closures to maintain state. There was a reason we did the existing password retriever as a closure, but as we propose alternative mechanisms, it's becoming clearer that the closure has outlived it's loc brevity. |
Thanks for the feedback. I have now updated it to use interfaces. Please let me know your thought on the below code snippet. I was thinking in terms of having a PasswordStore interface that will abstract away all the password protection details from the config code. The password store code will look like this:
The caller code in config.go will look like this:
The config will look like this:
|
@endophage Please let me know if something like this would add value |
Conceptually I think all the maintainers would agree to this improvement. I'd like broader feedback on the design before you start work on anything. The things that jump out at me in the proposed design:
|
Agreed, different HSMs may have fairly diverging config. This actually seems like a good place to try out plugins - users with unusual key storage won't be blocked on notary PRs, and notary won't be responsible for supporting all possible backends. |
@ecordell I'd be good with plugins for this, though we're holding on updating to Go 1.8 until docker/docker gets there (and they're holding off until some bugs are fixed in Go 1.8.1 apparently). We should have the 2 existing use cases (CLI stdin and env vars) built in and that should help validate the design/interface. |
@endophage @ecordell Thanks for the feedback. Will update the interface based on these. Wanted confirmation on one thing. If plugins is the direction to go towards for this feature, then given that plugins are supported only Golang 1.8 onwards, with this change, Notary will not be buildable in Go 1.7? |
That is correct, once we update to Go 1.8 (which we're holding on until Go 1.8.1), Notary will not be build-able with Go 1.7. For the moment, it should be possible to progress with the interface and built in use cases (CLI stdin, and env vars). When we move to Go 1.8.1 the plugin support will simply be another implementer of the interface. |
@ecordell @endophage I have updated as follows in the interface below, based on your feedback
|
We're going to be pretty busy up to and through DockerCon so I apologize if this doesn't get the response it deserves for a couple of weeks. We will however be having a maintainers meetup at the conference which will be a great time for the maintainers to discuss this and give you a clear "yes" or a final few suggestions. |
@endophage Thanks for this update |
@endophage Please let me know if this was discussed during DcokerCon and if there was any decision on it? |
@ecordell @endophage Any feedback on the above interface? Would it be better to go over this on a pull request? |
Hey, sorry for the delayed response. I think the immediate proposed changes are good to build and PR. I think the future stuff probably needs a little experimentation as we look at how Go plugins are best integrated (they're still new to all of us :-) |
Currently in Nortary Signer, the signing keys are AES wrapped with a password and the cipher text is persisted in a keystore.
However, the password used to AES wrap the private keys is as an environment variable.
If using the MySQL DB as a key store to persist the wrapped private keys, then the storage configruation in the signer configuration file looks as follows:
With this method of protecting private keys, the private keys are persisted as AES wrapped cipher text, but the passphrase used to wrap the private key is still available in clear text in the environemt. The problem with this method is that the private keys on the signer are as secure as the environment variable. Infact, the whole signer is as secure as this environment variable.
Solution
As we see, there is a need to protect the passphrase. There are several options, but firstly, we need to start with an additional field in the storage configuration to configure the passphrase protection method. Please find below, the same storage configuration example with an additional field 'passphrase_protect_method'.
###Options for protection
###Proposed changes in code
Callback functions as follows will be implemented for each type of protection mechanism:
The text was updated successfully, but these errors were encountered: