-
Notifications
You must be signed in to change notification settings - Fork 20
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
Added TAP for TUF Version Management #107
Merged
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
950dc60
added TAP 12 draft
mnm678 cc9f318
clarified client update
mnm678 1622a14
removed tap number for draft tap
mnm678 b348546
added clarifications about location of version numbers and semantic v…
mnm678 a80ab21
add intermediate root metadata for root metadata format changes
mnm678 03f7e59
added details and clarifications
mnm678 8c4c1a3
minor edits
mnm678 6de5c5d
fix link
mnm678 0b71af6
Added detail and reorganized sections
mnm678 2c3fcd9
clarifications and link to implementation
mnm678 1375ce5
added clarifications and example about how spec-version updates are h…
mnm678 156897b
minor edits
mnm678 0c178cf
Changes to address special cases.
mnm678 4bb95ee
Added use cases and description of directory structure
mnm678 87d57c2
clarifications and minor edits
mnm678 48cc83a
added some description
mnm678 986b3e3
added clarifications and grammar fixes
mnm678 f5999be
fix backward compatibility description
mnm678 3055189
add more rationale
mnm678 124e82f
add clarifications and security analysis
mnm678 468c6b8
Formatting changes
mnm678 2b7e8d7
clarifications to the multiple repositories case
mnm678 c9912d5
rework intro sections
mnm678 c1921b7
minor edits and fixes to abstract and rationale
mnm678 5ba968f
Apply suggestions from code review
mnm678 30202de
Added clarification based on review.
mnm678 9790a0c
Apply suggestions from code review
mnm678 4cee0bd
Added clarifications based on review. Especially:
mnm678 e927183
Add clarifications, especially:
mnm678 3f78127
Apply suggestions from code review
mnm678 cb81016
Update example as TUF is on version 1.0.x
mnm678 817e993
spec to specification and other minor edits for consistency and accuracy
mnm678 161db51
update with semantic versioning implementation link
mnm678 f218b82
add deprecation_timestamp field for targets metadata
mnm678 94183f9
Apply suggestions from code review
mnm678 d75e5c9
replace deprecation_timestamp with becomes_obsolete
mnm678 3fe4e52
additionally add becomes_obsolete to the timestamp metadata
mnm678 a6b3105
move becomes_obsolete to root
mnm678 b5d3bd9
Add clarifications from review
mnm678 b6b04e9
Add TAP number 14 to the version management TAP
mnm678 c933d87
Merge branch 'master' into tuf-versions
mnm678 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 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 | ||
---|---|---|---|---|
|
@@ -287,6 +287,30 @@ the creation of new metadata files in the directory for the phased out version. | |||
In order to allow clients to parse the root metadata chain, root metadata files | ||||
shall not be deleted even once a version is deprecated. | ||||
|
||||
A repository may indicate the planned phase out of a major version using an | ||||
optional `deprecation_timestamp` field in targets metadata. This field can be | ||||
added to targets metadata once a date is set for deprecation of a TUF | ||||
specification version by the repository and will include the timestamp after | ||||
which the metadata for the current specification version will no longer be | ||||
maintained. Inclusion of this field will signal to clients both that they will | ||||
mnm678 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
need to upgrade to the next specification version before the timestamp, and | ||||
that there will not be metadata available in the current directory after this | ||||
point. Both top-level and delegated targets metadata may use this field to | ||||
indicate the point after which the given TUF specification version will no | ||||
longer be supported. With the addition of this field, the "signed" portion of | ||||
targets metadata will include the following: | ||||
|
||||
``` | ||||
{ "_type" : "targets", | ||||
"spec_version" : SPEC_VERSION, | ||||
"version" : VERSION, | ||||
"expires" : EXPIRES, | ||||
"targets" : TARGETS, | ||||
("deprecation_timestamp": DEPRECATION_TIMESTAMP), | ||||
("delegations" : DELEGATIONS) | ||||
} | ||||
``` | ||||
|
||||
A repository should generate all TUF metadata, including root metadata, for all | ||||
TUF versions that the repository supports. Any update should be reflected across | ||||
all of these versions. For clarity, version numbers used for consistent | ||||
|
@@ -388,6 +412,17 @@ client should maintain functions to parse root files from previous spec | |||
versions. If the client does not support the specification version of a root file, the | ||||
client shall terminate the update and report the specification version mismatch. | ||||
|
||||
When a client validates targets metadata, they may check for the | ||||
`deprecation_timestamp` field. If this field is present, the client should do | ||||
the following: | ||||
* If the current time is after the time listed in `deprecation_timestamp`, the | ||||
client should report to the user that the update is not available due to a | ||||
version mismatch and consider the current targets metadata file invalid. If | ||||
this is the top-level targets file, the update should be terminated. | ||||
* Otherwise, the client should warn the user that the TUF specification version | ||||
they are using will be deprecated at the time indicated by `deprecation_timestamp` | ||||
and proceed with the update. | ||||
|
||||
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
|
||||
|
||||
## Special Cases | ||||
|
||||
|
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.
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.
@joshuagl I added a deprecation field as discussed. A couple of notes:
deprecation_timestamp
, so am open to any clearer or shorter name suggestionsThere 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.
Not putting this in root seems sensible. Is Targets the best role to include this in? Would the Snapshot make more sense? Or are you trying to avoid having this in metadata which will often be signed by online keys?
Regarding the name, would
becomes_obsolete
work better? It's not shorter, but may be clearer?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 went with targets instead of snapshot/timestamp mostly to allow the field to differ in delegated targets. The only attack that I can think of on this field would be a denial of service (or convincing a client to upgrade early, but it's hard to imagine that being a successful attack), so the online keys shouldn't be too much of a problem. However in this design delegated targets may use a different TUF specification version than the top-level metadata, so having this field for each targets metadata file seems useful. For example an individual delegated targets file could stop supporting version 1.x before the top-level metadata, so this field would allow them to indicate this change to the client.
I like
becomes_obsolete
, I'll update that in the text.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.
Ah, yes. I forgot about the desire to support different metadata versions in delegated targets.
I was thinking it might make more sense in an earlier role in the client workflow. If we have root, timestamp or snapshot metadata which has expired a client can't know whether that's because the metadata is obsolete, or whether something else happened (because we check the expiration on root, timestamp and snapshot and abort if the expiration has passed long before we ever download targets).
My hope was that this metadata field would
becomes_obsolete
in targets metadatabecomes_obsolete
in targets metadataThere 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.
We could also add this field to the timestamp metadata to address case 2 (with the caveat that this would not help if root metadata expires). This would also ensure that the client checks this field even if no target files have been updated (when they might not download targets metadata).
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 still have reservations about this not being in the root metadata – how do clients detect unintentionally expired root metadata (or an attack) vs. obsolete root metadata? Or, phrased differently, how does a client know when updates may be available, just at a different end-point, versus updates being unavailable?
I acknowledge your concerns about including
becomes_obsolete
in the root metadata being harder to manage. Updating metadata specification versions is a big thing, but should it require a quorum of the root signers and their offline keys? 🤷The reason I keep belabouring this point is because, to my mind, this is an aspect of TUF's freshness security design principle. The TUF website states that:
I'd argue that's not possible if the client can't detect the difference between root metadata expiring and root metadata being marked as obsolete.
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've read and thought about this and I can see why we're having an extended discussion on this point. I think this is a hard decision.
If you believe the repository is the arbiter of truth and trust, then keeping it in the root role makes sense. This does effectively let the repository's root role deprecate large swaths of targets files though. This can be good or bad.
If you think that the developer keys (targets metadata files) are what should be trusted, then having a field in targets makes sense. (I would argue for version number instead of timestamp since there isn't a global clock / sync requirement for most of TUF except perhaps to print a warning about outdated timestamp metadata.) This allows parties that delegate make the choice about what versions of metadata are alright. I do feel like this option means that no one will ever use this and that old metadata will be kept around indefinitely, because I just can't see developers worrying about using this flag...
Anyways, this is just my brain dump on the subject...
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.
Root metadata is designed to expire fairly infrequently, so clients would have a long time (potentially a year or more) to notice the
becomes_obsolete
field in timestamp metadata. However, I agree that updating the specification should be done with the knowledge of the root signers, so maybe including this field in root might be reasonable as it is rarely updated.I think regardless of whether this field goes in timestamp or root, it also needs to exist in targets metadata for this reason. In this design delegated targets metadata can use a different specification version than the top-level roles, so they need their own way to indicate deprecation. This is especially important when targets metadata is replicated across multiple repositories.
This may be another argument in favor of putting this field in root. Root metadata is always versioned whereas timestamp metadata is only versioned if consistent snapshots are used.
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.
Is that true? The detailed client workflow in the latest spec states:
I'm not sure how checking for a
becomes_obsolete
date in the metadata is any different from the requirement here to abandon an update if the root metadata file appears to have expired?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.
Thinking about this more, I think that a timestamp might be more useful to clients than a version number as it allows them to make a plan for upgrading, especially in airgapped environments or anywhere else when upgrading might take some planning.
So, per this discussion I will update the TAP to include the becomes_obsolete field in root and targets, and leave its contents as the timestamp for now. This field is optional so if updating root or using a timestamp is an issue, it could be left out.