Class: OCI::VulnerabilityScanning::Models::HostVulnerability
- Inherits:
-
Object
- Object
- OCI::VulnerabilityScanning::Models::HostVulnerability
- Defined in:
- lib/oci/vulnerability_scanning/models/host_vulnerability.rb
Overview
A vulnerability found in one or more host scans in a compartment
Constant Summary collapse
- SEVERITY_ENUM =
[ SEVERITY_NONE = 'NONE'.freeze, SEVERITY_LOW = 'LOW'.freeze, SEVERITY_MEDIUM = 'MEDIUM'.freeze, SEVERITY_HIGH = 'HIGH'.freeze, SEVERITY_CRITICAL = 'CRITICAL'.freeze, SEVERITY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- STATE_ENUM =
[ STATE_OPEN = 'OPEN'.freeze, STATE_FIXED = 'FIXED'.freeze, STATE_NOT_APPLICABLE = 'NOT_APPLICABLE'.freeze, STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- VULNERABILITY_TYPE_ENUM =
[ VULNERABILITY_TYPE_CVE = 'CVE'.freeze, VULNERABILITY_TYPE_PROBLEM = 'PROBLEM'.freeze, VULNERABILITY_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- LIFECYCLE_STATE_ENUM =
[ LIFECYCLE_STATE_CREATING = 'CREATING'.freeze, LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze, LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze, LIFECYCLE_STATE_DELETING = 'DELETING'.freeze, LIFECYCLE_STATE_DELETED = 'DELETED'.freeze, LIFECYCLE_STATE_FAILED = 'FAILED'.freeze, LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#authentication ⇒ String
Mechanism used for scan authentication.
-
#compartment_id ⇒ String
[Required] Compartment ID of the vulnerability.
- #cve_details ⇒ OCI::VulnerabilityScanning::Models::CveDetails
-
#cve_reference ⇒ String
Reference to MITRE CVE ID.
-
#host_count ⇒ Integer
[Required] Number of scanned hosts in this compartment whose scan results currently report this vulnerability.
-
#id ⇒ String
[Required] ID of the vulnerability.
-
#lifecycle_state ⇒ String
The current state of the resource.
-
#name ⇒ String
[Required] Vulnerability name.
-
#severity ⇒ String
[Required] Severity of the vulnerability.
-
#state ⇒ String
State of the vulnerability.
-
#time_first_detected ⇒ DateTime
[Required] Date of scan result that first reported the vulnerability.
-
#time_last_detected ⇒ DateTime
[Required] Date of scan result that most recently reported the vulnerability.
-
#vulnerability_type ⇒ String
[Required] Specifies the type of Vulnerability.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ HostVulnerability
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ HostVulnerability
Initializes the object
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 156 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.id = attributes[:'id'] if attributes[:'id'] self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId'] raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id') self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id'] self.authentication = attributes[:'authentication'] if attributes[:'authentication'] self.cve_reference = attributes[:'cveReference'] if attributes[:'cveReference'] raise 'You cannot provide both :cveReference and :cve_reference' if attributes.key?(:'cveReference') && attributes.key?(:'cve_reference') self.cve_reference = attributes[:'cve_reference'] if attributes[:'cve_reference'] self.cve_details = attributes[:'cveDetails'] if attributes[:'cveDetails'] raise 'You cannot provide both :cveDetails and :cve_details' if attributes.key?(:'cveDetails') && attributes.key?(:'cve_details') self.cve_details = attributes[:'cve_details'] if attributes[:'cve_details'] self.severity = attributes[:'severity'] if attributes[:'severity'] self.state = attributes[:'state'] if attributes[:'state'] self.name = attributes[:'name'] if attributes[:'name'] self.time_last_detected = attributes[:'timeLastDetected'] if attributes[:'timeLastDetected'] raise 'You cannot provide both :timeLastDetected and :time_last_detected' if attributes.key?(:'timeLastDetected') && attributes.key?(:'time_last_detected') self.time_last_detected = attributes[:'time_last_detected'] if attributes[:'time_last_detected'] self.time_first_detected = attributes[:'timeFirstDetected'] if attributes[:'timeFirstDetected'] raise 'You cannot provide both :timeFirstDetected and :time_first_detected' if attributes.key?(:'timeFirstDetected') && attributes.key?(:'time_first_detected') self.time_first_detected = attributes[:'time_first_detected'] if attributes[:'time_first_detected'] self.host_count = attributes[:'hostCount'] if attributes[:'hostCount'] raise 'You cannot provide both :hostCount and :host_count' if attributes.key?(:'hostCount') && attributes.key?(:'host_count') self.host_count = attributes[:'host_count'] if attributes[:'host_count'] self.vulnerability_type = attributes[:'vulnerabilityType'] if attributes[:'vulnerabilityType'] raise 'You cannot provide both :vulnerabilityType and :vulnerability_type' if attributes.key?(:'vulnerabilityType') && attributes.key?(:'vulnerability_type') self.vulnerability_type = attributes[:'vulnerability_type'] if attributes[:'vulnerability_type'] self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState'] raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state') self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state'] end |
Instance Attribute Details
#authentication ⇒ String
Mechanism used for scan authentication
54 55 56 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 54 def authentication @authentication end |
#compartment_id ⇒ String
[Required] Compartment ID of the vulnerability. Vulnerabilities with identical CVEs can exist in different compartments, based on scan target location
50 51 52 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 50 def compartment_id @compartment_id end |
#cve_details ⇒ OCI::VulnerabilityScanning::Models::CveDetails
61 62 63 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 61 def cve_details @cve_details end |
#cve_reference ⇒ String
Reference to MITRE CVE ID
58 59 60 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 58 def cve_reference @cve_reference end |
#host_count ⇒ Integer
[Required] Number of scanned hosts in this compartment whose scan results currently report this vulnerability
85 86 87 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 85 def host_count @host_count end |
#id ⇒ String
[Required] ID of the vulnerability
46 47 48 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 46 def id @id end |
#lifecycle_state ⇒ String
The current state of the resource.
93 94 95 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 93 def lifecycle_state @lifecycle_state end |
#name ⇒ String
[Required] Vulnerability name
73 74 75 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 73 def name @name end |
#severity ⇒ String
[Required] Severity of the vulnerability
65 66 67 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 65 def severity @severity end |
#state ⇒ String
State of the vulnerability
69 70 71 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 69 def state @state end |
#time_first_detected ⇒ DateTime
[Required] Date of scan result that first reported the vulnerability
81 82 83 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 81 def time_first_detected @time_first_detected end |
#time_last_detected ⇒ DateTime
[Required] Date of scan result that most recently reported the vulnerability
77 78 79 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 77 def time_last_detected @time_last_detected end |
#vulnerability_type ⇒ String
[Required] Specifies the type of Vulnerability
89 90 91 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 89 def vulnerability_type @vulnerability_type end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 96 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'compartment_id': :'compartmentId', 'authentication': :'authentication', 'cve_reference': :'cveReference', 'cve_details': :'cveDetails', 'severity': :'severity', 'state': :'state', 'name': :'name', 'time_last_detected': :'timeLastDetected', 'time_first_detected': :'timeFirstDetected', 'host_count': :'hostCount', 'vulnerability_type': :'vulnerabilityType', 'lifecycle_state': :'lifecycleState' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 117 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'compartment_id': :'String', 'authentication': :'String', 'cve_reference': :'String', 'cve_details': :'OCI::VulnerabilityScanning::Models::CveDetails', 'severity': :'String', 'state': :'String', 'name': :'String', 'time_last_detected': :'DateTime', 'time_first_detected': :'DateTime', 'host_count': :'Integer', 'vulnerability_type': :'String', 'lifecycle_state': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 280 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && compartment_id == other.compartment_id && authentication == other.authentication && cve_reference == other.cve_reference && cve_details == other.cve_details && severity == other.severity && state == other.state && name == other.name && time_last_detected == other.time_last_detected && time_first_detected == other.time_first_detected && host_count == other.host_count && vulnerability_type == other.vulnerability_type && lifecycle_state == other.lifecycle_state end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 322 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
302 303 304 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 302 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
311 312 313 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 311 def hash [id, compartment_id, authentication, cve_reference, cve_details, severity, state, name, time_last_detected, time_first_detected, host_count, vulnerability_type, lifecycle_state].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
355 356 357 358 359 360 361 362 363 364 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 355 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
349 350 351 |
# File 'lib/oci/vulnerability_scanning/models/host_vulnerability.rb', line 349 def to_s to_hash.to_s end |