Skip to content

Add Dependency Ingestion Provenance predicate (v1) - #1

Open
mlieberman85 wants to merge 1 commit into
mainfrom
dep-track-v1
Open

Add Dependency Ingestion Provenance predicate (v1)#1
mlieberman85 wants to merge 1 commit into
mainfrom
dep-track-v1

Conversation

@mlieberman85

Copy link
Copy Markdown
Member

Summary

Adds the first predicate schema in this repo: the SLSA Dependency Ingestion
Provenance predicate defined by the SLSA Dependency Track
(merged as slsa-framework/slsa#1627).

  • New file: dependency/v1/dependency.protoDependencyIngestionProvenance
    message plus supporting messages (Ingestor, IngestionPlatform, UpstreamRef,
    IngestionEvent, ResolvedFromRef, Scan/Scanner, IntegrityVerdict,
    PublisherSignatureVerdict, PolicyEvaluation/Policy, UpstreamAttestationRef,
    SigningIsolation, IngestionIsolation).
  • README.md: documents the layout convention
    <predicate>/<version>/<predicate>.proto, package / go_package /
    java_package naming, and notes that Build / VSA / Source predicate schemas
    currently live in slsa-framework/slsa and are expected to migrate here
    over time.

Conventions established here

Since this is the first substantive PR to this repo, it also sets a few
conventions worth naming explicitly (see the README):

  • Path: <predicate>/<version>/<predicate>.proto
  • Package name: slsa.<predicate>.<version> (e.g. slsa.dependency.v1)
  • go_package: github.com/slsa-framework/protos/<predicate>/<version>
  • java_package: dev.slsa.<predicate>.<version>
  • Enumerable values as string (not enum) for implementer extensibility
  • Level-based requirements ("REQUIRED at L2+") live in the spec, not in
    the schema; validation is left to the users of these protos.

Happy to iterate on any of these.

Related

Test plan

  • protoc --proto_path=. --descriptor_set_out=/dev/null dependency/v1/dependency.proto — compiles cleanly under protoc 35.1
  • Follow-up: add a buf.yaml + CI (lint, breaking-change detection) as a separate PR

Adds the first predicate schema in this repo: the SLSA Dependency
Ingestion Provenance predicate defined by the SLSA Dependency Track.

- New file: dependency/v1/dependency.proto — DependencyIngestionProvenance
  message plus supporting messages (Ingestor, IngestionPlatform,
  UpstreamRef, IngestionEvent, ResolvedFromRef, Scan/Scanner,
  IntegrityVerdict, PublisherSignatureVerdict, PolicyEvaluation/Policy,
  UpstreamAttestationRef, SigningIsolation, IngestionIsolation).

- README.md: documents the layout convention <predicate>/<version>/<predicate>.proto,
  package/go_package/java_package naming conventions, and notes that
  Build/VSA/Source predicate schemas currently live in slsa-framework/slsa
  and are expected to migrate here over time.

The proto tracks the schema at
https://github.com/slsa-framework/slsa/blob/main/spec/dependency-provenance.md
and includes a keep-in-sync header comment pointing back to the spec.

Enumerable values (scan types, isolation methods, verdict strings) are
encoded as string fields rather than enums so implementer-defined values
remain extensible without proto changes. Level-based requirements
(REQUIRED at L2+, etc.) are documented in the spec, not in the schema;
validation of all fields is left to the users of this proto.

Signed-off-by: Michael Lieberman <mlieberman85@gmail.com>

@puerco puerco left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Small technical nits to make this work with the repo automation.

First, rename the .proto file to proto/dependency/v1/predicate.proto. When we run make generate, buf will pick it up and write the go module in the directory where the proto is now, but this lets us separate the protos and the generated code. I would also suggest dropping the README for now :)

And these two small changes:

// https://github.com/slsa-framework/slsa/blob/main/spec/dependency-provenance.md
syntax = "proto3";

package slsa.dependency.v1;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In the other protos we have a subpath to namespace the predicates:

Suggested change
package slsa.dependency.v1;
package slsa.predicates.dependency.v1;

import "google/protobuf/timestamp.proto";

option go_package = "github.com/slsa-framework/protos/dependency/v1";
option java_package = "dev.slsa.dependency.v1";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
option java_package = "dev.slsa.dependency.v1";
option java_package = "dev.slsa.predicates.dependency.v1";

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.

2 participants