-
Notifications
You must be signed in to change notification settings - Fork 7
UCAN keymanagment #3
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,58 @@ | ||||||
| # UCAN keypair management | ||||||
|
|
||||||
|
|
||||||
| ### Problem statement | ||||||
|
|
||||||
| Building services that use [UCAN][]s for authorization require that each service manage own keypair so it can interact with other service(s). Runnig many microservices implies having _many keypairs that need to be kept safe and secret_. | ||||||
|
|
||||||
| Additionally cross service interaction e.g. service `did:key:zUpload` invoking `access/resolve` capability on service `did:key:zAccess` implies that: | ||||||
|
|
||||||
| 1. `did:key:zAccess` needs to issue UCAN that delagets "access/resolve" to `did:key:zUpload`. | ||||||
| 2. `did:key:zUpload` need to keep delegated UCAN around in order to invoke `access/reslove`. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Gozala marked this conversation as resolved.
Outdated
|
||||||
| 3. When `did:key:zAccess` rotates keys it's DID change needs to propagate thorugh dependencies and all the capabilities need to be re-issued. | ||||||
|
Gozala marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
|
|
||||||
| It is easy to imagine this becoming a logistical nightmare with many interdependent services. | ||||||
|
|
||||||
| :::info | ||||||
| In summary we want to keep service keypair very secure so we don't have to deal with logistics of updating DIDs and UCANs across all the services that interact with it. | ||||||
| ::: | ||||||
|
|
||||||
| ### Thread model | ||||||
|
|
||||||
| > It is important to do some [thread modeling](https://en.wikipedia.org/wiki/Threat_model) in deciding what solution would provide effective safeguard against these threats. | ||||||
|
|
||||||
| #### Threat: Service key compromise | ||||||
|
|
||||||
| Compromise service keypair would enable attacker to invoke capabilities on other services that were delegated to it before compromise is discovered. | ||||||
|
|
||||||
| Our services heavily lean into content addressing and write only semantics. If all interations are also UCAN authenticated all the harm caused by compromised key could actually be undone on discovery. | ||||||
|
|
||||||
| For that reason forced key rotation is arguably the most painful fallout of such an attack as it would require updating DIDs, issued UCANs across services and potentially in our user applications. | ||||||
|
|
||||||
| #### Mitigation: Key custody | ||||||
|
|
||||||
|
|
||||||
| We could mitigate outlined thread by using a key custody service like [AWS Key Management Service](https://docs.aws.amazon.com/kms/latest/cryptographic-details/key-hierarchy.html) or [HashiCorp Vault](https://www.vaultproject.io/api-docs/secret/transit#hash-data). | ||||||
|
|
||||||
| It is however important to consider tradeoffs: | ||||||
|
|
||||||
| 1. Signing invocations would require uploading UCAN invocations into key custody introducing extra latency. | ||||||
| 2. Troubles in key custody service would have direct effect on our service operations. | ||||||
| 3. All of our cross service interactions become observale by a key custody service (even when encrypted if they manage our keys). | ||||||
|
|
||||||
| #### Migitaion: Secure supreme key | ||||||
|
Gozala marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| Instead of services delegating capabilties to each other we could model our system differently in which we have a "supreme authority" that owns all the capabilities and delegates subset to a specific services that execute them. | ||||||
|
|
||||||
| If designed this way service key rotation would barely affect others since UCANs would have been issued by "supreme authority" and not the service providing it. | ||||||
|
|
||||||
| Only time "supreme authority" private key would be required is when we need to authorize new service or revoke capabilities of the compromised one. Given the low frequency of use such "supreme key" could live in secure hardware from which it can't be extracted. Furtherome we could adopt hardware key rotation. | ||||||
|
|
||||||
| :::success | ||||||
| We could also consdier [BLS](https://en.wikipedia.org/wiki/BLS_digital_signature) and/or [Shamir's Secret Sharing](https://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing) schemes to account for hardware failures and resilience in cas of partial compromise. | ||||||
| ::: | ||||||
|
|
||||||
|
|
||||||
|
|
||||||
| [UCAN]:https://github.com/ucan-wg/spec/ | ||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.