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

feat: Add support for DSSE Rekor type #742

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

haydentherapper
Copy link
Contributor

This is in preparation for switching over the Rekor entry type in the slsa github generator to be the newer DSSE type. This adds support for searching for both intoto v001 and dsse v001 entries.

This is in preparation for switching over the Rekor entry type in the
slsa github generator to be the newer DSSE type. This adds support for
searching for both intoto v001 and dsse v001 entries.

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
@haydentherapper
Copy link
Contributor Author

@laurentsimon Lemme know if there's anything I'm missing since I don't have full context into this codebase.

haydentherapper added a commit to haydentherapper/slsa-github-generator that referenced this pull request Feb 29, 2024
The intoto v001 type does not persist signatures of the DSSE envelope,
as noted in sigstore/rekor#973. We introduced an
intoto v002 type shortly after to fix this, but since then, we've
introduced another newer type, DSSE v001, which also does not persist
the attestation in Rekor (as we discourage using Rekor as storage).

I also updated the verifier in slsa-framework/slsa-verifier#742
to search for both Rekor entry types.

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
Copy link
Contributor

@laurentsimon laurentsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @haydentherapper

Can you link to the doc for this new type?

In terms of adding this in slsa-verifier, we need to keep backward compatibility to avoid breaking users who want too verify existing provenance. So I think we need to try the new type and fall back to the old type if we fail. Is my understanding correct?

Copy link
Contributor

@laurentsimon laurentsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -123,14 +124,19 @@ func extractCert(e *models.LogEntryAnon) (*x509.Certificate, error) {

var publicKeyB64 []byte
switch e := eimpl.(type) {
case *intotod.V001Entry:
case *intoto_v001.V001Entry:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, I commented too quickly :) Backward compatibility is done here. So I think this PR should be ready to merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this should be fully backwards compatible, this just adds the additional DSSE Rekor type. We could and should probably make another change to add the intoto v002 type for completeness.

@laurentsimon laurentsimon merged commit 52c099b into slsa-framework:main Mar 4, 2024
14 checks passed
@haydentherapper haydentherapper deleted the dsse-support branch March 4, 2024 23:32
laurentsimon added a commit to slsa-framework/slsa-github-generator that referenced this pull request Mar 26, 2024
The intoto v001 type does not persist signatures of the DSSE envelope,
as noted in sigstore/rekor#973. We introduced an
intoto v002 type shortly after to fix this, but since then, we've
introduced another newer type, DSSE v001, which also does not persist
the attestation in Rekor (as we discourage using Rekor as storage).

I also updated the verifier in
slsa-framework/slsa-verifier#742 to search for
both Rekor entry types.

# Summary

...

## Testing Process

...

## Checklist

- [ ] Review the contributing [guidelines](./../CONTRIBUTING.md)
- [ ] Add a reference to related issues in the PR description.
- [ ] Update documentation if applicable.
- [ ] Add unit tests if applicable.
- [ ] Add changes to the [CHANGELOG](./../CHANGELOG.md) if applicable.

---------

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
Signed-off-by: Hayden B <hblauzvern@google.com>
Signed-off-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>
Co-authored-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>
ramonpetgrave64 pushed a commit to ramonpetgrave64/slsa-verifier that referenced this pull request Apr 10, 2024
This is in preparation for switching over the Rekor entry type in the
slsa github generator to be the newer DSSE type. This adds support for
searching for both intoto v001 and dsse v001 entries.

Signed-off-by: Hayden Blauzvern <hblauzvern@google.com>
Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
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

Successfully merging this pull request may close these issues.

None yet

2 participants