attestation.proto 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. // Copyright 2018 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. syntax = "proto3";
  15. package grafeas.v1beta1.attestation;
  16. import "google/devtools/containeranalysis/v1beta1/common/common.proto";
  17. option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/attestation;attestation";
  18. option java_multiple_files = true;
  19. option java_package = "io.grafeas.v1beta1.attestation";
  20. option objc_class_prefix = "GRA";
  21. // An attestation wrapper with a PGP-compatible signature. This message only
  22. // supports `ATTACHED` signatures, where the payload that is signed is included
  23. // alongside the signature itself in the same file.
  24. message PgpSignedAttestation {
  25. // Required. The raw content of the signature, as output by GNU Privacy Guard
  26. // (GPG) or equivalent. Since this message only supports attached signatures,
  27. // the payload that was signed must be attached. While the signature format
  28. // supported is dependent on the verification implementation, currently only
  29. // ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than
  30. // `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor
  31. // --output=signature.gpg payload.json` will create the signature content
  32. // expected in this field in `signature.gpg` for the `payload.json`
  33. // attestation payload.
  34. string signature = 1;
  35. // Type (for example schema) of the attestation payload that was signed.
  36. enum ContentType {
  37. // `ContentType` is not set.
  38. CONTENT_TYPE_UNSPECIFIED = 0;
  39. // Atomic format attestation signature. See
  40. // https://github.com/containers/image/blob/8a5d2f82a6e3263290c8e0276c3e0f64e77723e7/docs/atomic-signature.md
  41. // The payload extracted from `signature` is a JSON blob conforming to the
  42. // linked schema.
  43. SIMPLE_SIGNING_JSON = 1;
  44. }
  45. // Type (for example schema) of the attestation payload that was signed.
  46. // The verifier must ensure that the provided type is one that the verifier
  47. // supports, and that the attestation payload is a valid instantiation of that
  48. // type (for example by validating a JSON schema).
  49. ContentType content_type = 3;
  50. // This field is used by verifiers to select the public key used to validate
  51. // the signature. Note that the policy of the verifier ultimately determines
  52. // which public keys verify a signature based on the context of the
  53. // verification. There is no guarantee validation will succeed if the
  54. // verifier has no key matching this ID, even if it has a key under a
  55. // different ID that would verify the signature. Note that this ID should also
  56. // be present in the signature content above, but that is not expected to be
  57. // used by the verifier.
  58. oneof key_id {
  59. // The cryptographic fingerprint of the key used to generate the signature,
  60. // as output by, e.g. `gpg --list-keys`. This should be the version 4, full
  61. // 160-bit fingerprint, expressed as a 40 character hexidecimal string. See
  62. // https://tools.ietf.org/html/rfc4880#section-12.2 for details.
  63. // Implementations may choose to acknowledge "LONG", "SHORT", or other
  64. // abbreviated key IDs, but only the full fingerprint is guaranteed to work.
  65. // In gpg, the full fingerprint can be retrieved from the `fpr` field
  66. // returned when calling --list-keys with --with-colons. For example:
  67. // ```
  68. // gpg --with-colons --with-fingerprint --force-v4-certs \
  69. // --list-keys attester@example.com
  70. // tru::1:1513631572:0:3:1:5
  71. // pub:...<SNIP>...
  72. // fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
  73. // ```
  74. // Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
  75. string pgp_key_id = 2;
  76. }
  77. }
  78. // An attestation wrapper that uses the Grafeas `Signature` message.
  79. // This attestation must define the `serialized_payload` that the `signatures`
  80. // verify and any metadata necessary to interpret that plaintext. The
  81. // signatures should always be over the `serialized_payload` bytestring.
  82. message GenericSignedAttestation {
  83. // Type of the attestation plaintext that was signed.
  84. enum ContentType {
  85. // `ContentType` is not set.
  86. CONTENT_TYPE_UNSPECIFIED = 0;
  87. // Atomic format attestation signature. See
  88. // https://github.com/containers/image/blob/8a5d2f82a6e3263290c8e0276c3e0f64e77723e7/docs/atomic-signature.md
  89. // The payload extracted in `plaintext` is a JSON blob conforming to the
  90. // linked schema.
  91. SIMPLE_SIGNING_JSON = 1;
  92. }
  93. // Type (for example schema) of the attestation payload that was signed.
  94. // The verifier must ensure that the provided type is one that the verifier
  95. // supports, and that the attestation payload is a valid instantiation of that
  96. // type (for example by validating a JSON schema).
  97. ContentType content_type = 1;
  98. // The serialized payload that is verified by one or more `signatures`.
  99. // The encoding and semantic meaning of this payload must match what is set in
  100. // `content_type`.
  101. bytes serialized_payload = 2;
  102. // One or more signatures over `serialized_payload`. Verifier implementations
  103. // should consider this attestation message verified if at least one
  104. // `signature` verifies `serialized_payload`. See `Signature` in common.proto
  105. // for more details on signature structure and verification.
  106. repeated Signature signatures = 3;
  107. }
  108. // Note kind that represents a logical attestation "role" or "authority". For
  109. // example, an organization might have one `Authority` for "QA" and one for
  110. // "build". This note is intended to act strictly as a grouping mechanism for
  111. // the attached occurrences (Attestations). This grouping mechanism also
  112. // provides a security boundary, since IAM ACLs gate the ability for a principle
  113. // to attach an occurrence to a given note. It also provides a single point of
  114. // lookup to find all attached attestation occurrences, even if they don't all
  115. // live in the same project.
  116. message Authority {
  117. // This submessage provides human-readable hints about the purpose of the
  118. // authority. Because the name of a note acts as its resource reference, it is
  119. // important to disambiguate the canonical name of the Note (which might be a
  120. // UUID for security purposes) from "readable" names more suitable for debug
  121. // output. Note that these hints should not be used to look up authorities in
  122. // security sensitive contexts, such as when looking up attestations to
  123. // verify.
  124. message Hint {
  125. // Required. The human readable name of this attestation authority, for
  126. // example "qa".
  127. string human_readable_name = 1;
  128. }
  129. // Hint hints at the purpose of the attestation authority.
  130. Hint hint = 1;
  131. }
  132. // Details of an attestation occurrence.
  133. message Details {
  134. // Required. Attestation for the resource.
  135. Attestation attestation = 1;
  136. }
  137. // Occurrence that represents a single "attestation". The authenticity of an
  138. // attestation can be verified using the attached signature. If the verifier
  139. // trusts the public key of the signer, then verifying the signature is
  140. // sufficient to establish trust. In this circumstance, the authority to which
  141. // this attestation is attached is primarily useful for look-up (how to find
  142. // this attestation if you already know the authority and artifact to be
  143. // verified) and intent (which authority was this attestation intended to sign
  144. // for).
  145. message Attestation {
  146. // Required. The signature, generally over the `resource_url`, that verifies
  147. // this attestation. The semantics of the signature veracity are ultimately
  148. // determined by the verification engine.
  149. oneof signature {
  150. // A PGP signed attestation.
  151. PgpSignedAttestation pgp_signed_attestation = 1;
  152. GenericSignedAttestation generic_signed_attestation = 2;
  153. }
  154. }