xref: /aosp_15_r20/external/googleapis/grafeas/v1/common.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1*d5c09012SAndroid Build Coastguard Worker// Copyright 2019 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 Workeroption go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas";
20*d5c09012SAndroid Build Coastguard Workeroption java_multiple_files = true;
21*d5c09012SAndroid Build Coastguard Workeroption java_package = "io.grafeas.v1";
22*d5c09012SAndroid Build Coastguard Workeroption objc_class_prefix = "GRA";
23*d5c09012SAndroid Build Coastguard Worker
24*d5c09012SAndroid Build Coastguard Worker// Kind represents the kinds of notes supported.
25*d5c09012SAndroid Build Coastguard Workerenum NoteKind {
26*d5c09012SAndroid Build Coastguard Worker  // Default value. This value is unused.
27*d5c09012SAndroid Build Coastguard Worker  NOTE_KIND_UNSPECIFIED = 0;
28*d5c09012SAndroid Build Coastguard Worker  // The note and occurrence represent a package vulnerability.
29*d5c09012SAndroid Build Coastguard Worker  VULNERABILITY = 1;
30*d5c09012SAndroid Build Coastguard Worker  // The note and occurrence assert build provenance.
31*d5c09012SAndroid Build Coastguard Worker  BUILD = 2;
32*d5c09012SAndroid Build Coastguard Worker  // This represents an image basis relationship.
33*d5c09012SAndroid Build Coastguard Worker  IMAGE = 3;
34*d5c09012SAndroid Build Coastguard Worker  // This represents a package installed via a package manager.
35*d5c09012SAndroid Build Coastguard Worker  PACKAGE = 4;
36*d5c09012SAndroid Build Coastguard Worker  // The note and occurrence track deployment events.
37*d5c09012SAndroid Build Coastguard Worker  DEPLOYMENT = 5;
38*d5c09012SAndroid Build Coastguard Worker  // The note and occurrence track the initial discovery status of a resource.
39*d5c09012SAndroid Build Coastguard Worker  DISCOVERY = 6;
40*d5c09012SAndroid Build Coastguard Worker  // This represents a logical "role" that can attest to artifacts.
41*d5c09012SAndroid Build Coastguard Worker  ATTESTATION = 7;
42*d5c09012SAndroid Build Coastguard Worker  // This represents an available package upgrade.
43*d5c09012SAndroid Build Coastguard Worker  UPGRADE = 8;
44*d5c09012SAndroid Build Coastguard Worker  // This represents a Compliance Note
45*d5c09012SAndroid Build Coastguard Worker  COMPLIANCE = 9;
46*d5c09012SAndroid Build Coastguard Worker  // This represents a DSSE attestation Note
47*d5c09012SAndroid Build Coastguard Worker  DSSE_ATTESTATION = 10;
48*d5c09012SAndroid Build Coastguard Worker  // This represents a Vulnerability Assessment.
49*d5c09012SAndroid Build Coastguard Worker  VULNERABILITY_ASSESSMENT = 11;
50*d5c09012SAndroid Build Coastguard Worker  // This represents an SBOM Reference.
51*d5c09012SAndroid Build Coastguard Worker  SBOM_REFERENCE = 12;
52*d5c09012SAndroid Build Coastguard Worker}
53*d5c09012SAndroid Build Coastguard Worker
54*d5c09012SAndroid Build Coastguard Worker// Metadata for any related URL information.
55*d5c09012SAndroid Build Coastguard Workermessage RelatedUrl {
56*d5c09012SAndroid Build Coastguard Worker  // Specific URL associated with the resource.
57*d5c09012SAndroid Build Coastguard Worker  string url = 1;
58*d5c09012SAndroid Build Coastguard Worker  // Label to describe usage of the URL.
59*d5c09012SAndroid Build Coastguard Worker  string label = 2;
60*d5c09012SAndroid Build Coastguard Worker}
61*d5c09012SAndroid Build Coastguard Worker
62*d5c09012SAndroid Build Coastguard Worker// Verifiers (e.g. Kritis implementations) MUST verify signatures
63*d5c09012SAndroid Build Coastguard Worker// with respect to the trust anchors defined in policy (e.g. a Kritis policy).
64*d5c09012SAndroid Build Coastguard Worker// Typically this means that the verifier has been configured with a map from
65*d5c09012SAndroid Build Coastguard Worker// `public_key_id` to public key material (and any required parameters, e.g.
66*d5c09012SAndroid Build Coastguard Worker// signing algorithm).
67*d5c09012SAndroid Build Coastguard Worker//
68*d5c09012SAndroid Build Coastguard Worker// In particular, verification implementations MUST NOT treat the signature
69*d5c09012SAndroid Build Coastguard Worker// `public_key_id` as anything more than a key lookup hint. The `public_key_id`
70*d5c09012SAndroid Build Coastguard Worker// DOES NOT validate or authenticate a public key; it only provides a mechanism
71*d5c09012SAndroid Build Coastguard Worker// for quickly selecting a public key ALREADY CONFIGURED on the verifier through
72*d5c09012SAndroid Build Coastguard Worker// a trusted channel. Verification implementations MUST reject signatures in any
73*d5c09012SAndroid Build Coastguard Worker// of the following circumstances:
74*d5c09012SAndroid Build Coastguard Worker//   * The `public_key_id` is not recognized by the verifier.
75*d5c09012SAndroid Build Coastguard Worker//   * The public key that `public_key_id` refers to does not verify the
76*d5c09012SAndroid Build Coastguard Worker//     signature with respect to the payload.
77*d5c09012SAndroid Build Coastguard Worker//
78*d5c09012SAndroid Build Coastguard Worker// The `signature` contents SHOULD NOT be "attached" (where the payload is
79*d5c09012SAndroid Build Coastguard Worker// included with the serialized `signature` bytes). Verifiers MUST ignore any
80*d5c09012SAndroid Build Coastguard Worker// "attached" payload and only verify signatures with respect to explicitly
81*d5c09012SAndroid Build Coastguard Worker// provided payload (e.g. a `payload` field on the proto message that holds
82*d5c09012SAndroid Build Coastguard Worker// this Signature, or the canonical serialization of the proto message that
83*d5c09012SAndroid Build Coastguard Worker// holds this signature).
84*d5c09012SAndroid Build Coastguard Workermessage Signature {
85*d5c09012SAndroid Build Coastguard Worker  // The content of the signature, an opaque bytestring.
86*d5c09012SAndroid Build Coastguard Worker  // The payload that this signature verifies MUST be unambiguously provided
87*d5c09012SAndroid Build Coastguard Worker  // with the Signature during verification. A wrapper message might provide
88*d5c09012SAndroid Build Coastguard Worker  // the payload explicitly. Alternatively, a message might have a canonical
89*d5c09012SAndroid Build Coastguard Worker  // serialization that can always be unambiguously computed to derive the
90*d5c09012SAndroid Build Coastguard Worker  // payload.
91*d5c09012SAndroid Build Coastguard Worker  bytes signature = 1;
92*d5c09012SAndroid Build Coastguard Worker
93*d5c09012SAndroid Build Coastguard Worker  // The identifier for the public key that verifies this signature.
94*d5c09012SAndroid Build Coastguard Worker  //   * The `public_key_id` is required.
95*d5c09012SAndroid Build Coastguard Worker  //   * The `public_key_id` SHOULD be an RFC3986 conformant URI.
96*d5c09012SAndroid Build Coastguard Worker  //   * When possible, the `public_key_id` SHOULD be an immutable reference,
97*d5c09012SAndroid Build Coastguard Worker  //     such as a cryptographic digest.
98*d5c09012SAndroid Build Coastguard Worker  //
99*d5c09012SAndroid Build Coastguard Worker  // Examples of valid `public_key_id`s:
100*d5c09012SAndroid Build Coastguard Worker  //
101*d5c09012SAndroid Build Coastguard Worker  // OpenPGP V4 public key fingerprint:
102*d5c09012SAndroid Build Coastguard Worker  //   * "openpgp4fpr:74FAF3B861BDA0870C7B6DEF607E48D2A663AEEA"
103*d5c09012SAndroid Build Coastguard Worker  // See https://www.iana.org/assignments/uri-schemes/prov/openpgp4fpr for more
104*d5c09012SAndroid Build Coastguard Worker  // details on this scheme.
105*d5c09012SAndroid Build Coastguard Worker  //
106*d5c09012SAndroid Build Coastguard Worker  // RFC6920 digest-named SubjectPublicKeyInfo (digest of the DER
107*d5c09012SAndroid Build Coastguard Worker  // serialization):
108*d5c09012SAndroid Build Coastguard Worker  //   * "ni:///sha-256;cD9o9Cq6LG3jD0iKXqEi_vdjJGecm_iXkbqVoScViaU"
109*d5c09012SAndroid Build Coastguard Worker  //   * "nih:///sha-256;703f68f42aba2c6de30f488a5ea122fef76324679c9bf89791ba95a1271589a5"
110*d5c09012SAndroid Build Coastguard Worker  string public_key_id = 2;
111*d5c09012SAndroid Build Coastguard Worker}
112*d5c09012SAndroid Build Coastguard Worker
113*d5c09012SAndroid Build Coastguard Worker// MUST match
114*d5c09012SAndroid Build Coastguard Worker// https://github.com/secure-systems-lab/dsse/blob/master/envelope.proto. An
115*d5c09012SAndroid Build Coastguard Worker// authenticated message of arbitrary type.
116*d5c09012SAndroid Build Coastguard Workermessage Envelope {
117*d5c09012SAndroid Build Coastguard Worker  bytes payload = 1;
118*d5c09012SAndroid Build Coastguard Worker  string payload_type = 2;
119*d5c09012SAndroid Build Coastguard Worker  repeated EnvelopeSignature signatures = 3;
120*d5c09012SAndroid Build Coastguard Worker}
121*d5c09012SAndroid Build Coastguard Worker
122*d5c09012SAndroid Build Coastguard Workermessage EnvelopeSignature {
123*d5c09012SAndroid Build Coastguard Worker  bytes sig = 1;
124*d5c09012SAndroid Build Coastguard Worker  string keyid = 2;
125*d5c09012SAndroid Build Coastguard Worker}
126*d5c09012SAndroid Build Coastguard Worker
127*d5c09012SAndroid Build Coastguard Worker// Indicates the location at which a package was found.
128*d5c09012SAndroid Build Coastguard Workermessage FileLocation {
129*d5c09012SAndroid Build Coastguard Worker  // For jars that are contained inside .war files, this filepath
130*d5c09012SAndroid Build Coastguard Worker  // can indicate the path to war file combined with the path to jar file.
131*d5c09012SAndroid Build Coastguard Worker  string file_path = 1;
132*d5c09012SAndroid Build Coastguard Worker}
133*d5c09012SAndroid Build Coastguard Worker
134*d5c09012SAndroid Build Coastguard Worker// License information.
135*d5c09012SAndroid Build Coastguard Workermessage License {
136*d5c09012SAndroid Build Coastguard Worker  // Often a single license can be used to represent the licensing terms.
137*d5c09012SAndroid Build Coastguard Worker  // Sometimes it is necessary to include a choice of one or more licenses
138*d5c09012SAndroid Build Coastguard Worker  // or some combination of license identifiers.
139*d5c09012SAndroid Build Coastguard Worker  // Examples: "LGPL-2.1-only OR MIT", "LGPL-2.1-only AND MIT",
140*d5c09012SAndroid Build Coastguard Worker  // "GPL-2.0-or-later WITH Bison-exception-2.2".
141*d5c09012SAndroid Build Coastguard Worker  string expression = 1;
142*d5c09012SAndroid Build Coastguard Worker
143*d5c09012SAndroid Build Coastguard Worker  // Comments
144*d5c09012SAndroid Build Coastguard Worker  string comments = 2;
145*d5c09012SAndroid Build Coastguard Worker}
146*d5c09012SAndroid Build Coastguard Worker
147*d5c09012SAndroid Build Coastguard Worker// Digest information.
148*d5c09012SAndroid Build Coastguard Workermessage Digest {
149*d5c09012SAndroid Build Coastguard Worker  // `SHA1`, `SHA512` etc.
150*d5c09012SAndroid Build Coastguard Worker  string algo = 1;
151*d5c09012SAndroid Build Coastguard Worker
152*d5c09012SAndroid Build Coastguard Worker  // Value of the digest.
153*d5c09012SAndroid Build Coastguard Worker  bytes digest_bytes = 2;
154*d5c09012SAndroid Build Coastguard Worker}
155