Skip to content

Commit

Permalink
Feature/#17820 add intrusion pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
rgomezborder committed Jun 25, 2024
1 parent db4f4be commit 3f8e9a6
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions resources/libraries/get_pipelines.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,33 @@ module RbManager
module Helpers
def get_pipelines
logstash_pipelines = []
sensors = node.run_state['sensors_info_all']
sensors = get_sensors_info()
namespaces = get_namespaces()
main_logstash = determine_main_logstash_node()
monitor_sensor_in_proxy_nodes = find_monitor_sensor_in_proxy_nodes()
monitor_config = get_monitor_configuration()
has_device_sensors = !sensors['device-sensor'].nil? && !sensors['device-sensor'].empty?

if manager_services['logstash']
logstash_pipelines.push('rbwindow-pipeline') if main_logstash == node.name
logstash_pipelines.push('apstate-pipeline')
logstash_pipelines.push('scanner-pipeline') unless sensors['scanner-sensor'].empty?
logstash_pipelines.push('nmsp-pipeline') if main_logstash == node.name && !sensors['flow-sensor'].empty?
logstash_pipelines.push('radius-pipeline') if main_logstash == node.name
logstash_pipelines.push('vault-pipeline') unless sensors['vault-sensor'].empty?
logstash_pipelines.push('netflow-pipeline') unless sensors['flow-sensor'].empty?
logstash_pipelines.push('sflow-pipeline') unless sensors['flow-sensor'].empty?
logstash_pipelines.push('meraki-pipeline') unless sensors['meraki-sensor'].empty?
logstash_pipelines.push('monitor-pipeline') unless namespaces.empty?
logstash_pipelines.push('location-pipeline') unless sensors['ale-sensor'].empty? || sensors['mse-sensor'].empty? || sensors['flow-sensor'].empty? || sensors['arubacentral-sensor'].empty?
logstash_pipelines.push('mobility-pipeline')
logstash_pipelines.push('redfish-pipeline') unless sensors['device-sensor'].empty?
logstash_pipelines.push('bulkstats-pipeline') unless sensors['device-sensor'].empty?
logstash_pipelines.push('intrusion-pipeline') unless sensors['ips-sensor'].empty? || sensors['ipsv2-sensor'].empty? || sensors['ipscp-sensor'].empty? || sensors['ipsg-sensor'].empty?
logstash_pipelines.push('rbwindow-pipeline') if main_logstash == node.name
logstash_pipelines.push('apstate-pipeline')
logstash_pipelines.push('scanner-pipeline') unless sensors['scanner-sensor'].empty?
logstash_pipelines.push('nmsp-pipeline') if main_logstash == node.name && !sensors['flow-sensor'].empty?
logstash_pipelines.push('radius-pipeline') if main_logstash == node.name
logstash_pipelines.push('vault-pipeline') unless sensors['vault-sensor'].empty?
logstash_pipelines.push('netflow-pipeline') unless sensors['flow-sensor'].empty?
logstash_pipelines.push('sflow-pipeline') unless sensors['flow-sensor'].empty?
logstash_pipelines.push('meraki-pipeline') unless sensors['meraki-sensor'].empty?
logstash_pipelines.push('monitor-pipeline') unless namespaces.empty?
logstash_pipelines.push('location-pipeline') unless sensors['ale-sensor'].empty? && sensors['mse-sensor'].empty? && sensors['flow-sensor'].empty? && sensors['arubacentral-sensor'].empty?
logstash_pipelines.push('mobility-pipeline') unless sensors['ale-sensor'].empty? && sensors['mse-sensor'].empty? && sensors['flow-sensor'].empty? && sensors['arubacentral-sensor'].empty?
logstash_pipelines.push('intrusion-pipeline') unless sensors['ips-sensor'].empty? && sensors['ipsv2-sensor'].empty? && sensors['ipscp-sensor'].empty? && sensors['ipsg-sensor'].empty?
if (has_device_sensors && monitor_config.include?('thermal')) || !monitor_sensor_in_proxy_nodes.empty?
logstash_pipelines.push('redfish-pipeline')
end
if (has_device_sensors && monitor_config.include?('bulkstats_schema')) || !monitor_sensor_in_proxy_nodes.empty?
logstash_pipelines.push('bulkstats-pipeline')
end

logstash_pipelines
end

Expand Down

0 comments on commit 3f8e9a6

Please sign in to comment.