vulnerability.proto 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. // Copyright 2021 Google LLC
  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 google.cloud.osconfig.v1alpha;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/protobuf/timestamp.proto";
  19. option csharp_namespace = "Google.Cloud.OsConfig.V1Alpha";
  20. option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1alpha;osconfig";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "VulnerabilityProto";
  23. option java_package = "com.google.cloud.osconfig.v1alpha";
  24. option php_namespace = "Google\\Cloud\\OsConfig\\V1alpha";
  25. option ruby_package = "Google::Cloud::OsConfig::V1alpha";
  26. // This API resource represents the vulnerability report for a specified
  27. // Compute Engine virtual machine (VM) instance at a given point in time.
  28. //
  29. // For more information, see [Vulnerability
  30. // reports](https://cloud.google.com/compute/docs/instances/os-inventory-management#vulnerability-reports).
  31. message VulnerabilityReport {
  32. option (google.api.resource) = {
  33. type: "osconfig.googleapis.com/VulnerabilityReport"
  34. pattern: "projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport"
  35. };
  36. // A vulnerability affecting the VM instance.
  37. message Vulnerability {
  38. // Contains metadata information for the vulnerability. This information is
  39. // collected from the upstream feed of the operating system.
  40. message Details {
  41. // A reference for this vulnerability.
  42. message Reference {
  43. // The url of the reference.
  44. string url = 1;
  45. // The source of the reference e.g. NVD.
  46. string source = 2;
  47. }
  48. // The CVE of the vulnerability. CVE cannot be
  49. // empty and the combination of <cve, classification> should be unique
  50. // across vulnerabilities for a VM.
  51. string cve = 1;
  52. // The CVSS V2 score of this vulnerability. CVSS V2 score is on a scale of
  53. // 0 - 10 where 0 indicates low severity and 10 indicates high severity.
  54. float cvss_v2_score = 2;
  55. // The full description of the CVSSv3 for this vulnerability from NVD.
  56. CVSSv3 cvss_v3 = 3;
  57. // Assigned severity/impact ranking from the distro.
  58. string severity = 4;
  59. // The note or description describing the vulnerability from the distro.
  60. string description = 5;
  61. // Corresponds to the references attached to the `VulnerabilityDetails`.
  62. repeated Reference references = 6;
  63. }
  64. // OS inventory item that is affected by a vulnerability or fixed as a
  65. // result of a vulnerability.
  66. message Item {
  67. // Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
  68. // This field displays the inventory items affected by this vulnerability.
  69. // If the vulnerability report was not updated after the VM inventory
  70. // update, these values might not display in VM inventory. For some
  71. // operating systems, this field might be empty.
  72. string installed_inventory_item_id = 1;
  73. // Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
  74. // If the vulnerability report was not updated after the VM inventory
  75. // update, these values might not display in VM inventory. If there is no
  76. // available fix, the field is empty. The `inventory_item` value specifies
  77. // the latest `SoftwarePackage` available to the VM that fixes the
  78. // vulnerability.
  79. string available_inventory_item_id = 2;
  80. // The recommended [CPE URI](https://cpe.mitre.org/specification/) update
  81. // that contains a fix for this vulnerability.
  82. string fixed_cpe_uri = 3;
  83. // The upstream OS patch, packages or KB that fixes the vulnerability.
  84. string upstream_fix = 4;
  85. }
  86. // Contains metadata as per the upstream feed of the operating system and
  87. // NVD.
  88. Details details = 1;
  89. // Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
  90. // This field displays the inventory items affected by this vulnerability.
  91. // If the vulnerability report was not updated after the VM inventory
  92. // update, these values might not display in VM inventory. For some distros,
  93. // this field may be empty.
  94. repeated string installed_inventory_item_ids = 2 [deprecated = true];
  95. // Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
  96. // If the vulnerability report was not updated after the VM inventory
  97. // update, these values might not display in VM inventory. If there is no
  98. // available fix, the field is empty. The `inventory_item` value specifies
  99. // the latest `SoftwarePackage` available to the VM that fixes the
  100. // vulnerability.
  101. repeated string available_inventory_item_ids = 3 [deprecated = true];
  102. // The timestamp for when the vulnerability was first detected.
  103. google.protobuf.Timestamp create_time = 4;
  104. // The timestamp for when the vulnerability was last modified.
  105. google.protobuf.Timestamp update_time = 5;
  106. // List of items affected by the vulnerability.
  107. repeated Item items = 6;
  108. }
  109. // Output only. The `vulnerabilityReport` API resource name.
  110. //
  111. // Format:
  112. // `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport`
  113. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  114. // Output only. List of vulnerabilities affecting the VM.
  115. repeated Vulnerability vulnerabilities = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  116. // Output only. The timestamp for when the last vulnerability report was generated for the
  117. // VM.
  118. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  119. }
  120. // A request message for getting the vulnerability report for the specified VM.
  121. message GetVulnerabilityReportRequest {
  122. // Required. API resource name for vulnerability resource.
  123. //
  124. // Format:
  125. // `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport`
  126. //
  127. // For `{project}`, either `project-number` or `project-id` can be provided.
  128. // For `{instance}`, either Compute Engine `instance-id` or `instance-name`
  129. // can be provided.
  130. string name = 1 [
  131. (google.api.field_behavior) = REQUIRED,
  132. (google.api.resource_reference) = {
  133. type: "osconfig.googleapis.com/VulnerabilityReport"
  134. }
  135. ];
  136. }
  137. // A request message for listing vulnerability reports for all VM instances in
  138. // the specified location.
  139. message ListVulnerabilityReportsRequest {
  140. // Required. The parent resource name.
  141. //
  142. // Format: `projects/{project}/locations/{location}/instances/-`
  143. //
  144. // For `{project}`, either `project-number` or `project-id` can be provided.
  145. string parent = 1 [
  146. (google.api.field_behavior) = REQUIRED,
  147. (google.api.resource_reference) = {
  148. type: "compute.googleapis.com/Instance"
  149. }
  150. ];
  151. // The maximum number of results to return.
  152. int32 page_size = 2;
  153. // A pagination token returned from a previous call to
  154. // `ListVulnerabilityReports` that indicates where this listing
  155. // should continue from.
  156. string page_token = 3;
  157. // If provided, this field specifies the criteria that must be met by a
  158. // `vulnerabilityReport` API resource to be included in the response.
  159. string filter = 4;
  160. }
  161. // A response message for listing vulnerability reports for all VM instances in
  162. // the specified location.
  163. message ListVulnerabilityReportsResponse {
  164. // List of vulnerabilityReport objects.
  165. repeated VulnerabilityReport vulnerability_reports = 1;
  166. // The pagination token to retrieve the next page of vulnerabilityReports
  167. // object.
  168. string next_page_token = 2;
  169. }
  170. // Common Vulnerability Scoring System version 3.
  171. // For details, see https://www.first.org/cvss/specification-document
  172. message CVSSv3 {
  173. // This metric reflects the context by which vulnerability exploitation is
  174. // possible.
  175. enum AttackVector {
  176. // Invalid value.
  177. ATTACK_VECTOR_UNSPECIFIED = 0;
  178. // The vulnerable component is bound to the network stack and the set of
  179. // possible attackers extends beyond the other options listed below, up to
  180. // and including the entire Internet.
  181. ATTACK_VECTOR_NETWORK = 1;
  182. // The vulnerable component is bound to the network stack, but the attack is
  183. // limited at the protocol level to a logically adjacent topology.
  184. ATTACK_VECTOR_ADJACENT = 2;
  185. // The vulnerable component is not bound to the network stack and the
  186. // attacker's path is via read/write/execute capabilities.
  187. ATTACK_VECTOR_LOCAL = 3;
  188. // The attack requires the attacker to physically touch or manipulate the
  189. // vulnerable component.
  190. ATTACK_VECTOR_PHYSICAL = 4;
  191. }
  192. // This metric describes the conditions beyond the attacker's control that
  193. // must exist in order to exploit the vulnerability.
  194. enum AttackComplexity {
  195. // Invalid value.
  196. ATTACK_COMPLEXITY_UNSPECIFIED = 0;
  197. // Specialized access conditions or extenuating circumstances do not exist.
  198. // An attacker can expect repeatable success when attacking the vulnerable
  199. // component.
  200. ATTACK_COMPLEXITY_LOW = 1;
  201. // A successful attack depends on conditions beyond the attacker's control.
  202. // That is, a successful attack cannot be accomplished at will, but requires
  203. // the attacker to invest in some measurable amount of effort in preparation
  204. // or execution against the vulnerable component before a successful attack
  205. // can be expected.
  206. ATTACK_COMPLEXITY_HIGH = 2;
  207. }
  208. // This metric describes the level of privileges an attacker must possess
  209. // before successfully exploiting the vulnerability.
  210. enum PrivilegesRequired {
  211. // Invalid value.
  212. PRIVILEGES_REQUIRED_UNSPECIFIED = 0;
  213. // The attacker is unauthorized prior to attack, and therefore does not
  214. // require any access to settings or files of the vulnerable system to
  215. // carry out an attack.
  216. PRIVILEGES_REQUIRED_NONE = 1;
  217. // The attacker requires privileges that provide basic user capabilities
  218. // that could normally affect only settings and files owned by a user.
  219. // Alternatively, an attacker with Low privileges has the ability to access
  220. // only non-sensitive resources.
  221. PRIVILEGES_REQUIRED_LOW = 2;
  222. // The attacker requires privileges that provide significant (e.g.,
  223. // administrative) control over the vulnerable component allowing access to
  224. // component-wide settings and files.
  225. PRIVILEGES_REQUIRED_HIGH = 3;
  226. }
  227. // This metric captures the requirement for a human user, other than the
  228. // attacker, to participate in the successful compromise of the vulnerable
  229. // component.
  230. enum UserInteraction {
  231. // Invalid value.
  232. USER_INTERACTION_UNSPECIFIED = 0;
  233. // The vulnerable system can be exploited without interaction from any user.
  234. USER_INTERACTION_NONE = 1;
  235. // Successful exploitation of this vulnerability requires a user to take
  236. // some action before the vulnerability can be exploited.
  237. USER_INTERACTION_REQUIRED = 2;
  238. }
  239. // The Scope metric captures whether a vulnerability in one vulnerable
  240. // component impacts resources in components beyond its security scope.
  241. enum Scope {
  242. // Invalid value.
  243. SCOPE_UNSPECIFIED = 0;
  244. // An exploited vulnerability can only affect resources managed by the same
  245. // security authority.
  246. SCOPE_UNCHANGED = 1;
  247. // An exploited vulnerability can affect resources beyond the security scope
  248. // managed by the security authority of the vulnerable component.
  249. SCOPE_CHANGED = 2;
  250. }
  251. // The Impact metrics capture the effects of a successfully exploited
  252. // vulnerability on the component that suffers the worst outcome that is most
  253. // directly and predictably associated with the attack.
  254. enum Impact {
  255. // Invalid value.
  256. IMPACT_UNSPECIFIED = 0;
  257. // High impact.
  258. IMPACT_HIGH = 1;
  259. // Low impact.
  260. IMPACT_LOW = 2;
  261. // No impact.
  262. IMPACT_NONE = 3;
  263. }
  264. // The base score is a function of the base metric scores.
  265. // https://www.first.org/cvss/specification-document#Base-Metrics
  266. float base_score = 1;
  267. // The Exploitability sub-score equation is derived from the Base
  268. // Exploitability metrics.
  269. // https://www.first.org/cvss/specification-document#2-1-Exploitability-Metrics
  270. float exploitability_score = 2;
  271. // The Impact sub-score equation is derived from the Base Impact metrics.
  272. float impact_score = 3;
  273. // This metric reflects the context by which vulnerability exploitation is
  274. // possible.
  275. AttackVector attack_vector = 5;
  276. // This metric describes the conditions beyond the attacker's control that
  277. // must exist in order to exploit the vulnerability.
  278. AttackComplexity attack_complexity = 6;
  279. // This metric describes the level of privileges an attacker must possess
  280. // before successfully exploiting the vulnerability.
  281. PrivilegesRequired privileges_required = 7;
  282. // This metric captures the requirement for a human user, other than the
  283. // attacker, to participate in the successful compromise of the vulnerable
  284. // component.
  285. UserInteraction user_interaction = 8;
  286. // The Scope metric captures whether a vulnerability in one vulnerable
  287. // component impacts resources in components beyond its security scope.
  288. Scope scope = 9;
  289. // This metric measures the impact to the confidentiality of the information
  290. // resources managed by a software component due to a successfully exploited
  291. // vulnerability.
  292. Impact confidentiality_impact = 10;
  293. // This metric measures the impact to integrity of a successfully exploited
  294. // vulnerability.
  295. Impact integrity_impact = 11;
  296. // This metric measures the impact to the availability of the impacted
  297. // component resulting from a successfully exploited vulnerability.
  298. Impact availability_impact = 12;
  299. }