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

Remove root, add delegation hashes to the snapshot metadata #40

Merged
merged 3 commits into from
Oct 17, 2019

Conversation

erickt
Copy link
Contributor

@erickt erickt commented Apr 2, 2019

According to @JustinCappos in #31, the root.json is no longer needed in the snapshot metadata, because the workflow will already have updated the root metadata before the snapshot metadata is fetched.

In addition, section 5.6 of the Mercury paper describes a need for delegations to contain hashes in order to protect against malicous mirrors that may substitute one version of the delegated metadata with another. This cannot be detected without hashing of these files.

Closes #31

@erickt
Copy link
Contributor Author

erickt commented Aug 15, 2019

Good afternoon, has anyone had a chance to review this patch? Is this the right way to implement section 5.6 of the Mercury paper?

@erickt
Copy link
Contributor Author

erickt commented Aug 16, 2019

Thanks for the review @trishankatdatadog! I incorporated your feedback.

tuf-spec.md Outdated
numbers of all metadata on the repository, excluding timestamp.json and
mirrors.json. For the root role, the hash(es), size, and version number
are listed.
numbers of all metadata on the repository, excluding root.json, timestamp.json and
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
numbers of all metadata on the repository, excluding root.json, timestamp.json and
numbers of only the top-level and all delegated targets role metadata.

Copy link
Member

Choose a reason for hiding this comment

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

Can we make this even clearer? I read your change as "top-level roles and delegated targets roles", which would mean all roles, which is not what we want. What about...

Suggested change
numbers of all metadata on the repository, excluding root.json, timestamp.json and
numbers of only the top-level targets and all delegated targets role metadata.

tuf-spec.md Outdated
mirrors.json. For the root role, the hash(es), size, and version number
are listed.
numbers of all metadata on the repository, excluding root.json, timestamp.json and
mirrors.json. The metadata length and hashes are OPTIONAL for the top-level and
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
mirrors.json. The metadata length and hashes are OPTIONAL for the top-level and
The metadata length and hashes are OPTIONAL for the top-level and

Copy link
Member

Choose a reason for hiding this comment

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

Same as above.

Suggested change
mirrors.json. The metadata length and hashes are OPTIONAL for the top-level and
The metadata length and hashes are OPTIONAL for the top-level targets and

tuf-spec.md Outdated
, ...
}

METAPATH is the metadata file's path on the repository relative to the
metadata base URL.

VERSION is listed for the root file
and all other roles available on the repository.
VERSION is listed for all roles available on the repository.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
VERSION is listed for all roles available on the repository.
VERSION is listed for the top-level and all delegated targets roles available on the repository.

Copy link
Member

Choose a reason for hiding this comment

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

Same as above.

Suggested change
VERSION is listed for all roles available on the repository.
VERSION is listed for the top-level targets and all delegated targets roles available on the repository.

@trishankatdatadog
Copy link
Member

Can someone help to apply, commit, and merge the above 3 suggestions? Thanks! @lukpueh @JustinCappos

@lukpueh
Copy link
Member

lukpueh commented Oct 11, 2019

@trishankatdatadog, I'm happy to apply suggestions and merge. Let me know if my updates make sense to you.

@trishankatdatadog
Copy link
Member

@lukpueh Yes, please do apply, some GitHub bug prevents me from applying them, thanks

@lukpueh
Copy link
Member

lukpueh commented Oct 16, 2019

@trishankatdatadog, I don't think it's a bug. We just don't have the permissions to commit to a branch on @erickt's fork. @erickt, would you mind applying the patches, so that we can merge?

@trishankatdatadog
Copy link
Member

@lukpueh Isn't there an on-by-default option that lets upstream edit PR?

@lukpueh
Copy link
Member

lukpueh commented Oct 17, 2019

@trishankatdatadog Interesting, didn't know that. And an API query to this PR page indeed returns "maintainer_can_modify": true. I'll just apply and merge locally.

@lukpueh
Copy link
Member

lukpueh commented Oct 17, 2019

Interesting (II): I cannot apply commits but I can force push to @erickt's branch, which is what I just did in order to fix a conflict with #43, re-applying a there made keyid update, i.e. (s/fce9cf.../66676d.../) in the sample snapshot.json modified here.

I also added a commit to integrate @trishankatdatadog's and my suggestions (made via GitHub UI).

@trishankatdatadog, would you mind taking another look?

erickt and others added 3 commits October 17, 2019 16:50
According to @JustinCappos in theupdateframework#31, the root.json is no longer
needed in the snapshot metadata, because the workflow will already
have updated the root metadata before the snapshot metadata is
fetched.

In addition, section 5.6 of the Mercury paper describes a need
for delegations to contain hashes in order to protect against
malicous mirrors that may substitute one version of the delegated
metadata with another. This cannot be detected without hashing
of these files.

Closes theupdateframework#31
@trishankatdatadog trishankatdatadog merged commit 0cddec0 into theupdateframework:master Oct 17, 2019
@erickt
Copy link
Contributor Author

erickt commented Oct 17, 2019

Thanks all!

@erickt erickt deleted the remove-root branch October 17, 2019 20:39
joshuagl added a commit to joshuagl/tuf that referenced this pull request Feb 28, 2020
The workflow for downloading metadata for top-level roles has changed.

Root is now updated and verified by stepping through a chain of trust
based on the currently available root metadata. For that reason
root.json is no longer needed in snapshot and has been dropped from
there per theupdateframework/specification#40

Update docstrings and comments in the Updater object to reflect the
correct flow of metadata updates:
root (if necessary) -> timestamp -> snapshot -> targets

Signed-off-by: Joshua Lock <jlock@vmware.com>
joshuagl added a commit to joshuagl/tuf that referenced this pull request Mar 4, 2020
The workflow for downloading metadata for top-level roles has changed.

Root is now updated and verified by stepping through a chain of trust
based on the currently available root metadata. For that reason
root.json is no longer needed in snapshot and has been dropped from
there per theupdateframework/specification#40

Update docstrings and comments in the Updater object to reflect the
correct flow of metadata updates:
root (if necessary) -> timestamp -> snapshot -> targets

Signed-off-by: Joshua Lock <jlock@vmware.com>
joshuagl added a commit to joshuagl/tuf that referenced this pull request Mar 11, 2020
The workflow for downloading metadata for top-level roles has changed.

Root is now updated and verified by stepping through a chain of trust
based on the currently available root metadata. For that reason
root.json is no longer needed in snapshot and has been dropped from
there per theupdateframework/specification#40

Update docstrings and comments in the Updater object to reflect the
correct flow of metadata updates:
root (if necessary) -> timestamp -> snapshot -> targets

Signed-off-by: Joshua Lock <jlock@vmware.com>
mnm678 pushed a commit to mnm678/tuf that referenced this pull request Apr 1, 2020
The workflow for downloading metadata for top-level roles has changed.

Root is now updated and verified by stepping through a chain of trust
based on the currently available root metadata. For that reason
root.json is no longer needed in snapshot and has been dropped from
there per theupdateframework/specification#40

Update docstrings and comments in the Updater object to reflect the
correct flow of metadata updates:
root (if necessary) -> timestamp -> snapshot -> targets

Signed-off-by: Joshua Lock <jlock@vmware.com>
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.

Snapshot.json example is missing hash(es) and size for the root role
3 participants