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