-
Notifications
You must be signed in to change notification settings - Fork 171
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
Add the ability to set a custom key pair auth signing implementation #910
base: master
Are you sure you want to change the base?
Conversation
@meastham can you provide some sample code for how to generate this KMS key/pair and use it? We would need to add some unit tests to this PR. |
There are instructions for creating a key here: https://docs.aws.amazon.com/kms/latest/developerguide/asymm-create-key.html#create-asymmetric-keys-console And an example implementation for using the key for signing is in the PR description. Would you actually want to unit test KMS in this repo though? It seems like it would be simpler to unit test an implementation of |
@meastham Are you still interested in this old PR? If not please close it. I read your changes and this may trigger our internal security review. Did you think about how hackers can misuse it? |
Yes, I'm still interested in having it. I've thought through the security implications of this, and I'm not aware of any additional risks it introduces if used properly. In our case, it's a substantial net improvement from a security perspective because it avoids exposing a private key outside of our key store. |
@sfc-gh-hchaturvedi could you please review this feature changes? |
@meastham it seems to me that file- and string-based private key signing could implement the signer class to both:
There could be a unit test with a dummy implementation, but really, if the interface is implemented for file- and string-based private key signing, that's a pretty solid demonstration that the interface works. |
Overview
External contributors - please answer these questions before submitting a pull request. Thanks!
Please answer these questions before submitting your pull requests. Thanks!
What GitHub issue is this PR adressing? Make sure that there is an accompanying issue to your PR.
SNOW-576663: Allow using a private key stored in AWS KMS for key pair auth #909
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
Allows library users to create their own implementation of PrivateKeySigner which calls KMS to do the required operations. Here is the implementation I'm using. It's Kotlin but I could convert to Java if it's needed for docs or whatever. Also for this to actually work it needs a zero-arg constructor to plumb in the dependencies from somewhere which I've omitted.
Another option would be that I could just contribute this KMS support directly to this library, but that seems probably undesirable because it adds new dependencies.
Pre-review checklist