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

Embed TUF targets to minimize downloads #608

Closed
haydentherapper opened this issue Apr 10, 2023 · 8 comments · Fixed by #611
Closed

Embed TUF targets to minimize downloads #608

haydentherapper opened this issue Apr 10, 2023 · 8 comments · Fixed by #611
Assignees
Labels
component:tuf TUF related components enhancement New feature or request

Comments

@haydentherapper
Copy link
Contributor

Description

For the Golang library, we embed a copy of the target files, and check if the target file matches the target metadata here (a necessary check since the target file may have been updated and would need to be downloaded). Would it be possible to do the same for sigstore-python?

@haydentherapper haydentherapper added the enhancement New feature or request label Apr 10, 2023
@di
Copy link
Member

di commented Apr 10, 2023

I think we'd need support from python-tuf before we can include the files here. Seems like this is the relevant issue: theupdateframework/python-tuf#2225 (cc @jku)

@di di added the component:tuf TUF related components label Apr 10, 2023
@jku
Copy link
Member

jku commented Apr 11, 2023

No, what hayden suggests is totally doable right now -- would just need a few lines of code to pre-populate the target cache from the embedded copy on startup if the target cache does not exist already.

We discussed this during the original implementation and IIRC you or william did not want to embed the target files -- at least not without an automated systems that would make sure the embedded target files are up-to-date.

@woodruffw
Copy link
Member

We discussed this during the original implementation and IIRC you or william did not want to embed the target files -- at least not without an automated systems that would make sure the embedded target files are up-to-date.

I think that was probably me 🙂 -- my memory is a little fuzzy, but I think I remember being concerned that embedding here would mean older installs breaking over time. However, that shouldn't actually be true if my understanding of TUF is right, since we'll just refresh from the repo when the embedded targets are stale.

The other concern I remember was the cache priming feeling a little hacky -- IIRC it'd boil down to copying the embedded targets into the TUF repository's directory. But I don't remember why I was opposed to that; I think that's a reasonable tradeoff for minimizing TUF roundtrips 🙂

@jku
Copy link
Member

jku commented Apr 11, 2023

The other concern I remember was the cache priming feeling a little hacky -- IIRC it'd boil down to copying the embedded targets into the TUF repository's directory

into the target cache directory, yes that's how I'd do it. python-tuf will verify anything it finds in the local cache so this does not bypass any security measures if that's what you're thinking.

@tnytown
Copy link
Collaborator

tnytown commented Apr 11, 2023

Just to clarify, the proposal right now does not include caching of the timestamp and root+1, correct?

Keeping in mind the recent bundled trust root changes, would we want to bundle the other targets, the trust root, or both?

@haydentherapper
Copy link
Contributor Author

The proposal is to bundle only the target files, not any other metadata (besides the initial TUF root, already embedded). With the new trusted_root file, you could embed only that.

And correct, it shouldn’t break older installs because if the metadata digest doesn’t match what’s embedded, the client should download the freshest copy from the online repo.

@tetsuo-cpp
Copy link
Collaborator

@tnytown Are you already looking at this? If not, I can take a stab tomorrow.

@tnytown
Copy link
Collaborator

tnytown commented Apr 13, 2023

@tnytown Are you already looking at this? If not, I can take a stab tomorrow.

Yep, I have this queued up locally! Let me brush up the tests and check it in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:tuf TUF related components enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants