common.proto 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. // Copyright 2019 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.v1;
  16. option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas";
  17. option java_multiple_files = true;
  18. option java_package = "io.grafeas.v1";
  19. option objc_class_prefix = "GRA";
  20. // Kind represents the kinds of notes supported.
  21. enum NoteKind {
  22. // Unknown.
  23. NOTE_KIND_UNSPECIFIED = 0;
  24. // The note and occurrence represent a package vulnerability.
  25. VULNERABILITY = 1;
  26. // The note and occurrence assert build provenance.
  27. BUILD = 2;
  28. // This represents an image basis relationship.
  29. IMAGE = 3;
  30. // This represents a package installed via a package manager.
  31. PACKAGE = 4;
  32. // The note and occurrence track deployment events.
  33. DEPLOYMENT = 5;
  34. // The note and occurrence track the initial discovery status of a resource.
  35. DISCOVERY = 6;
  36. // This represents a logical "role" that can attest to artifacts.
  37. ATTESTATION = 7;
  38. // This represents an available package upgrade.
  39. UPGRADE = 8;
  40. }
  41. // Metadata for any related URL information.
  42. message RelatedUrl {
  43. // Specific URL associated with the resource.
  44. string url = 1;
  45. // Label to describe usage of the URL.
  46. string label = 2;
  47. }
  48. // Verifiers (e.g. Kritis implementations) MUST verify signatures
  49. // with respect to the trust anchors defined in policy (e.g. a Kritis policy).
  50. // Typically this means that the verifier has been configured with a map from
  51. // `public_key_id` to public key material (and any required parameters, e.g.
  52. // signing algorithm).
  53. //
  54. // In particular, verification implementations MUST NOT treat the signature
  55. // `public_key_id` as anything more than a key lookup hint. The `public_key_id`
  56. // DOES NOT validate or authenticate a public key; it only provides a mechanism
  57. // for quickly selecting a public key ALREADY CONFIGURED on the verifier through
  58. // a trusted channel. Verification implementations MUST reject signatures in any
  59. // of the following circumstances:
  60. // * The `public_key_id` is not recognized by the verifier.
  61. // * The public key that `public_key_id` refers to does not verify the
  62. // signature with respect to the payload.
  63. //
  64. // The `signature` contents SHOULD NOT be "attached" (where the payload is
  65. // included with the serialized `signature` bytes). Verifiers MUST ignore any
  66. // "attached" payload and only verify signatures with respect to explicitly
  67. // provided payload (e.g. a `payload` field on the proto message that holds
  68. // this Signature, or the canonical serialization of the proto message that
  69. // holds this signature).
  70. message Signature {
  71. // The content of the signature, an opaque bytestring.
  72. // The payload that this signature verifies MUST be unambiguously provided
  73. // with the Signature during verification. A wrapper message might provide
  74. // the payload explicitly. Alternatively, a message might have a canonical
  75. // serialization that can always be unambiguously computed to derive the
  76. // payload.
  77. bytes signature = 1;
  78. // The identifier for the public key that verifies this signature.
  79. // * The `public_key_id` is required.
  80. // * The `public_key_id` MUST be an RFC3986 conformant URI.
  81. // * When possible, the `public_key_id` SHOULD be an immutable reference,
  82. // such as a cryptographic digest.
  83. //
  84. // Examples of valid `public_key_id`s:
  85. //
  86. // OpenPGP V4 public key fingerprint:
  87. // * "openpgp4fpr:74FAF3B861BDA0870C7B6DEF607E48D2A663AEEA"
  88. // See https://www.iana.org/assignments/uri-schemes/prov/openpgp4fpr for more
  89. // details on this scheme.
  90. //
  91. // RFC6920 digest-named SubjectPublicKeyInfo (digest of the DER
  92. // serialization):
  93. // * "ni:///sha-256;cD9o9Cq6LG3jD0iKXqEi_vdjJGecm_iXkbqVoScViaU"
  94. // * "nih:///sha-256;703f68f42aba2c6de30f488a5ea122fef76324679c9bf89791ba95a1271589a5"
  95. string public_key_id = 2;
  96. }