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

Provenance-defined build recipe #159

Closed
msuozzo opened this issue Sep 13, 2021 · 2 comments
Closed

Provenance-defined build recipe #159

msuozzo opened this issue Sep 13, 2021 · 2 comments
Labels
duplicate This issue or pull request already exists provenance Applies to SLSA provenance spec

Comments

@msuozzo
Copy link
Contributor

msuozzo commented Sep 13, 2021

Now that #141 has created the need for the provenance to represent fully-specified build definitions, we should try to make this experience better. Currently, the recipe definition is as follows:

recipe:
  type: string
  definedInMaterial: int
  entryPoint: string
  arguments: object
  environments: object

Given the presence of fields like definedInMaterial, where would a new user think to put / look for a build definition? Maybe arguments (where I think it's currently intended to be) but perhaps after needing to read the docs thoroughly and perhaps not even then.

The justification for separating out the build definition for entryPoint is given as:

Design rationale: The entryPoint is distinct from arguments to make it easier to write secure policies without having to parse arguments.

I'd argue that a similar treatment deserves to be given to the build definition.

One nice consequence of this would be that arguments would be of a uniform structure for a builder that supports both dynamic and static configuration (e.g. the cloud build example which could mean the recipe type need not differ between the two variants (would be easier to implement+maintain for the builder).

Proposal

This could be addressed by pulling out another type-defined field to the top level:

recipe:
  type: string
  definedAs: object  # <---- NEW
  definedInMaterial: int
  entryPoint: string
  arguments: object
  environments: object

Another alternative would be to add even more structure:

recipe:
  type: string
  definition:
    content: object
    # OR
    materialsIndex: int
    entryPoint: string
  arguments: object
  environments: object
@msuozzo msuozzo added the provenance Applies to SLSA provenance spec label Sep 13, 2021
@TomHennen
Copy link
Contributor

TomHennen commented Sep 13, 2021

Design rationale: The entryPoint is distinct from arguments to make it easier to write secure policies without having to parse arguments.

I'd argue that a similar treatment deserves to be given to the build definition.

At the moment we have a distinct plan for using the entryPoint in policy checks. As far as I know we have no such plan for using the build definition.

The build instructions at lower levels are there, for the most part, to enable people to review and understand what was done, and attempt to reproduce the build.

@MarkLodato
Copy link
Member

I believe this is a duplicate of #176 (and sub-issues) and was addressed by #179.

@MarkLodato MarkLodato added the duplicate This issue or pull request already exists label Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists provenance Applies to SLSA provenance spec
Projects
None yet
Development

No branches or pull requests

3 participants