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