-
Notifications
You must be signed in to change notification settings - Fork 58
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
Implemented tough-kms to include AWS KMS as a new keysource #198
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
I didn't get through tough-kms/tests/all_test.rs
, but here's what I have so far.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments for Design related questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added few other comments in last conversation. But, I could not see them any more. Adding them back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't get all the way through this. It seems like something is wrong with our design if adding a new key source causes a lot of churn in tough
. The idea behind the key source trait was to ensure that tough
(to the extent possible) doesn't know anything about what's under the hood in a key source.
Leaving the 'heavy lifting' of creating a key outside the realm of tough
would be better if it prevents us from adding dependencies to tough
.
I know you're working with Zack on this. I'd be happy to join a call to join any discussion. Thanks!
Nice start!
First, run No Rusoto dependencies should exist in the main tough crate. I moved all of the added structs to If you're comfortable with it, modify the |
Response to @iliana comment: 2: 3: |
|
We just realized that we probably shouldn't create a tokio runtime inside these libraries, so we probably shouldn't ship this until #213 is fixed. :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! As I understand it, because tough-kms needs to implement sign, the sign trait was changed to return a generic error to break dependency cycle. Looks good, looks clean.
Merging this into develop fails to compile — there are two new I'm fixing that locally and continuing to review. |
7bd0bfe
to
8896bf8
Compare
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A first pass of thoughts.
I'm unable to verify signatures produced by this code. I'm investigating why, because the answer is not obvious to me.
d059c90
to
0fa9c97
Compare
* tough-kms implements the "KeySource" trait found in tough * A new method "create" is added to "KeySource" trait to allow KeySource implementer to create Key. * Integration Tests are added in tuftool create to test 3 keysource. * To run integration tests use feature flag "integration-tests" while running test PR comments: * Removed toug-kms create and created issue awslabs#211 to handle it. * KMS CMK needs to be manually created separately * Moved Sign implementation for KmsRsaKey to tough_kms crate
Fixed some of the code review comments, with multiple stupid force pushes. you might have to look at two of them to see the complete changes. |
The DER-encoded document we are getting from the GetPublicKey API is in the SPKI format. `Decoded<RsaPem>`'s string form is SPKI, but its byte form is RSAPublicKey. Previously this code created the Decoded object from the byte form, which caused it to be double-wrapped in an SPKI document. Because we don't have access to tough's SPKI-parsing logic (not that any other crates should), we encode the certificate as a PEM and create the Decoded object from the string form.
ae2f466 fixes the verification issue! The commit message explains, but when we initially discussed how to go about creating the
|
PR comments fixes. |
I'd rather merge this first, then do the async party. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final stretch!
Fixed PR comments. Check 1st |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🌃
lgtm
Issue #, if available:
N/A
Description of changes:
-tough-kms implements the "KeySource" trait found in tough
-Unit test cases are added for tough-kms utilizing rusoto_mock
-Integration Tests are added in tuftool, to test 3 keysource: tough-kms, tough-ssm, local key.
-To run integration tests use feature flag "integ" while running test
Testing Done:
Ran Unit tests
Ran Integration Tests
Manually created root.json and used kms key for signing.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.