module Eso::Nexpose
Public Class Methods
create_add_to_site_step(workflow: nil, id:, previous_type_name: StepNames::EMPTY)
click to toggle source
# File lib/eso/nexpose.rb, line 183 def self.create_add_to_site_step(workflow: nil, id:, previous_type_name: StepNames::EMPTY) Step.new(workflow: workflow, service_name: ServiceNames::NEXPOSE, type_name: StepNames::ADD_TO_SITE, previous_type_name: previous_type_name) .add_property(StepConfiguration::ConfigParamProperties::SITE_ID, id) end
create_add_vuln_and_scan_step(workflow: nil, id:, previous_type_name: StepNames::EMPTY)
click to toggle source
# File lib/eso/nexpose.rb, line 175 def self.create_add_vuln_and_scan_step(workflow: nil, id:, previous_type_name: StepNames::EMPTY) Step.new(workflow: workflow, service_name: ServiceNames::NEXPOSE, type_name: StepNames::ADD_VULN_AND_SCAN, previous_type_name: previous_type_name) .add_property(StepConfiguration::ConfigParamProperties::SITE_ID, id) end
create_discover_known_assets_step(workflow: nil, id:, previous_type_name: StepNames::EMPTY)
click to toggle source
# File lib/eso/nexpose.rb, line 133 def self.create_discover_known_assets_step(workflow: nil, id:, previous_type_name: StepNames::EMPTY) step = Step.new(workflow: workflow, service_name: ServiceNames::NEXPOSE, type_name: StepNames::DISCOVER_KNOWN, previous_type_name: previous_type_name) .add_property(StepConfiguration::ConfigParamProperties::DISCOVERY_CONFIG_ID, id) config_params = step.configuration_params config_params[:HOURS_SINCE_LAST_SCAN] = { :valueClass => Values::ARRAY, :items => [ { :valueClass => Values::OBJECT, :objectType => Filters::HOURS_SINCE_LAST_SCAN_ITEM, :properties => { :operator => { :valueClass => Values::STRING, :value => ::Nexpose::Search::Operator::GREATER_THAN }, :operand1 => { :valueClass => Values::STRING, :value => '1' } } } ] } step.configuration_params = config_params step end
create_discover_new_assets_step(workflow: nil, id:, previous_type_name: StepNames::EMPTY)
click to toggle source
# File lib/eso/nexpose.rb, line 125 def self.create_discover_new_assets_step(workflow: nil, id:, previous_type_name: StepNames::EMPTY) Step.new(workflow: workflow, service_name: ServiceNames::NEXPOSE, type_name: StepNames::DISCOVER_NEW, previous_type_name: previous_type_name) .add_property(StepConfiguration::ConfigParamProperties::DISCOVERY_CONFIG_ID, id) end
create_discovery_workflow(conductor:, name:, step1_type:, step1_param: nil, step2_type:, step2_param:)
click to toggle source
# File lib/eso/nexpose.rb, line 88 def self.create_discovery_workflow(conductor:, name:, step1_type:, step1_param: nil, step2_type:, step2_param:) step1 = self.send("create_#{step1_type.to_s.gsub(/-/, "_")}_step", id: step1_param) step2 = self.send("create_#{step2_type.to_s.gsub(/-/, "_")}_step", id: step2_param) step2.previous_type_name = step1.type_name conductor.create_workflow(name: name, steps: [step1, step2]) end
create_file_reputation_step(workflow: nil, id:)
click to toggle source
# File lib/eso/nexpose.rb, line 117 def self.create_file_reputation_step(workflow: nil, id:) Step.new(workflow: workflow, service_name: ServiceNames::DXL, type_name: StepNames::FILE_REPUTATION_TRIGGER, previous_type_name: nil) .add_property(StepConfiguration::ConfigParamProperties::DISCOVERY_CONFIG_ID, id) end
create_file_trigger_workflow(conductor:, name:, step1_param:, step2_param:)
click to toggle source
# File lib/eso/nexpose.rb, line 102 def self.create_file_trigger_workflow(conductor:, name:, step1_param:, step2_param:) step1 = self.create_file_reputation_step(workflow: nil, id: step1_param) step2 = self.create_tag_step(workflow: nil, id: step2_param) step2.previous_type_name = step1.type_name conductor.create_workflow(name: name, steps: [step1, step2]) end
create_new_vuln_step(workflow: nil, filters:, previous_type_name: StepNames::EMPTY)
click to toggle source
# File lib/eso/nexpose.rb, line 163 def self.create_new_vuln_step(workflow: nil, filters:, previous_type_name: StepNames::EMPTY) # The filter definitions on the server are not standard at this point so that is why it is necessary to hard code this # Opening a defect to fix the consistency on these on the backend so we can use the add_filter function in the automation step = Step.new(workflow: workflow, service_name: ServiceNames::NEXPOSE, type_name: StepNames::NEW_VULN, previous_type_name: previous_type_name) filters.each { |filter| step.add_filter(filter) } step end
create_scan_in_site_step(workflow: nil, id:, previous_type_name: StepNames::EMPTY)
click to toggle source
# File lib/eso/nexpose.rb, line 109 def self.create_scan_in_site_step(workflow: nil, id:, previous_type_name: StepNames::EMPTY) Step.new(workflow: workflow, service_name: ServiceNames::NEXPOSE, type_name: StepNames::SCAN_IN_SITE, previous_type_name: previous_type_name) .add_property(StepConfiguration::ConfigParamProperties::SITE_ID, id) end
create_scan_new_vuln_workflow(conductor:, name:, filters:, site_id:)
click to toggle source
# File lib/eso/nexpose.rb, line 95 def self.create_scan_new_vuln_workflow(conductor:, name:, filters:, site_id:) step1 = self.create_new_vuln_step(workflow: nil, filters: filters, previous_type_name: StepNames::EMPTY) step2 = self.create_add_vuln_and_scan_step(id: site_id) step2.previous_type_name = step1.type_name conductor.create_workflow(name: name, steps: [step1, step2]) end
create_scan_step(workflow: nil, id:, previous_type_name: StepNames::EMPTY)
click to toggle source
# File lib/eso/nexpose.rb, line 191 def self.create_scan_step(workflow: nil, id:, previous_type_name: StepNames::EMPTY) Step.new(workflow: workflow, service_name: ServiceNames::NEXPOSE, type_name: StepNames::SCAN, previous_type_name: previous_type_name) .add_property(StepConfiguration::ConfigParamProperties::SITE_ID, id) end
create_tag_step(workflow: nil, id:, previous_type_name: StepNames::EMPTY)
click to toggle source
# File lib/eso/nexpose.rb, line 199 def self.create_tag_step(workflow: nil, id:, previous_type_name: StepNames::EMPTY) Step.new(workflow: workflow, service_name: ServiceNames::NEXPOSE, type_name: StepNames::TAG, previous_type_name: previous_type_name) .add_property(StepConfiguration::ConfigParamProperties::TAG_ID, id) end
get_discover_step(workflow: )
click to toggle source
# File lib/eso/nexpose.rb, line 207 def self.get_discover_step(workflow: ) workflow.get_step(StepNames::DISCOVER_NEW) || workflow.get_step(StepNames::DISCOVER_KNOWN) end