vulnerability.proto 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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. import "google/protobuf/timestamp.proto";
  17. import "grafeas/v1/common.proto";
  18. import "grafeas/v1/cvss.proto";
  19. import "grafeas/v1/package.proto";
  20. option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas";
  21. option java_multiple_files = true;
  22. option java_package = "io.grafeas.v1";
  23. option objc_class_prefix = "GRA";
  24. // Note provider assigned severity/impact ranking.
  25. enum Severity {
  26. // Unknown.
  27. SEVERITY_UNSPECIFIED = 0;
  28. // Minimal severity.
  29. MINIMAL = 1;
  30. // Low severity.
  31. LOW = 2;
  32. // Medium severity.
  33. MEDIUM = 3;
  34. // High severity.
  35. HIGH = 4;
  36. // Critical severity.
  37. CRITICAL = 5;
  38. }
  39. // A security vulnerability that can be found in resources.
  40. message VulnerabilityNote {
  41. // The CVSS score of this vulnerability. CVSS score is on a scale of 0 - 10
  42. // where 0 indicates low severity and 10 indicates high severity.
  43. float cvss_score = 1;
  44. // The note provider assigned severity of this vulnerability.
  45. Severity severity = 2;
  46. // Details of all known distros and packages affected by this vulnerability.
  47. repeated Detail details = 3;
  48. // A detail for a distro and package affected by this vulnerability and its
  49. // associated fix (if one is available).
  50. message Detail {
  51. // The distro assigned severity of this vulnerability.
  52. string severity_name = 1;
  53. // A vendor-specific description of this vulnerability.
  54. string description = 2;
  55. // The type of package; whether native or non native (e.g., ruby gems,
  56. // node.js packages, etc.).
  57. string package_type = 3;
  58. // Required. The [CPE URI](https://cpe.mitre.org/specification/) this
  59. // vulnerability affects.
  60. string affected_cpe_uri = 4;
  61. // Required. The package this vulnerability affects.
  62. string affected_package = 5;
  63. // The version number at the start of an interval in which this
  64. // vulnerability exists. A vulnerability can affect a package between
  65. // version numbers that are disjoint sets of intervals (example:
  66. // [1.0.0-1.1.0], [2.4.6-2.4.8] and [4.5.6-4.6.8]) each of which will be
  67. // represented in its own Detail. If a specific affected version is provided
  68. // by a vulnerability database, affected_version_start and
  69. // affected_version_end will be the same in that Detail.
  70. grafeas.v1.Version affected_version_start = 6;
  71. // The version number at the end of an interval in which this vulnerability
  72. // exists. A vulnerability can affect a package between version numbers
  73. // that are disjoint sets of intervals (example: [1.0.0-1.1.0],
  74. // [2.4.6-2.4.8] and [4.5.6-4.6.8]) each of which will be represented in its
  75. // own Detail. If a specific affected version is provided by a vulnerability
  76. // database, affected_version_start and affected_version_end will be the
  77. // same in that Detail.
  78. grafeas.v1.Version affected_version_end = 7;
  79. // The distro recommended [CPE URI](https://cpe.mitre.org/specification/)
  80. // to update to that contains a fix for this vulnerability. It is possible
  81. // for this to be different from the affected_cpe_uri.
  82. string fixed_cpe_uri = 8;
  83. // The distro recommended package to update to that contains a fix for this
  84. // vulnerability. It is possible for this to be different from the
  85. // affected_package.
  86. string fixed_package = 9;
  87. // The distro recommended version to update to that contains a
  88. // fix for this vulnerability. Setting this to VersionKind.MAXIMUM means no
  89. // such version is yet available.
  90. grafeas.v1.Version fixed_version = 10;
  91. // Whether this detail is obsolete. Occurrences are expected not to point to
  92. // obsolete details.
  93. bool is_obsolete = 11;
  94. // The time this information was last changed at the source. This is an
  95. // upstream timestamp from the underlying information source - e.g. Ubuntu
  96. // security tracker.
  97. google.protobuf.Timestamp source_update_time = 12;
  98. }
  99. // The full description of the CVSSv3 for this vulnerability.
  100. CVSSv3 cvss_v3 = 4;
  101. // Windows details get their own format because the information format and
  102. // model don't match a normal detail. Specifically Windows updates are done as
  103. // patches, thus Windows vulnerabilities really are a missing package, rather
  104. // than a package being at an incorrect version.
  105. repeated WindowsDetail windows_details = 5;
  106. message WindowsDetail {
  107. // Required. The [CPE URI](https://cpe.mitre.org/specification/) this
  108. // vulnerability affects.
  109. string cpe_uri = 1;
  110. // Required. The name of this vulnerability.
  111. string name = 2;
  112. // The description of this vulnerability.
  113. string description = 3;
  114. // Required. The names of the KBs which have hotfixes to mitigate this
  115. // vulnerability. Note that there may be multiple hotfixes (and thus
  116. // multiple KBs) that mitigate a given vulnerability. Currently any listed
  117. // KBs presence is considered a fix.
  118. repeated KnowledgeBase fixing_kbs = 4;
  119. message KnowledgeBase {
  120. // The KB name (generally of the form KB[0-9]+ (e.g., KB123456)).
  121. string name = 1;
  122. // A link to the KB in the [Windows update catalog]
  123. // (https://www.catalog.update.microsoft.com/).
  124. string url = 2;
  125. }
  126. }
  127. // The time this information was last changed at the source. This is an
  128. // upstream timestamp from the underlying information source - e.g. Ubuntu
  129. // security tracker.
  130. google.protobuf.Timestamp source_update_time = 6;
  131. }
  132. // An occurrence of a severity vulnerability on a resource.
  133. message VulnerabilityOccurrence {
  134. // The type of package; whether native or non native (e.g., ruby gems, node.js
  135. // packages, etc.).
  136. string type = 1;
  137. // Output only. The note provider assigned severity of this vulnerability.
  138. Severity severity = 2;
  139. // Output only. The CVSS score of this vulnerability. CVSS score is on a
  140. // scale of 0 - 10 where 0 indicates low severity and 10 indicates high
  141. // severity.
  142. float cvss_score = 3;
  143. // Required. The set of affected locations and their fixes (if available)
  144. // within the associated resource.
  145. repeated PackageIssue package_issue = 4;
  146. // A detail for a distro and package this vulnerability occurrence was found
  147. // in and its associated fix (if one is available).
  148. message PackageIssue {
  149. // Required. The [CPE URI](https://cpe.mitre.org/specification/) this
  150. // vulnerability was found in.
  151. string affected_cpe_uri = 1;
  152. // Required. The package this vulnerability was found in.
  153. string affected_package = 2;
  154. // Required. The version of the package that is installed on the resource
  155. // affected by this vulnerability.
  156. grafeas.v1.Version affected_version = 3;
  157. // The [CPE URI](https://cpe.mitre.org/specification/) this vulnerability
  158. // was fixed in. It is possible for this to be different from the
  159. // affected_cpe_uri.
  160. string fixed_cpe_uri = 4;
  161. // The package this vulnerability was fixed in. It is possible for this to
  162. // be different from the affected_package.
  163. string fixed_package = 5;
  164. // Required. The version of the package this vulnerability was fixed in.
  165. // Setting this to VersionKind.MAXIMUM means no fix is yet available.
  166. grafeas.v1.Version fixed_version = 6;
  167. // Output only. Whether a fix is available for this package.
  168. bool fix_available = 7;
  169. }
  170. // Output only. A one sentence description of this vulnerability.
  171. string short_description = 5;
  172. // Output only. A detailed description of this vulnerability.
  173. string long_description = 6;
  174. // Output only. URLs related to this vulnerability.
  175. repeated grafeas.v1.RelatedUrl related_urls = 7;
  176. // The distro assigned severity for this vulnerability when it is available,
  177. // otherwise this is the note provider assigned severity.
  178. Severity effective_severity = 8;
  179. // Output only. Whether at least one of the affected packages has a fix
  180. // available.
  181. bool fix_available = 9;
  182. }