Skip to content

Commit

Permalink
Merge branch 'development' into Feature/#17820_add_intrusion_pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
rgomezborder authored Jun 25, 2024
2 parents 3f8e9a6 + ec543a6 commit 287b815
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 4 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
cookbook-rb-manager CHANGELOG
===============

## 2.2.0

- nilsver
- [c05abf5] [2a1bd7f] [040aeda] fix linter
- [0186ecc] add pipeline per monitor configuration
- [b5d56c5] fix check if pipelines are active
- [e557b19] add helper file
- [64b9adc] monitor pipelines work with proxy too
- Miguel Alvarez
- [c5d590d] Fix lint issues
- [2be5b59] Fix configure clamscan
- [2e0b86b] Add clamav

## 2.1.0

- David Vanhoucke
Expand Down
1 change: 1 addition & 0 deletions resources/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
default['redborder']['services']['radiusd'] = false
default['redborder']['services']['postfix'] = true
default['redborder']['services']['keepalived'] = false
default['redborder']['services']['clamav'] = true

default['redborder']['systemdservices']['chef-client'] = ['chef-client']
default['redborder']['systemdservices']['chef-server'] = ['opscode-erchef']
Expand Down
17 changes: 17 additions & 0 deletions resources/libraries/get_monitor_configuration.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module RbManager
module Helpers
def get_monitor_configuration
monitor_config = []
sensor = search(:node, 'redborder_monitors:[* TO *] AND name:*device*').sort
sensor.each do |node|
monitors = node.normal['redborder']['monitors']
monitors.each do |monitor|
if monitor['name'] == 'bulkstats_schema' || monitor['name'] == 'thermal'
monitor_config << monitor['name']
end
end
end
monitor_config
end
end
end
20 changes: 20 additions & 0 deletions resources/libraries/get_monitor_in_proxy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module RbManager
module Helpers
def find_monitor_sensor_in_proxy_nodes
sensors_info = []
sensor_types = ['proxy-sensor']
sensor_types.each do |s_type|
begin
sensors = search(:node, "role:#{s_type}")
.map { |s| s.override['redborder']['sensors_mapping']['device'] }
.reject { |device| device.nil? || device.empty? }

sensors_info.concat(sensors) unless sensors.empty?
rescue NoMethodError
sensors_info = []
end
end
sensors_info
end
end
end
3 changes: 2 additions & 1 deletion resources/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
maintainer_email '[email protected]'
license 'AGPL-3.0'
description 'Installs/Configures redborder manager'
version '2.1.0'
version '2.2.0'

depends 'rb-common'
depends 'chef-server'
Expand Down Expand Up @@ -42,4 +42,5 @@
depends 'rblogstatter'
depends 'rb-arubacentral'
depends 'rb-postfix'
depends 'rb-clamav'
depends 'keepalived'
8 changes: 6 additions & 2 deletions resources/recipes/configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@
vault_nodes node.run_state['sensors_info_all']['vault-sensor']
scanner_nodes node.run_state['sensors_info_all']['scanner-sensor']
device_nodes node.run_state['sensors_info_all']['device-sensor']
logstash_pipelines node.run_state['pipelines']
if manager_services['logstash'] && node.run_state['pipelines'] && !node.run_state['pipelines'].empty?
logstash_pipelines node.default['pipelines']
if !logstash_pipelines.nil? && !logstash_pipelines.empty?
action [:add, :register]
else
action [:remove, :deregister]
Expand Down Expand Up @@ -523,6 +523,10 @@
action :add
end

rb_clamav_config 'Configure ClamAV' do
action(manager_services['clamav'] ? :add : :remove)
end

# Determine external
begin
external_services = data_bag_item('rBglobal', 'external_services')
Expand Down
2 changes: 1 addition & 1 deletion resources/recipes/prepare_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
node.run_state['all_flow_sensors_info'] = get_all_flow_sensors_info()

# get logstash pipelines
node.run_state['pipelines'] = get_pipelines()
node.default['pipelines'] = get_pipelines()

# get namespaces
node.run_state['namespaces'] = get_namespaces
Expand Down

0 comments on commit 287b815

Please sign in to comment.