Skip to content

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

Description

@erickt

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?

Activity

  1. JustinCappos commented on May 19, 2022

    @JustinCappos
    Member
  2. joshuagl commented on May 19, 2022

    @joshuagl
    Member

    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?

  3. erickt commented on May 19, 2022

    @erickt
    ContributorAuthor

    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.

  4. erickt commented on May 19, 2022

    @erickt
    ContributorAuthor

    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.

  5. JustinCappos commented on May 19, 2022

    @JustinCappos
    Member
  6. lukpueh commented on May 23, 2022

    @lukpueh
    Member

    ... 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.

  7. erickt commented on May 23, 2022

    @erickt
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions