xref: /aosp_15_r20/external/googleapis/grafeas/v1/attestation.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 Workerimport "grafeas/v1/common.proto";
20*d5c09012SAndroid Build Coastguard Worker
21*d5c09012SAndroid Build Coastguard Workeroption go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas";
22*d5c09012SAndroid Build Coastguard Workeroption java_multiple_files = true;
23*d5c09012SAndroid Build Coastguard Workeroption java_package = "io.grafeas.v1";
24*d5c09012SAndroid Build Coastguard Workeroption objc_class_prefix = "GRA";
25*d5c09012SAndroid Build Coastguard Worker
26*d5c09012SAndroid Build Coastguard Worker// An attestation wrapper with a PGP-compatible signature. This message only
27*d5c09012SAndroid Build Coastguard Worker// supports `ATTACHED` signatures, where the payload that is signed is included
28*d5c09012SAndroid Build Coastguard Worker// alongside the signature itself in the same file.
29*d5c09012SAndroid Build Coastguard Worker
30*d5c09012SAndroid Build Coastguard Worker// Note kind that represents a logical attestation "role" or "authority". For
31*d5c09012SAndroid Build Coastguard Worker// example, an organization might have one `Authority` for "QA" and one for
32*d5c09012SAndroid Build Coastguard Worker// "build". This note is intended to act strictly as a grouping mechanism for
33*d5c09012SAndroid Build Coastguard Worker// the attached occurrences (Attestations). This grouping mechanism also
34*d5c09012SAndroid Build Coastguard Worker// provides a security boundary, since IAM ACLs gate the ability for a principle
35*d5c09012SAndroid Build Coastguard Worker// to attach an occurrence to a given note. It also provides a single point of
36*d5c09012SAndroid Build Coastguard Worker// lookup to find all attached attestation occurrences, even if they don't all
37*d5c09012SAndroid Build Coastguard Worker// live in the same project.
38*d5c09012SAndroid Build Coastguard Workermessage AttestationNote {
39*d5c09012SAndroid Build Coastguard Worker  // This submessage provides human-readable hints about the purpose of the
40*d5c09012SAndroid Build Coastguard Worker  // authority. Because the name of a note acts as its resource reference, it is
41*d5c09012SAndroid Build Coastguard Worker  // important to disambiguate the canonical name of the Note (which might be a
42*d5c09012SAndroid Build Coastguard Worker  // UUID for security purposes) from "readable" names more suitable for debug
43*d5c09012SAndroid Build Coastguard Worker  // output. Note that these hints should not be used to look up authorities in
44*d5c09012SAndroid Build Coastguard Worker  // security sensitive contexts, such as when looking up attestations to
45*d5c09012SAndroid Build Coastguard Worker  // verify.
46*d5c09012SAndroid Build Coastguard Worker  message Hint {
47*d5c09012SAndroid Build Coastguard Worker    // Required. The human readable name of this attestation authority, for
48*d5c09012SAndroid Build Coastguard Worker    // example "qa".
49*d5c09012SAndroid Build Coastguard Worker    string human_readable_name = 1;
50*d5c09012SAndroid Build Coastguard Worker  }
51*d5c09012SAndroid Build Coastguard Worker
52*d5c09012SAndroid Build Coastguard Worker  // Hint hints at the purpose of the attestation authority.
53*d5c09012SAndroid Build Coastguard Worker  Hint hint = 1;
54*d5c09012SAndroid Build Coastguard Worker}
55*d5c09012SAndroid Build Coastguard Worker
56*d5c09012SAndroid Build Coastguard Workermessage Jwt {
57*d5c09012SAndroid Build Coastguard Worker  // The compact encoding of a JWS, which is always three base64 encoded strings
58*d5c09012SAndroid Build Coastguard Worker  // joined by periods. For details, see:
59*d5c09012SAndroid Build Coastguard Worker  // https://tools.ietf.org/html/rfc7515.html#section-3.1
60*d5c09012SAndroid Build Coastguard Worker  string compact_jwt = 1;
61*d5c09012SAndroid Build Coastguard Worker}
62*d5c09012SAndroid Build Coastguard Worker
63*d5c09012SAndroid Build Coastguard Worker// Occurrence that represents a single "attestation". The authenticity of an
64*d5c09012SAndroid Build Coastguard Worker// attestation can be verified using the attached signature. If the verifier
65*d5c09012SAndroid Build Coastguard Worker// trusts the public key of the signer, then verifying the signature is
66*d5c09012SAndroid Build Coastguard Worker// sufficient to establish trust. In this circumstance, the authority to which
67*d5c09012SAndroid Build Coastguard Worker// this attestation is attached is primarily useful for lookup (how to find
68*d5c09012SAndroid Build Coastguard Worker// this attestation if you already know the authority and artifact to be
69*d5c09012SAndroid Build Coastguard Worker// verified) and intent (for which authority this attestation was intended to
70*d5c09012SAndroid Build Coastguard Worker// sign.
71*d5c09012SAndroid Build Coastguard Workermessage AttestationOccurrence {
72*d5c09012SAndroid Build Coastguard Worker  // Required. The serialized payload that is verified by one or more
73*d5c09012SAndroid Build Coastguard Worker  // `signatures`.
74*d5c09012SAndroid Build Coastguard Worker  bytes serialized_payload = 1;
75*d5c09012SAndroid Build Coastguard Worker  // One or more signatures over `serialized_payload`.  Verifier implementations
76*d5c09012SAndroid Build Coastguard Worker  // should consider this attestation message verified if at least one
77*d5c09012SAndroid Build Coastguard Worker  // `signature` verifies `serialized_payload`.  See `Signature` in common.proto
78*d5c09012SAndroid Build Coastguard Worker  // for more details on signature structure and verification.
79*d5c09012SAndroid Build Coastguard Worker  repeated Signature signatures = 2;
80*d5c09012SAndroid Build Coastguard Worker  // One or more JWTs encoding a self-contained attestation.
81*d5c09012SAndroid Build Coastguard Worker  // Each JWT encodes the payload that it verifies within the JWT itself.
82*d5c09012SAndroid Build Coastguard Worker  // Verifier implementation SHOULD ignore the `serialized_payload` field
83*d5c09012SAndroid Build Coastguard Worker  // when verifying these JWTs.
84*d5c09012SAndroid Build Coastguard Worker  // If only JWTs are present on this AttestationOccurrence, then the
85*d5c09012SAndroid Build Coastguard Worker  // `serialized_payload` SHOULD be left empty.
86*d5c09012SAndroid Build Coastguard Worker  // Each JWT SHOULD encode a claim specific to the `resource_uri` of this
87*d5c09012SAndroid Build Coastguard Worker  // Occurrence, but this is not validated by Grafeas metadata API
88*d5c09012SAndroid Build Coastguard Worker  // implementations.  The JWT itself is opaque to Grafeas.
89*d5c09012SAndroid Build Coastguard Worker  repeated Jwt jwts = 3;
90*d5c09012SAndroid Build Coastguard Worker}
91