Class: Mdm::Vuln

Inherits:
ApplicationRecord
  • Object
show all
Defined in:
app/models/mdm/vuln.rb

Overview

A vulnerability found on a #host or #service.

Instance Attribute Summary collapse

Instance Attribute Details

#exploit_attemptsActiveRecord::Relation<Mdm::ExploitAttempt>

Attempts to exploit this vulnerability.

Returns:



12
13
14
# File 'app/models/mdm/vuln.rb', line 12

has_many :exploit_attempts,
class_name: 'Mdm::ExploitAttempt',
inverse_of: :vuln

#exploited_atDateTime

When the vulnerability was exploited

Returns:

  • (DateTime)


# File 'app/models/mdm/vuln.rb', line 135

#hostMdm::Host

The host with this vulnerability.

Returns:



20
21
22
23
# File 'app/models/mdm/vuln.rb', line 20

belongs_to :host,
class_name: 'Mdm::Host',
counter_cache: :vuln_count,
inverse_of: :vulns

#infoString

Additional information about the vulnerability

Returns:

  • (String)


# File 'app/models/mdm/vuln.rb', line 145

#matchesActiveRecord::Relation<MetasploitDataModels::AutomaticExploitation::Match>

The matches for this vuln

Returns:



29
30
31
# File 'app/models/mdm/vuln.rb', line 29

has_many :matches, class_name: "MetasploitDataModels::AutomaticExploitation::Match",
as: :matchable,
dependent: :destroy

#module_detailsActiveRecord::Relation<Mdm::Module::Detail> (readonly)

Modules that share the same external references as this vuln.

Returns:



124
125
126
127
128
# File 'app/models/mdm/vuln.rb', line 124

has_many :module_details,
-> { distinct },
:class_name => 'Mdm::Module::Detail',
:source => :detail,
:through => :module_refs

#module_refsActiveRecord::Relation<Mdm::Module::Ref> (readonly)

References in module that match names in #refs.

Returns:



105
# File 'app/models/mdm/vuln.rb', line 105

has_many :module_refs, :class_name => 'Mdm::Module::Ref', :through => :refs

#module_runsActiveRecord::Relation<MetasploitDataModels::ModuleRun> (readonly)

References to times that a module has been run to exercise this vuln

Returns:



112
113
114
# File 'app/models/mdm/vuln.rb', line 112

has_many :module_runs,
class_name: 'MetasploitDataModels::ModuleRun',
as: :trackable

#nameString

The name of the vulnerability in metasploit-framework or from the import source.

Returns:

  • (String)


# File 'app/models/mdm/vuln.rb', line 140

#notes<ActiveRecord::RelationMdm::Note>

Notes about the vuln entered by a user with oldest notes first.

Returns:

  • (<ActiveRecord::RelationMdm::Note>)


80
81
82
83
84
# File 'app/models/mdm/vuln.rb', line 80

has_many :notes,
-> { order('notes.created_at') },
class_name: 'Mdm::Note',
inverse_of: :vuln,
dependent: :delete_all

#originActiveRecord::Relation<origin>

A polymorphic association to the origin that found the vulnerability.

Returns:

  • (ActiveRecord::Relation<origin>)


46
47
# File 'app/models/mdm/vuln.rb', line 46

belongs_to :origin,
polymorphic: true

#refsActiveRecord::Relation<Mdm::Ref> (readonly)

External references to this vulnerability.

Returns:



95
# File 'app/models/mdm/vuln.rb', line 95

has_many :refs, :class_name => 'Mdm::Ref', :through => :vulns_refs

#serviceMdm::Service

The service with the vulnerability.

Returns:



37
38
39
# File 'app/models/mdm/vuln.rb', line 37

belongs_to :service,
class_name: 'Mdm::Service',
inverse_of: :vulns

#vuln_attempt_countInteger

Counter cache for number of #vuln_attempts.

Returns:

  • (Integer)


# File 'app/models/mdm/vuln.rb', line 150

#vuln_attemptsActiveRecord::Relation<Mdm::VulnAttempt>

Attempts to exploit this vulnerability.

Returns:



53
54
55
56
# File 'app/models/mdm/vuln.rb', line 53

has_many :vuln_attempts,
class_name: 'Mdm::VulnAttempt',
dependent: :destroy,
inverse_of: :vuln

#vuln_detail_countInteger

Counter cache for number of #vuln_details.

Returns:

  • (Integer)


# File 'app/models/mdm/vuln.rb', line 155

#vuln_detailsActiveRecord::Relation<Mdm::VulnDetail>

Additional information about this vulnerability.

Returns:



62
63
64
65
# File 'app/models/mdm/vuln.rb', line 62

has_many :vuln_details,
class_name: 'Mdm::VulnDetail',
dependent: :destroy,
inverse_of: :vuln

#vulns_refsActiveRecord::Relation<Mdm::VulnRef>

Join model that joins this vuln to its external references.

Returns:



71
72
73
74
# File 'app/models/mdm/vuln.rb', line 71

has_many :vulns_refs,
class_name: 'Mdm::VulnRef',
dependent: :destroy,
inverse_of: :vuln