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.
145 146 147 148 149 150 |
# File 'lib/nexpose/external.rb', line 145 def initialize(port, protocol = Protocol::RAW, name = nil) @port = port @protocol = protocol @name = name @vulnerabilities = [] end |
Instance Attribute Details
#name ⇒ Object
Name of the service. [Optional]
137 138 139 |
# File 'lib/nexpose/external.rb', line 137 def name @name end |
#port ⇒ Object
Port on which the service is running.
139 140 141 |
# File 'lib/nexpose/external.rb', line 139 def port @port end |
#protocol ⇒ Object
Protocol used to communicate to the port. @see Service::Protocol.
141 142 143 |
# File 'lib/nexpose/external.rb', line 141 def protocol @protocol end |
#vulnerabilities ⇒ Object
Vulnerabilities specific to this service endpoint.
143 144 145 |
# File 'lib/nexpose/external.rb', line 143 def vulnerabilities @vulnerabilities end |
Instance Method Details
#to_h ⇒ Object
152 153 154 155 156 157 |
# File 'lib/nexpose/external.rb', line 152 def to_h { name: name, port: port, protocol: protocol, vulnerabilities: vulnerabilities.map(&:to_h) } end |