Class: Mdm::Service

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/mdm/service.rb

Overview

A service, such as an ssh server or web server, running on a #host.

Constant Summary collapse

STATES =

Valid values for #state.

['open', 'closed', 'filtered', 'unknown']

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#credsArray<Mdm::Cred>

Credentials gathered from this service.

Returns:



30
# File 'app/models/mdm/service.rb', line 30

has_many :creds, :dependent => :destroy, :class_name => 'Mdm::Cred'

#exploited_hostsArray<Mdm::ExploitHost>

Returns:

  • (Array<Mdm::ExploitHost>)


35
# File 'app/models/mdm/service.rb', line 35

has_many :exploited_hosts, :dependent => :destroy, :class_name => 'Mdm::ExploitedHost'

#hostMdm::Host

The host on which this service runs.

Returns:



41
# File 'app/models/mdm/service.rb', line 41

belongs_to :host, :class_name => 'Mdm::Host', :counter_cache => :service_count

#infoString

Additional information about the service that does not fit in the #name or #proto.

Returns:

  • (String)


# File 'app/models/mdm/service.rb', line 87

#nameString

The name of the service.

Returns:

  • (String)


# File 'app/models/mdm/service.rb', line 97

#notesArray<Mdm::Note>

Notes about this service.

Returns:



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

has_many :notes, :dependent => :destroy, :class_name => 'Mdm::Note'

#portInteger

The port on which this service runs on the #host.

Returns:

  • (Integer)


# File 'app/models/mdm/service.rb', line 92

#protoString

The protocol used by this service

Returns:

  • (String)


# File 'app/models/mdm/service.rb', line 102

#stateString

Whether this service is opened, closed, filtered, or in an unknown state.

Returns:

  • (String)

    element of STATES.



# File 'app/models/mdm/service.rb', line 107

#task_servicesArray<Mdm::TaskService>

Details about what Tasks touched this service

Returns:



18
# File 'app/models/mdm/service.rb', line 18

has_many :task_services, :dependent => :destroy, :class_name => 'Mdm::TaskService'

#tasksArray<Mdm::Task>

Tasks that touched this service

Returns:



24
# File 'app/models/mdm/service.rb', line 24

has_many :tasks, :through => :task_services, :class_name => 'Mdm::Task'

#vulnsArray<Mdm::Vuln>

Vulnerabilities found in this service.

Returns:



53
# File 'app/models/mdm/service.rb', line 53

has_many :vulns, :dependent => :destroy, :class_name => 'Mdm::Vuln'

#web_formsArray<Mdm::WebForm> (readonly)

Form in the #web_sites on top of this service.

Returns:



75
# File 'app/models/mdm/service.rb', line 75

has_many :web_forms, :through => :web_sites, :class_name => 'Mdm::WebForm'

#web_pagesArray<Mdm::WebPages> (readonly)

Web pages in the #web_sites on top of this service.

Returns:

  • (Array<Mdm::WebPages>)


69
# File 'app/models/mdm/service.rb', line 69

has_many :web_pages, :through => :web_sites, :class_name => 'Mdm::WebPage'

#web_sitesArray<Mdm::WebSite>

Web sites running on top of this service.

Returns:



59
# File 'app/models/mdm/service.rb', line 59

has_many :web_sites, :dependent => :destroy, :class_name => 'Mdm::WebSite'

#web_vulnsArray<Mdm::WebVuln> (readonly)

Vulnerabilities found in the #web_sites on top of this service.

Returns:



81
# File 'app/models/mdm/service.rb', line 81

has_many :web_vulns, :through => :web_sites, :class_name => 'Mdm::WebVuln'

Instance Method Details

#normalize_host_osvoid

This method returns an undefined value.

Normalizes the host operating system whenever #info has changed.



138
139
140
141
142
# File 'app/models/mdm/service.rb', line 138

def normalize_host_os
  if info_changed?
    host.normalize_os
  end
end