Class: Nexpose::External::Service
- Inherits:
-
Object
- Object
- Nexpose::External::Service
- Defined in:
- lib/nexpose/external.rb
Overview
A service endpoint on an asset.
Instance Attribute Summary collapse
-
#name ⇒ Object
Name of the service.
-
#port ⇒ Object
Port on which the service is running.
-
#protocol ⇒ Object
Protocol used to communicate to the port.
-
#vulnerabilities ⇒ Object
Vulnerabilities specific to this service endpoint.
Instance Method Summary collapse
-
#initialize(port, protocol = Protocol::RAW, name = nil) ⇒ Service
constructor
A new instance of Service.
- #to_h ⇒ Object
Constructor Details
#initialize(port, protocol = Protocol::RAW, name = nil) ⇒ Service
Returns a new instance of Service.
141 142 143 144 |
# File 'lib/nexpose/external.rb', line 141 def initialize(port, protocol = Protocol::RAW, name = nil) @port, @protocol, @name = port, protocol, name @vulnerabilities = [] end |
Instance Attribute Details
#name ⇒ Object
Name of the service. [Optional]
133 134 135 |
# File 'lib/nexpose/external.rb', line 133 def name @name end |
#port ⇒ Object
Port on which the service is running.
135 136 137 |
# File 'lib/nexpose/external.rb', line 135 def port @port end |
#protocol ⇒ Object
Protocol used to communicate to the port. @see Service::Protocol.
137 138 139 |
# File 'lib/nexpose/external.rb', line 137 def protocol @protocol end |
#vulnerabilities ⇒ Object
Vulnerabilities specific to this service endpoint.
139 140 141 |
# File 'lib/nexpose/external.rb', line 139 def vulnerabilities @vulnerabilities end |
Instance Method Details
#to_h ⇒ Object
146 147 148 149 150 151 |
# File 'lib/nexpose/external.rb', line 146 def to_h { name: name, port: port, protocol: protocol, vulnerabilities: vulnerabilities.map(&:to_h) } end |