Class: Mdm::Service
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Mdm::Service
- 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
-
#creds ⇒ Array<Mdm::Cred>
Credentials gathered from this service.
- #exploited_hosts ⇒ Array<Mdm::ExploitHost>
-
#host ⇒ Mdm::Host
The host on which this service runs.
- #info ⇒ String
-
#name ⇒ String
The name of the service.
-
#notes ⇒ Array<Mdm::Note>
Notes about this service.
-
#port ⇒ Integer
The port on which this service runs on the #host.
-
#proto ⇒ String
The protocol used by this service.
-
#state ⇒ String
Whether this service is opened, closed, filtered, or in an unknown state.
-
#task_services ⇒ Array<Mdm::TaskService>
Details about what Tasks touched this service.
-
#tasks ⇒ Array<Mdm::Task>
Tasks that touched this service.
-
#vulns ⇒ Array<Mdm::Vuln>
Vulnerabilities found in this service.
-
#web_forms ⇒ Array<Mdm::WebForm>
readonly
Form in the #web_sites on top of this service.
-
#web_pages ⇒ Array<Mdm::WebPages>
readonly
Web pages in the #web_sites on top of this service.
-
#web_sites ⇒ Array<Mdm::WebSite>
Web sites running on top of this service.
-
#web_vulns ⇒ Array<Mdm::WebVuln>
readonly
Vulnerabilities found in the #web_sites on top of this service.
Instance Method Summary collapse
-
#normalize_host_os ⇒ void
Normalizes the host operating system whenever #info has changed.
Instance Attribute Details
#creds ⇒ Array<Mdm::Cred>
Credentials gathered from this service.
30 |
# File 'app/models/mdm/service.rb', line 30 has_many :creds, :dependent => :destroy, :class_name => 'Mdm::Cred' |
#exploited_hosts ⇒ Array<Mdm::ExploitHost>
35 |
# File 'app/models/mdm/service.rb', line 35 has_many :exploited_hosts, :dependent => :destroy, :class_name => 'Mdm::ExploitedHost' |
#host ⇒ Mdm::Host
The host on which this service runs.
41 |
# File 'app/models/mdm/service.rb', line 41 belongs_to :host, :class_name => 'Mdm::Host', :counter_cache => :service_count |
#info ⇒ String
|
# File 'app/models/mdm/service.rb', line 87
|
#name ⇒ String
The name of the service.
|
# File 'app/models/mdm/service.rb', line 97
|
#notes ⇒ Array<Mdm::Note>
Notes about this service.
47 |
# File 'app/models/mdm/service.rb', line 47 has_many :notes, :dependent => :destroy, :class_name => 'Mdm::Note' |
#port ⇒ Integer
The port on which this service runs on the #host.
|
# File 'app/models/mdm/service.rb', line 92
|
#proto ⇒ String
The protocol used by this service
|
# File 'app/models/mdm/service.rb', line 102
|
#state ⇒ String
Whether this service is opened, closed, filtered, or in an unknown state.
|
# File 'app/models/mdm/service.rb', line 107
|
#task_services ⇒ Array<Mdm::TaskService>
Details about what Tasks touched this service
18 |
# File 'app/models/mdm/service.rb', line 18 has_many :task_services, :dependent => :destroy, :class_name => 'Mdm::TaskService' |
#tasks ⇒ Array<Mdm::Task>
Tasks that touched this service
24 |
# File 'app/models/mdm/service.rb', line 24 has_many :tasks, :through => :task_services, :class_name => 'Mdm::Task' |
#vulns ⇒ Array<Mdm::Vuln>
Vulnerabilities found in this service.
53 |
# File 'app/models/mdm/service.rb', line 53 has_many :vulns, :dependent => :destroy, :class_name => 'Mdm::Vuln' |
#web_forms ⇒ Array<Mdm::WebForm> (readonly)
Form in the #web_sites on top of this service.
75 |
# File 'app/models/mdm/service.rb', line 75 has_many :web_forms, :through => :web_sites, :class_name => 'Mdm::WebForm' |
#web_pages ⇒ Array<Mdm::WebPages> (readonly)
Web pages in the #web_sites on top of this service.
69 |
# File 'app/models/mdm/service.rb', line 69 has_many :web_pages, :through => :web_sites, :class_name => 'Mdm::WebPage' |
#web_sites ⇒ Array<Mdm::WebSite>
Web sites running on top of this service.
59 |
# File 'app/models/mdm/service.rb', line 59 has_many :web_sites, :dependent => :destroy, :class_name => 'Mdm::WebSite' |
#web_vulns ⇒ Array<Mdm::WebVuln> (readonly)
Vulnerabilities found in the #web_sites on top of this service.
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_os ⇒ void
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 |