-
Notifications
You must be signed in to change notification settings - Fork 110
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
Tooling for refreshing timestamp and snapshot metadata #329
Comments
Great idea! @asraa and @haydentherapper may be interested... |
This should already be possible though? Could you explain why this works over manually running the command for snapshot and timestamp? Is it because you only want to re-sign if it changed?
|
Correct. I was experimenting with an idea where I could host TUF metadata inside a Github repository. Then have a github action that keeps the timestamp and snapshot metadata up-to-date. Having a simple wrapper command like the one I've described here, make automation much easier to achieve. |
Nice! Yeah! I have a snapshot and timestamp action here, https://github.com/sigstore/root-signing/blob/main/.github/workflows/snapshot-timestamp.yml link me to your repo, I'd love to see it! Maybe you could commit your expirations to a file, and when that file changes, it can trigger the workflow. I plan to do exactly this with creating a TUF repo metadata config here sigstore/root-signing#98 |
I agree with @asraa that I'd prefer to keep the CLI to fewer, more composable commands. I'm not opposed to convenience wrappers for common workflows, but I'd like to first think about what general functionality the CLI could provide that would make this easy. Would the following be "easy enough to script" that you wouldn't want this convenience wrapper?
So then we have: $ tuf status snapshot --valid-on=$(date -d '+1 hour') || (tuf snapshot && tuf timestamp)
$ tuf status timestamp --valid-on=$(date -d '+1 hour') || tuf timestamp
$ tuf commit # this should only commit if something changed We could bikeshed things like I could be convinced that this is a common enough pattern that |
i like the status idea better because the "refresh" approach still kind of hides what may or may-not happen (i.e. did it "commit" or not). |
I love the |
I've been playing with this idea some and am starting to like it. Here's the rough idea I've come up with: I can do a PR if that seems sensible. |
Thanks for pulling that together! It looks good to me for the most part. There's a few minor things I'd like addressed before merging:
|
I think these are good suggestions. I like |
I've really enjoyed experimenting with this tooling. One point of friction I'm hitting is with keeping my timestamp and snapshot metadata up-to-date. It's possible now with a certain amount of scripting and JSON parsing. However, I think it would help people trying to automate the handling of these 2 files if there was a helper to manage it.
I'd be happy to help, but wanted to gauge your interest in something like this first. My super simple hack right now was simply adding something like this to repo.go:
and then I added a simple CLI sub-command to call that with a "expires within the hour" default threshold.
Is this of interested, or maybe y'all have a different idea in mind?
The text was updated successfully, but these errors were encountered: