common.proto 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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;
  16. option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/common;common";
  17. option java_multiple_files = true;
  18. option java_package = "io.grafeas.v1beta1.common";
  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. }
  39. // Metadata for any related URL information.
  40. message RelatedUrl {
  41. // Specific URL associated with the resource.
  42. string url = 1;
  43. // Label to describe usage of the URL.
  44. string label = 2;
  45. }
  46. // Verifiers (e.g. Kritis implementations) MUST verify signatures
  47. // with respect to the trust anchors defined in policy (e.g. a Kritis policy).
  48. // Typically this means that the verifier has been configured with a map from
  49. // `public_key_id` to public key material (and any required parameters, e.g.
  50. // signing algorithm).
  51. //
  52. // In particular, verification implementations MUST NOT treat the signature
  53. // `public_key_id` as anything more than a key lookup hint. The `public_key_id`
  54. // DOES NOT validate or authenticate a public key; it only provides a mechanism
  55. // for quickly selecting a public key ALREADY CONFIGURED on the verifier through
  56. // a trusted channel. Verification implementations MUST reject signatures in any
  57. // of the following circumstances:
  58. // * The `public_key_id` is not recognized by the verifier.
  59. // * The public key that `public_key_id` refers to does not verify the
  60. // signature with respect to the payload.
  61. //
  62. // The `signature` contents SHOULD NOT be "attached" (where the payload is
  63. // included with the serialized `signature` bytes). Verifiers MUST ignore any
  64. // "attached" payload and only verify signatures with respect to explicitly
  65. // provided payload (e.g. a `payload` field on the proto message that holds
  66. // this Signature, or the canonical serialization of the proto message that
  67. // holds this signature).
  68. message Signature {
  69. // The content of the signature, an opaque bytestring.
  70. // The payload that this signature verifies MUST be unambiguously provided
  71. // with the Signature during verification. A wrapper message might provide
  72. // the payload explicitly. Alternatively, a message might have a canonical
  73. // serialization that can always be unambiguously computed to derive the
  74. // payload.
  75. bytes signature = 1;
  76. // The identifier for the public key that verifies this signature.
  77. // * The `public_key_id` is required.
  78. // * The `public_key_id` MUST be an RFC3986 conformant URI.
  79. // * When possible, the `public_key_id` SHOULD be an immutable reference,
  80. // such as a cryptographic digest.
  81. //
  82. // Examples of valid `public_key_id`s:
  83. //
  84. // OpenPGP V4 public key fingerprint:
  85. // * "openpgp4fpr:74FAF3B861BDA0870C7B6DEF607E48D2A663AEEA"
  86. // See https://www.iana.org/assignments/uri-schemes/prov/openpgp4fpr for more
  87. // details on this scheme.
  88. //
  89. // RFC6920 digest-named SubjectPublicKeyInfo (digest of the DER
  90. // serialization):
  91. // * "ni:///sha-256;cD9o9Cq6LG3jD0iKXqEi_vdjJGecm_iXkbqVoScViaU"
  92. // * "nih:///sha-256;703f68f42aba2c6de30f488a5ea122fef76324679c9bf89791ba95a1271589a5"
  93. string public_key_id = 2;
  94. }