-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add signing and verification CLI scripts. #240
Conversation
cdd4e12
to
7e90e2f
Compare
Hmm, this is slightly working against the support needed for the internal support (BCID) :-/ |
Is it about the conversion? the changes to the manifest or the CLI tool itself? PLMK if I can help and if it's worth to try and fix the unit tests. I'd like to avoid wasting time on that if the final call is going to be that we can't merge this change. |
Let's wait a little, as I'm still testing those parts (mostly the serialization of the manifest need to support multiple formats, so it cannot be done from |
This is just the start to finally bring the functionality of the PoC into the repo. Afterwards we can work on supporting the other manifest types. |
8242bbb
to
a168f07
Compare
THIS IS DRAFT, WIP. Will split into separate PRs once it works. But posting publicly to show what the plans are (sigstore#224, sigstore#248, sigstore#240, sigstore#111). Signed-off-by: Mihai Maruseac <[email protected]>
THIS IS DRAFT, WIP. Will split into separate PRs once it works. But posting publicly to show what the plans are (sigstore#224, sigstore#248, sigstore#240, sigstore#111). Signed-off-by: Mihai Maruseac <[email protected]>
THIS IS DRAFT, WIP. Will split into separate PRs once it works. But posting publicly to show what the plans are (sigstore#224, sigstore#248, sigstore#240, sigstore#111). Signed-off-by: Mihai Maruseac <[email protected]>
THIS IS DRAFT, WIP. Will split into separate PRs once it works. But posting publicly to show what the plans are (sigstore#224, sigstore#248, sigstore#240, sigstore#111). Signed-off-by: Mihai Maruseac <[email protected]>
3743871
to
eca7b4a
Compare
Sorry, just saw this was sent at the same time as #276. Can you rebase again, please? There are several changes here that are no longer needed. While here, can we use the existing |
That's very unfortunate. Then I'm going to rebase. I decided against a single main script because it becomes way too cluttered so I prefer the one script per function approach. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would still prefer just one CLI script instead of two. A lot of the changes would no longer be needed if there is just one script.
Also, it seems you're redefining existing machinery.
Just catching up on this PR. What remains to be updated before we get a chance to merge? |
Most importantly, moving all the experimental I'd still say we should have sign/verify in a single script, to match sigstore-python (#240 (comment)). The last iteration of the code here already uses subcommands to select the signer, but that should be via a flag, with a default, so we don't force users to always pass sigstore/pki/etc. Instead, sign/verify, which are related modes, with related arguments, should be unified. There's also the fact that the README has unrelated changes (https://github.com/sigstore/model-transparency/pull/240/files#r1705707987) but I have to edit it anyway in/after #283 so this is not high priority/blocker. |
I'm still arguing that it isn't experimental code. I'm not sure whether you get the irony but you are complaining in a sigstore project about importing sigstore. BTW if you haven't seen I restored most of the README a week ago. |
The last PR from @mihaimaruseac got merged so last rebasing needed. |
I'd say the first two (moving the code to |
I laid out the technical reason in the lengthy thread above for why it's implemented like it is as well as why two scripts should be preferable. Furthermore, the implementation shows a technically solid way to provide multiple |
This got to be too long, so let's summarize here the remaining points. Location of
|
@mihaimaruseac I hope this solves your import issues. Renaming signature to PKI does not make sense it supports signing with sigstore, pki and ec keys. wrt two scripts: |
Sure, but since you created the file, you could have created it in the
There is signing with sigstore under
Can you have signing/verifying with Sigstore be default and show this in the README, please? Please make sure to have good test coverage and fix the failing checks. |
Awesome, then it can be used in a later PR. It also looks like the tests are flaky. I haven't touched the code and the tests are failing sometimes in py3.11 and sometimes in py3.12.
We can do it in a later PR.
Please Mihai stop moving the goal posts. All checks worked before I was forced to rebase again and you continue to add new requests on top of it. |
We want to have good quality of code in here. I'm not moving the goalposts and the tests are definitely not flaky. But if you show me two runs on the same code where a test fails then passes I can revisit it. You said that we can have a default mode with the 2 scripts in the CLI, I wanted to see that in this PR. Regarding tests: in all of your PRs you've been asked to write them. Now we have a checker for coverage, but this is not moving the goalposts. We always asked for tests. |
It fails here in py3.11: https://github.com/sigstore/model-transparency/actions/runs/10475773857/job/29013190889 without me touching the code. I won't add any major things to this PR. |
Thank you. I'll look into those. They are all on Windows, fail with the same error message. Windows is not required to merge.
The only tests I moved for later was for mocking sigstore and that was pushed for later since you wanted that PR to land to continue on your pushes. This is not the case here. |
Two possible culprits here are a) TUF filepath lengths being too long for Windows to handle and b) files being moved/renamed while a file handler still has them open. Not sure if either are relevant here but thought I'd offer a pointer. (see also theupdateframework/python-tuf#454), h/t @woodruffw). |
I think it is because I didn't mock it properly, testing in #297 |
That seemed to be the reason, after more mocking 5 consecutive CI runs passed without problems. There should be no merge conflict and there is no requirement to rebase this on top of #297. The flakyness raised an issue on the future e2e test though: it seems we run into the issue b) that Dustin mentioned. We'll solve that when we have e2e tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there, please change type of ignored_paths. The others could be considered as nits, but easy to fix in this PR too, since they are one-line fixes each.
Sad that this makes CLI work with anything but sigstore.
Oh, one of your commits fails DCO. |
1d65b94
to
78fa0ff
Compare
Ok I think I broke it completely Edit: fixed it (?) |
78fa0ff
to
414e9a1
Compare
Signed-off-by: Martin Sablotny <[email protected]>
414e9a1
to
91ecc58
Compare
Signed-off-by: Martin Sablotny <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Summary
This PR adds scripts to sign and verify
FileLevelManifest
. It combines the existing functionality to create a fully working proof of concept.Signing workflow:
SimpleFileHasher
andFilesSerializer
FileLevelManifest
is converted into an in-toto statement. This is only done because sigstore does not support any other payloads in DSSE envelopes.Verification workflow:
FileLevelManifest
using theSimpleFileHasher
andFilesSerializer
.FileLevelManifest
Release Note
sign.py
andverify.py
to sign and verify modelsFileLevelManifest
to in-toto statement and the other way aroundmain.py
andmodel.py