|
| 1 | +// Copyright 2021 The Grafeas Authors. All rights reserved. |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +syntax = "proto3"; |
| 16 | + |
| 17 | +package grafeas.v1; |
| 18 | + |
| 19 | +import "google/protobuf/any.proto"; |
| 20 | +import "google/protobuf/timestamp.proto"; |
| 21 | + |
| 22 | +option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; |
| 23 | +option java_multiple_files = true; |
| 24 | +option java_package = "io.grafeas.v1"; |
| 25 | +option objc_class_prefix = "GRA"; |
| 26 | + |
| 27 | +// Spec defined at |
| 28 | +// https://github.com/in-toto/attestation/blob/main/spec/predicates/provenance.md |
| 29 | + |
| 30 | +// Steps taken to build the artifact. |
| 31 | +// For a TaskRun, typically each container corresponds to one step in the |
| 32 | +// recipe. |
| 33 | +message Recipe { |
| 34 | + // URI indicating what type of recipe was performed. It determines the meaning |
| 35 | + // of recipe.entryPoint, recipe.arguments, recipe.environment, and materials. |
| 36 | + string type = 1; |
| 37 | + // Index in materials containing the recipe steps that are not implied by |
| 38 | + // recipe.type. For example, if the recipe type were "make", then this would |
| 39 | + // point to the source containing the Makefile, not the make program itself. |
| 40 | + // Set to -1 if the recipe doesn't come from a material, as zero is default |
| 41 | + // unset value for int64. |
| 42 | + int64 defined_in_material = 2; |
| 43 | + // String identifying the entry point into the build. |
| 44 | + // This is often a path to a configuration file and/or a target label within |
| 45 | + // that file. The syntax and meaning are defined by recipe.type. For example, |
| 46 | + // if the recipe type were "make", then this would reference the directory in |
| 47 | + // which to run make as well as which target to use. |
| 48 | + string entry_point = 3; |
| 49 | + // Collection of all external inputs that influenced the build on top of |
| 50 | + // recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe |
| 51 | + // type were "make", then this might be the flags passed to make aside from |
| 52 | + // the target, which is captured in recipe.entryPoint. Since the arguments |
| 53 | + // field can greatly vary in structure, depending on the builder and recipe |
| 54 | + // type, this is of form "Any". |
| 55 | + repeated google.protobuf.Any arguments = 4; |
| 56 | + // Any other builder-controlled inputs necessary for correctly evaluating the |
| 57 | + // recipe. Usually only needed for reproducing the build but not evaluated as |
| 58 | + // part of policy. Since the environment field can greatly vary in structure, |
| 59 | + // depending on the builder and recipe type, this is of form "Any". |
| 60 | + repeated google.protobuf.Any environment = 5; |
| 61 | +} |
| 62 | + |
| 63 | +// Indicates that the builder claims certain fields in this message to be |
| 64 | +// complete. |
| 65 | +message Completeness { |
| 66 | + // If true, the builder claims that recipe.arguments is complete, meaning that |
| 67 | + // all external inputs are properly captured in the recipe. |
| 68 | + bool arguments = 1; |
| 69 | + // If true, the builder claims that recipe.environment is claimed to be |
| 70 | + // complete. |
| 71 | + bool environment = 2; |
| 72 | + // If true, the builder claims that materials are complete, usually through |
| 73 | + // some controls to prevent network access. Sometimes called "hermetic". |
| 74 | + bool materials = 3; |
| 75 | +} |
| 76 | + |
| 77 | +// Other properties of the build. |
| 78 | +message Metadata { |
| 79 | + // Identifies the particular build invocation, which can be useful for finding |
| 80 | + // associated logs or other ad-hoc analysis. The value SHOULD be globally |
| 81 | + // unique, per in-toto Provenance spec. |
| 82 | + string build_invocation_id = 1; |
| 83 | + // The timestamp of when the build started. |
| 84 | + google.protobuf.Timestamp build_started_on = 2; |
| 85 | + // The timestamp of when the build completed. |
| 86 | + google.protobuf.Timestamp build_finished_on = 3; |
| 87 | + // Indicates that the builder claims certain fields in this message to be |
| 88 | + // complete. |
| 89 | + Completeness completeness = 4; |
| 90 | + // If true, the builder claims that running the recipe on materials will |
| 91 | + // produce bit-for-bit identical output. |
| 92 | + bool reproducible = 5; |
| 93 | +} |
| 94 | + |
| 95 | +message BuilderConfig { |
| 96 | + string id = 1; |
| 97 | +} |
| 98 | + |
| 99 | +message InTotoProvenance { |
| 100 | + BuilderConfig builder_config = 1; // required |
| 101 | + // Identifies the configuration used for the build. |
| 102 | + // When combined with materials, this SHOULD fully describe the build, |
| 103 | + // such that re-running this recipe results in bit-for-bit identical output |
| 104 | + // (if the build is reproducible). |
| 105 | + Recipe recipe = 2; // required |
| 106 | + Metadata metadata = 3; |
| 107 | + // The collection of artifacts that influenced the build including sources, |
| 108 | + // dependencies, build tools, base images, and so on. This is considered to be |
| 109 | + // incomplete unless metadata.completeness.materials is true. Unset or null is |
| 110 | + // equivalent to empty. |
| 111 | + repeated string materials = 4; |
| 112 | +} |
0 commit comments