|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +# Copyright 2020 Google LLC |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | +# |
| 16 | +import proto # type: ignore |
| 17 | + |
| 18 | + |
| 19 | +__protobuf__ = proto.module( |
| 20 | + package="google.cloud.securitycenter.v1", |
| 21 | + manifest={"Vulnerability", "Cve", "Reference", "Cvssv3",}, |
| 22 | +) |
| 23 | + |
| 24 | + |
| 25 | +class Vulnerability(proto.Message): |
| 26 | + r"""Refers to common vulnerability fields e.g. cve, cvss, cwe |
| 27 | + etc. |
| 28 | +
|
| 29 | + Attributes: |
| 30 | + cve (google.cloud.securitycenter_v1.types.Cve): |
| 31 | + CVE stands for Common Vulnerabilities and |
| 32 | + Exposures (https://cve.mitre.org/about/) |
| 33 | + """ |
| 34 | + |
| 35 | + cve = proto.Field(proto.MESSAGE, number=1, message="Cve",) |
| 36 | + |
| 37 | + |
| 38 | +class Cve(proto.Message): |
| 39 | + r"""CVE stands for Common Vulnerabilities and Exposures. |
| 40 | + More information: https://cve.mitre.org |
| 41 | +
|
| 42 | + Attributes: |
| 43 | + id (str): |
| 44 | + The unique identifier for the vulnerability. |
| 45 | + e.g. CVE-2021-34527 |
| 46 | + references (Sequence[google.cloud.securitycenter_v1.types.Reference]): |
| 47 | + Additional information about the CVE. |
| 48 | + e.g. https://cve.mitre.org/cgi- |
| 49 | + bin/cvename.cgi?name=CVE-2021-34527 |
| 50 | + cvssv3 (google.cloud.securitycenter_v1.types.Cvssv3): |
| 51 | + Describe Common Vulnerability Scoring System |
| 52 | + specified at |
| 53 | + https://www.first.org/cvss/v3.1/specification- |
| 54 | + document |
| 55 | + """ |
| 56 | + |
| 57 | + id = proto.Field(proto.STRING, number=1,) |
| 58 | + references = proto.RepeatedField(proto.MESSAGE, number=2, message="Reference",) |
| 59 | + cvssv3 = proto.Field(proto.MESSAGE, number=3, message="Cvssv3",) |
| 60 | + |
| 61 | + |
| 62 | +class Reference(proto.Message): |
| 63 | + r"""Additional Links |
| 64 | +
|
| 65 | + Attributes: |
| 66 | + source (str): |
| 67 | + Source of the reference e.g. NVD |
| 68 | + uri (str): |
| 69 | + Uri for the mentioned source e.g. |
| 70 | + https://cve.mitre.org/cgi- |
| 71 | + bin/cvename.cgi?name=CVE-2021-34527. |
| 72 | + """ |
| 73 | + |
| 74 | + source = proto.Field(proto.STRING, number=1,) |
| 75 | + uri = proto.Field(proto.STRING, number=2,) |
| 76 | + |
| 77 | + |
| 78 | +class Cvssv3(proto.Message): |
| 79 | + r"""Common Vulnerability Scoring System version 3. |
| 80 | +
|
| 81 | + Attributes: |
| 82 | + base_score (float): |
| 83 | + The base score is a function of the base |
| 84 | + metric scores. |
| 85 | + attack_vector (google.cloud.securitycenter_v1.types.Cvssv3.AttackVector): |
| 86 | + Base Metrics |
| 87 | + Represents the intrinsic characteristics of a |
| 88 | + vulnerability that are constant over time and |
| 89 | + across user environments. This metric reflects |
| 90 | + the context by which vulnerability exploitation |
| 91 | + is possible. |
| 92 | + attack_complexity (google.cloud.securitycenter_v1.types.Cvssv3.AttackComplexity): |
| 93 | + This metric describes the conditions beyond |
| 94 | + the attacker's control that must exist in order |
| 95 | + to exploit the vulnerability. |
| 96 | + privileges_required (google.cloud.securitycenter_v1.types.Cvssv3.PrivilegesRequired): |
| 97 | + This metric describes the level of privileges |
| 98 | + an attacker must possess before successfully |
| 99 | + exploiting the vulnerability. |
| 100 | + user_interaction (google.cloud.securitycenter_v1.types.Cvssv3.UserInteraction): |
| 101 | + This metric captures the requirement for a |
| 102 | + human user, other than the attacker, to |
| 103 | + participate in the successful compromise of the |
| 104 | + vulnerable component. |
| 105 | + scope (google.cloud.securitycenter_v1.types.Cvssv3.Scope): |
| 106 | + The Scope metric captures whether a |
| 107 | + vulnerability in one vulnerable component |
| 108 | + impacts resources in components beyond its |
| 109 | + security scope. |
| 110 | + confidentiality_impact (google.cloud.securitycenter_v1.types.Cvssv3.Impact): |
| 111 | + This metric measures the impact to the |
| 112 | + confidentiality of the information resources |
| 113 | + managed by a software component due to a |
| 114 | + successfully exploited vulnerability. |
| 115 | + integrity_impact (google.cloud.securitycenter_v1.types.Cvssv3.Impact): |
| 116 | + This metric measures the impact to integrity |
| 117 | + of a successfully exploited vulnerability. |
| 118 | + availability_impact (google.cloud.securitycenter_v1.types.Cvssv3.Impact): |
| 119 | + This metric measures the impact to the |
| 120 | + availability of the impacted component resulting |
| 121 | + from a successfully exploited vulnerability. |
| 122 | + """ |
| 123 | + |
| 124 | + class AttackVector(proto.Enum): |
| 125 | + r"""This metric reflects the context by which vulnerability |
| 126 | + exploitation is possible. |
| 127 | + """ |
| 128 | + ATTACK_VECTOR_UNSPECIFIED = 0 |
| 129 | + ATTACK_VECTOR_NETWORK = 1 |
| 130 | + ATTACK_VECTOR_ADJACENT = 2 |
| 131 | + ATTACK_VECTOR_LOCAL = 3 |
| 132 | + ATTACK_VECTOR_PHYSICAL = 4 |
| 133 | + |
| 134 | + class AttackComplexity(proto.Enum): |
| 135 | + r"""This metric describes the conditions beyond the attacker's |
| 136 | + control that must exist in order to exploit the vulnerability. |
| 137 | + """ |
| 138 | + ATTACK_COMPLEXITY_UNSPECIFIED = 0 |
| 139 | + ATTACK_COMPLEXITY_LOW = 1 |
| 140 | + ATTACK_COMPLEXITY_HIGH = 2 |
| 141 | + |
| 142 | + class PrivilegesRequired(proto.Enum): |
| 143 | + r"""This metric describes the level of privileges an attacker |
| 144 | + must possess before successfully exploiting the vulnerability. |
| 145 | + """ |
| 146 | + PRIVILEGES_REQUIRED_UNSPECIFIED = 0 |
| 147 | + PRIVILEGES_REQUIRED_NONE = 1 |
| 148 | + PRIVILEGES_REQUIRED_LOW = 2 |
| 149 | + PRIVILEGES_REQUIRED_HIGH = 3 |
| 150 | + |
| 151 | + class UserInteraction(proto.Enum): |
| 152 | + r"""This metric captures the requirement for a human user, other |
| 153 | + than the attacker, to participate in the successful compromise |
| 154 | + of the vulnerable component. |
| 155 | + """ |
| 156 | + USER_INTERACTION_UNSPECIFIED = 0 |
| 157 | + USER_INTERACTION_NONE = 1 |
| 158 | + USER_INTERACTION_REQUIRED = 2 |
| 159 | + |
| 160 | + class Scope(proto.Enum): |
| 161 | + r"""The Scope metric captures whether a vulnerability in one |
| 162 | + vulnerable component impacts resources in components beyond its |
| 163 | + security scope. |
| 164 | + """ |
| 165 | + SCOPE_UNSPECIFIED = 0 |
| 166 | + SCOPE_UNCHANGED = 1 |
| 167 | + SCOPE_CHANGED = 2 |
| 168 | + |
| 169 | + class Impact(proto.Enum): |
| 170 | + r"""The Impact metrics capture the effects of a successfully |
| 171 | + exploited vulnerability on the component that suffers the worst |
| 172 | + outcome that is most directly and predictably associated with |
| 173 | + the attack. |
| 174 | + """ |
| 175 | + IMPACT_UNSPECIFIED = 0 |
| 176 | + IMPACT_HIGH = 1 |
| 177 | + IMPACT_LOW = 2 |
| 178 | + IMPACT_NONE = 3 |
| 179 | + |
| 180 | + base_score = proto.Field(proto.DOUBLE, number=1,) |
| 181 | + attack_vector = proto.Field(proto.ENUM, number=5, enum=AttackVector,) |
| 182 | + attack_complexity = proto.Field(proto.ENUM, number=6, enum=AttackComplexity,) |
| 183 | + privileges_required = proto.Field(proto.ENUM, number=7, enum=PrivilegesRequired,) |
| 184 | + user_interaction = proto.Field(proto.ENUM, number=8, enum=UserInteraction,) |
| 185 | + scope = proto.Field(proto.ENUM, number=9, enum=Scope,) |
| 186 | + confidentiality_impact = proto.Field(proto.ENUM, number=10, enum=Impact,) |
| 187 | + integrity_impact = proto.Field(proto.ENUM, number=11, enum=Impact,) |
| 188 | + availability_impact = proto.Field(proto.ENUM, number=12, enum=Impact,) |
| 189 | + |
| 190 | + |
| 191 | +__all__ = tuple(sorted(__protobuf__.manifest)) |
0 commit comments