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

add slsa provenance predicate v0.2 protobuf #417

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

kpauljoseph
Copy link
Contributor

@kpauljoseph kpauljoseph commented Nov 29, 2024

This PR adds a proto definition for the slsa v0.2 predicate type as part of the ongoing deprecation efforts to move all the dependencies from in-toto/in-toto-golang to in-toto/attestation.

Followed the spec provided at https://slsa.dev/spec/v0.2/provenance

@kpauljoseph kpauljoseph requested a review from a team as a code owner November 29, 2024 10:01
@kpauljoseph kpauljoseph force-pushed the in-toto-v0.2-provenance branch from 4c0de80 to 27218cf Compare November 29, 2024 10:08
Copy link
Contributor

@marcelamelara marcelamelara left a comment

Choose a reason for hiding this comment

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

Thanks for sending this @kpauljoseph ! The proto looks great, though I do have one requested change.

Our convention is typically to track major versions of predicates, i.e. to store them in /v0, /v1 etc. directories. Because this is the only pre-v1 version of Provenance that we support, I suggest renaming this directory structure (as well as the language binding packages) to v0.

@adityasaky
Copy link
Member

@marcelamelara should there be an exception for v0? v1, v2 etc make sense due to semver as changes are backwards compatible but we may well have very different protos for v0.1 and v0.2? I suggest allowing minor versions for v0 so that we don't have to rename a bunch for consistency later?

@marcelamelara
Copy link
Contributor

should there be an exception for v0? v1, v2 etc make sense due to semver as changes are backwards compatible but we may well have very different protos for v0.1 and v0.2? I suggest allowing minor versions for v0 so that we don't have to rename a bunch for consistency later?

@adityasaky good question. We've kind of been deciding this on a case by case basis for v0.x predicates. If we were to pull in the v0.1 provenance predicate (which I don't think is the intent) and they were vastly different, I'd say that we can distinguish between v0.1 and v0.2. We do this for the vulns predicate, for example. But for other predicates, we've bult the breaking changes into the same proto. I think for me the answer ultimately depends on how widely used the different v0.x predicates are.

@kpauljoseph
Copy link
Contributor Author

@marcelamelara I found repos like guacsec/guac importing "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.1" and "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.2"

Are we supposed to rename the language bindings for v0.2 proto to the following?

option go_package = "github.com/in-toto/attestation/go/predicates/provenance/v0";
option java_package = "io.github.intoto.attestation.predicates.provenance.v0";

@kpauljoseph kpauljoseph force-pushed the in-toto-v0.2-provenance branch from 27218cf to 33d4df1 Compare January 18, 2025 08:58
Signed-off-by: Paul Joseph <k.paul.joseph@gmail.com>
@kpauljoseph kpauljoseph force-pushed the in-toto-v0.2-provenance branch from 33d4df1 to 4a4ddf5 Compare January 20, 2025 08:54
@marcelamelara
Copy link
Contributor

marcelamelara commented Jan 21, 2025

I found repos like guacsec/guac importing "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.1" and "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.2"

@kpauljoseph Thanks for doing this search. If GUAC is distinguishing these, then there are probably other systems that do this as well.

EDIT: No need to update the current package names. I see you already did update the package names, so I don't want to keep adding more work to your plate to change them back. To be clear, I'm still ok with the v0 naming convention. At some point, we probably also need to go to folks like GUAC and recommend switching over to the language bindings in this repo.

Copy link
Contributor

@marcelamelara marcelamelara left a comment

Choose a reason for hiding this comment

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

LGTM ! Thanks again @kpauljoseph !

@pxp928
Copy link
Member

pxp928 commented Jan 23, 2025

Thanks for doing this search. If GUAC is distinguishing these, then there are probably other systems that do this as well.

Yes, GUAC does use both import"github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.1" and "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.2" as we want to be able to support ingestion of different versions of the spec.

At some point, we probably also need to go to folks like GUAC and recommend switching over to the language bindings in this repo.

I created an issue to switch it over: guacsec/guac#2450

Copy link
Member

@pxp928 pxp928 left a comment

Choose a reason for hiding this comment

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

LGTM

@pxp928 pxp928 merged commit 808ca43 into in-toto:main Jan 23, 2025
3 checks passed
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.

4 participants