Skip to content
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 initial draft of TAP 8 - Key rotation and explicit self-revocation #20

Merged
merged 3 commits into from
May 19, 2017

Conversation

vladimir-v-diaz
Copy link
Contributor

@vladimir-v-diaz vladimir-v-diaz commented May 10, 2017

TAP 8 has been contributed by Hannes Mehnert. Vlad has formatted Hannes' original submission to include missing headings and a TAP header.

TAP 8 has been contributed by Hannes Mehnert.  Vlad has formatted his original submission to include missing headings and a TAP header
@vladimir-v-diaz vladimir-v-diaz changed the title Add initial draft of TAP 8 Add initial draft of TAP 8 - Key rotation and explicit self-revocation May 10, 2017
is compromised can introduce a rotation cycle, all delegation to them
will be invalid.

NOTE: Since TAP 5, root is not part of snapshot anymore. does this matter?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong link, Vlad :)

TAP 5 does not mandate that the root metadata file is removed from being listed in the snapshot metadata file. I think we should make it much clearer there that it should not be removed, at least for backwards-compatibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I linked to the wrong document. Link has been updated!

@jhdalek55
Copy link
Contributor

jhdalek55 commented May 10, 2017 via email

@hannesm
Copy link
Contributor

hannesm commented May 10, 2017

thanks for putting this up, @vladimir-v-diaz

@endophage
Copy link

@JustinCappos thanks for pinging us via email. My feedback and questions copied below as requested:

I like the feature conceptually, just a few comments on the proposed implementation and some clarifications that would be helpful:

• Rather than having a new foo.rotate.hash(…) file, could that same data simply be included in the foo.hash(…) file? I assume the idea is the rotate file would be potentially much smaller, do we expect rotations of this form to happen frequently enough for it to really be necessary to have a new file?
• Just for documentation purposes, I disagree with the claim it has no security implications. This is essentially an extensions of delegations that allows them to go “sideways” in addition to down. If depth of delegation has meaning when searching the targets tree, that then has security implications. N.B. I still think this is a good feature and the tradeoff is very justifiable, it should just be appropriately documented.
• Was there some particular attacker model for which breaking on cycles provided protection? It seems like a poor use case that when I add, then eventually remove a key in a delegation, that I or one of the other remaining members have to also change our keys. I would expect the cycles to typically be benign (employee joins and leaves, contributor is assigned a finite “tour of duty”).
o Also, there needs to be clarification of whether this cycle logic applies when the canonical delegation record in the parent role has a cycle.
• Having a root.rotate.HHH doesn’t seem to make sense. If I’m going to need a threshold of the previous root keys anyway, I’d just use the existing, accepted, root rotation mechanism. I don’t think there’s a security implication here, root rotation is essentially the same “sideways” transfer of responsibility, but in the spirit of The Tao of Python: “There should be one-- and preferably only one --obvious way to do it.”

@JustinCappos
Copy link
Member

JustinCappos commented May 13, 2017 via email

@hannesm
Copy link
Contributor

hannesm commented May 15, 2017 via email

The different root metadata versions build a chain of trust, where if
the initial root is trusted (TOFU or by being distributed over a trusted
channel), following the chain of key rotations leads to verified keys
for the current root metadata. This means that even if the keys are not
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify: there's no reason to update the "version" of the root file unless the keys change, which makes root rotation equivalent to the rotate files here.

This TAP essentially adds the rotation mechanism for root keys to all of the other keys, it might be worth nothing that this increases the efficiency concerns mentioned here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIU, if the snapshot or timestamp key(s) change, you need a new root "version", don't you? You only need a rotation in case the root keys change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The requirement is only that the version bump happen when root keys change. It's up to implementations how frequently to version outside of that (for example, etags could easily handle changes to ss/ts keys without bumping the metadata version)

change. If there is a scenario where new keys are generated and
delegated to by a master key this model remains the same as in TUF
today. For example a HSM may generate and sign new timestamp keys every
hour. Since the HSM's key does not change, this is not a rotation and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can someone describe how this model would work with TUF today? Timestamp key rotation requires a signature from the root key and isn't delegation-like.

If this TAP were applied without addressing this, I think there will be some issues with the size of the snapshot file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from what I've seen, you can delegate nowadays the timestamp to a key stored in a HSM, which periodically (e.g. daily) re-signs an online timestamp key.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you point to an example where you have seen this? Does it make use of TAPs 4 or 5?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @hannesm meant to say that an HSM signs new timestamp metadata every hour, not that it generates new keys every hour. Generating new a Timestamp key requires the Root role's intervention (at least in current TUF).

may want to check if an uploaded rotate file would lead to a loop and
warn the user.

The rotate files should be listed in the snapshot metadata and should be
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this blow up fast?

Why can't we distribute this across the files? E.g. snapshot points to the "latest" rotations, and rotations reference their parents?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for timestamp and snapshot, rotations can be removed once keys are re-done (and the root file is updated). I suspect for targets, the rotation files need to be kept in place (IIRC justin had issues with garbage collecting rotate files -- i.e. if nothing delegates to the role anymore, it and all rotations can be safely removed)


# Security Analysis

There should be no negative security impact. The major benefits are
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There may not be a security "impact" but this is a very different security model than TUF before this TAP.

This changes the key hierarchy into a key bonanza (for lack of a better word :P). I like that this TAP enables you to change the trust relationship to "self-service" roles, but I'm a little concerned that those are the only types of relationships you can have under this TAP.

How can I have a delegation layer that requires sign-off from a higher role in this model? Can we make both of these things possible?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with this tap, projects can modify their "members" by rotation. a higher role can always decide to delegate elsewhere (e.g. to a single key owned by them), which then requires the higher role to approve all changes, if this is intended.

you may ask for another feature, to have (for lack of something better) colored multi-role delegations, and you require an approval from different groups of people. I'm not entirely sure whether this can be modelled with this tap, but it is worth a try.

themselves without an individual with elevated privileges, but based
on a threshold of signatures.

Clients need to take care to check for 'a rotation loop' where key
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that on every update, I have to download the entire history of rotations for all roles? (i.e. what happens if there's a rotation loop back to the first key, and I'm on key 4,006?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but I've heard that caching should be possible

the key.

Intentionally creating cycles in rotations enables a repository, a
project, and individuals to explicitly revoke their key material
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about just rotating to a "null" role or something more explicit?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can create a null role (if you have sufficient trust that you destroyed the private key after generation), and delegate to this role. in case you don't have such a (centralised) trust, I suspect you have a hard time generating a widely accepted null role.

delegations to the project being replaced. The ``project key''
represents a single point of failure / compromise. (Some projects may
prefer a quorum of developers instead, but this would require
delegations to be redone whenever this quorum changed.) Adding and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does redone mean here?

If a targets file is signed by a set of keys, the people holding those keys only need to re-sign the existing targets file with new keys.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIU, atm if you have a multi-role delegation with a threshold for a project foo, and the threshold should be modified, the delegation itself needs to be updated -- this is nothing the project foo can influence

Copy link
Contributor

@ecordell ecordell May 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The threshold and keys are modified in the parent metadata, the signatures only need to be updated in the delegation if the key change in the parent indicates it.

I.e. if a delegation foo has keys A,B,C with a threshold of 2, then the parent can change the signature requirements to C,D,E,F with a threshold of 3 without touching the delegation. In this example the delegation would need to be updated to meet the new requirements, but there's nothing stopping you from updating in lock-step to rotate keys so that the delegation is never invalid.


# Specification

To support key rotation, the new metadata file type `rotate` is
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a new top-level role? rotate.json? How are the top-level roles refreshed with the introduction of this new role?

# Specification

To support key rotation, the new metadata file type `rotate` is
introduced, which contains the new public key(s), the threshold, and is
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the exact format of this file? Where are the signatures stored?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

roughly:

signed: { "_type" : "rotate" ; keys: ... ; threshold: .. }
signatures: ...


Let's consider the project foo, initially delegated to a multi-role
threshold (of 2) to Alice, Bob, and Charlie. Let's assume the targets
file to be foo.hash(ABC2). When they want to add Dan to the project,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Root filenames are named as follows: <version_number>.root.json Is this convention changing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it will now be root.json, and root.rotate.<hash>.json, where <hash> is a secure hash of the concatenation of the (old) root keys. This file will contain the new public keys, the new threshold, and is signed by the old keys. A client starts with some initial root keys (IR), it computes H=hash(IR+threshold) and there are two possibilities: either root.rotate.H.json exists and contains new root keys, NR, or it does not exist. In the latter case, the client uses IR for verification of the signature on root.json. In the former case, the client computes NH=hash(NR+threshold) and attempts to download root.rotate.NH.json, or root.json is signed by NR directly.


Let's consider the project foo, initially delegated to a multi-role
threshold (of 2) to Alice, Bob, and Charlie. Let's assume the targets
file to be foo.hash(ABC2). When they want to add Dan to the project,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which hashing algorithm is used?


Let's consider the project foo, initially delegated to a multi-role
threshold (of 2) to Alice, Bob, and Charlie. Let's assume the targets
file to be foo.hash(ABC2). When they want to add Dan to the project,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly is ABC2? A file? The concatenation of public keys A + B + C + 2 (integer 2)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this and above - I thought multi-role delegations already have this specified -- a secure hash of the concatenation of the public keys, and the threshold value. thus, if there are multiple delegations to the same set of public keys with the same threshold, it will be identical (assuming the public keys have a total order)

under any circumstances. If a client wants to rotate to a different key
(perhaps due to losing the new key), this requires a key revocation.

TODO: Obviously example file formats, etc. need to be added.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My reading of the TAP 8 draft has left me unsure of the proposed changes. Example formats would greatly help.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll work on more concrete examples with files this week, as time permits.


TODO: Obviously example file formats, etc. need to be added.

# Security Analysis
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this section needs to analyse what happens when a threshold, and less than a threshold, of keys are compromised. The current specification explains how the Root role revokes keys that have been compromised, so how does the new scheme handle this case?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same, we don't remove the ability of the root keys (or any other higher keys) to revoke keys and modify delegations.

@endophage
Copy link

Another thought. Say we have a our targets/foo delegation role. The targets.json file contains a set of delegations keys for that role. Additionally there's a foo.rotate.HHH file. How does one determine which definition of the key set is the up to date canonical version? I don't remember seeing anything about that.

@hannesm
Copy link
Contributor

hannesm commented May 15, 2017

thanks for your comments; highly appreciated. I try to address them accurately, as far as I can.

@JustinCappos
Copy link
Member

JustinCappos commented May 15, 2017 via email

@vladimir-v-diaz
Copy link
Contributor Author

TAPs that have been assigned a TAP number will now be merged into the "master" branch. This does not mean that the merged TAP has been accepted, only that the proposed change (with potential tweaks) is likely to be incorporated into TUF.

We'll likely continue to comment on the pull request after it's been closed, so that we can easily comment on specific lines of the TAP.

@hannesm Thanks for submitting TAP 8!

@vladimir-v-diaz vladimir-v-diaz self-assigned this May 19, 2017
@vladimir-v-diaz vladimir-v-diaz merged commit 64b045a into master May 19, 2017
@vladimir-v-diaz vladimir-v-diaz deleted the tap8 branch May 19, 2017 15:43
@JustinCappos
Copy link
Member

JustinCappos commented May 19, 2017 via email

@JustinCappos
Copy link
Member

@hannesm: I wanted to revive work on this so that we can get these changes in. What are your thoughts about David's comments? I'd be happy to discuss to figure out the best way to move this forward...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants