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

Do we always need to download snapshot and targets? #227

Open
erickt opened this issue May 19, 2022 · 7 comments
Open

Do we always need to download snapshot and targets? #227

erickt opened this issue May 19, 2022 · 7 comments

Comments

@erickt
Copy link
Contributor

erickt commented May 19, 2022

I'm updating rust-tuf to work with TUF-1.0.30. As part of reading through the spec, I that @rdimitrov changed the spec in #209 to allow us to exit the update-cycle early in update-timestamp 5.4.3.1. Should we apply this same logic to snapshots and targets?

rust-tuf currently implements this, where it will exit early if:

  • When updating the snapshot metadata, check if the trusted timestamp role's snapshot version matches the trusted snapshot version, and has the correct hash value, if present.
  • When updating the targets metadata, check if the trusted snapshot role's targets version matches the trusted targets version, and has the correct hash value, if present.
  • When updating a delegated targets metadata, check if the delegating targets role's version matches the trusted delegated targets version, and has the correct hash value, if present.

Is this optimization allowed? If so, should we describe it in the spec? If not, why is this dangerous?

@JustinCappos
Copy link
Member

JustinCappos commented May 19, 2022 via email

@joshuagl
Copy link
Member

joshuagl commented May 19, 2022

Yes, I would say this optimisation is allowed. If the metadata on-disk matches what is described (version, hashes) by the describing^ verified/trusted metadata (timestamp->snapshot, snapshot->targets), we do not need to download the metadata.

python-tuf also implements these optimisations.

^ Do we have a good term for this?

@erickt
Copy link
Contributor Author

erickt commented May 19, 2022

Since it’s now optional for us to have the hashes of the metadata, do you still think this optimization is safe if we don’t have hashes? The metadata signatures should still protect us from forgery.

@erickt
Copy link
Contributor Author

erickt commented May 19, 2022

The snapshot role contains the version of all of the targets metadata files
(top-level or delegated). So in this case, I think you may mean to say
snapshot file (or I am confused about what you are saying).

Oops, yeah I meant the snapshot file.

@JustinCappos
Copy link
Member

JustinCappos commented May 19, 2022 via email

@lukpueh
Copy link
Member

lukpueh commented May 23, 2022

... describing^ ... metadata (timestamp->snapshot, snapshot->targets) ...

^ Do we have a good term for this?

I have wondered that too. I think I've seen "signs metadata for" in some TUF diagrams. If we find a good term, we should put it in a glossary.

@erickt
Copy link
Contributor Author

erickt commented May 23, 2022

FYI I started exploring this in #226.

I have wondered that too. I think I've seen "signs metadata for" in some TUF diagrams. If we find a good term, we should put it in a glossary.

@joshuagl / @lukpueh - In rust-tuf, we call this MetadataDescription, but it always felt a little awkward. Maybe "Descriptor", although that also seems a little vague.

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

No branches or pull requests

4 participants