From 80dda4aff90157a34ea3c06869225b2be8e340ae Mon Sep 17 00:00:00 2001 From: ptorresred Date: Thu, 24 Oct 2024 12:55:15 +0100 Subject: [PATCH 01/23] Redmine #19198: Change vault priority default filter --- resources/attributes/default.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/attributes/default.rb b/resources/attributes/default.rb index f1c92c93..9c678d53 100644 --- a/resources/attributes/default.rb +++ b/resources/attributes/default.rb @@ -223,4 +223,4 @@ # Priority Filter default['redborder']['intrusion_incidents_priority_filter'] = 'high' -default['redborder']['vault_incidents_priority_filter'] = 'high' +default['redborder']['vault_incidents_priority_filter'] = 'error' From 77bbbfb7f47e3809e10790987e681cf3911c5fdd Mon Sep 17 00:00:00 2001 From: JuanSheba Date: Fri, 25 Oct 2024 14:03:57 +0100 Subject: [PATCH 02/23] Create Template --- .../templates/default/logstash_log-rotate.erb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 resources/templates/default/logstash_log-rotate.erb diff --git a/resources/templates/default/logstash_log-rotate.erb b/resources/templates/default/logstash_log-rotate.erb new file mode 100644 index 00000000..c91a9512 --- /dev/null +++ b/resources/templates/default/logstash_log-rotate.erb @@ -0,0 +1,16 @@ +############################################################################### +# Generated by Chef for <%= node[:hostname] %> +############################################################################### + +/var/log/logstash/*.log { + size=20M + missingok + rotate 5 + compress + delaycompress + notifempty + copytruncate + postrotate + rm -f /var/log/logstash/*.gz > /dev/null + endscript +} From 8e2247875358016bd9bc6a1c89ebf42f42018aeb Mon Sep 17 00:00:00 2001 From: JuanSheba Date: Fri, 25 Oct 2024 14:04:28 +0100 Subject: [PATCH 03/23] Add creatiion of the logrotate file with the template --- resources/recipes/prepare_system.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/recipes/prepare_system.rb b/resources/recipes/prepare_system.rb index 19587235..7230efee 100644 --- a/resources/recipes/prepare_system.rb +++ b/resources/recipes/prepare_system.rb @@ -50,6 +50,14 @@ options: node['chef-client']['options']) end +template "/etc/logrotate.d/logstash" do + source "logstash_log-rotate.erb" + owner "root" + group "root" + mode 0644 + retries 2 +end + service 'chef-client' do if node['redborder']['services']['chef-client'] && node.run_state['cluster_installed'] action [:enable, :start] From 71215108b0ba41940166c9a1621bff332fe18991 Mon Sep 17 00:00:00 2001 From: JuanSheba Date: Fri, 25 Oct 2024 14:08:32 +0100 Subject: [PATCH 04/23] Fix lint --- resources/recipes/prepare_system.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/recipes/prepare_system.rb b/resources/recipes/prepare_system.rb index 7230efee..0d0eb83c 100644 --- a/resources/recipes/prepare_system.rb +++ b/resources/recipes/prepare_system.rb @@ -50,10 +50,10 @@ options: node['chef-client']['options']) end -template "/etc/logrotate.d/logstash" do - source "logstash_log-rotate.erb" - owner "root" - group "root" +template '/etc/logrotate.d/logstash' do + source 'logstash_log-rotate.erb' + owner 'root' + group 'root' mode 0644 retries 2 end From 8eeea08382f3c0dd0462f5c1bf793f7fc6f15945 Mon Sep 17 00:00:00 2001 From: nilsver Date: Thu, 31 Oct 2024 09:03:16 +0000 Subject: [PATCH 05/23] Release 4.4.1 --- CHANGELOG.md | 6 ++++++ resources/metadata.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5665836a..f47921b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ cookbook-rb-manager CHANGELOG =============== +## 4.4.1 + + - JuanSheba + - [8e22478] Add creatiion of the logrotate file with the template + - [77bbbfb] Create Template + ## 4.4.0 - Miguel Negrón diff --git a/resources/metadata.rb b/resources/metadata.rb index c1bebe1d..283526d2 100644 --- a/resources/metadata.rb +++ b/resources/metadata.rb @@ -5,7 +5,7 @@ maintainer_email 'git@redborder.com' license 'AGPL-3.0' description 'Installs/Configures redborder manager' -version '4.4.0' +version '4.4.1' depends 'rb-common' depends 'chef-server' From fe39666068002f192649094cd3bf5060556ccdfe Mon Sep 17 00:00:00 2001 From: Luis Blanco <108473576+ljblancoredborder@users.noreply.github.com> Date: Thu, 31 Oct 2024 13:26:09 +0000 Subject: [PATCH 06/23] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f47921b1..0b1331b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ cookbook-rb-manager CHANGELOG ## 4.4.1 - JuanSheba - - [8e22478] Add creatiion of the logrotate file with the template + - [8e22478] Add creation of the logrotate file with the template - [77bbbfb] Create Template ## 4.4.0 From a9a3efe9058e782be89d016e88d0175751140d19 Mon Sep 17 00:00:00 2001 From: jnavarrorb Date: Mon, 4 Nov 2024 15:58:12 +0000 Subject: [PATCH 07/23] check if redborder_parent_id is nil or sensor at redborder_parent_id is not a proxy --- resources/libraries/get_sensors_all_info.rb | 15 +++++++++++++-- resources/libraries/get_sensors_info.rb | 11 +++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/resources/libraries/get_sensors_all_info.rb b/resources/libraries/get_sensors_all_info.rb index 9a4ea65e..95650646 100644 --- a/resources/libraries/get_sensors_all_info.rb +++ b/resources/libraries/get_sensors_all_info.rb @@ -5,10 +5,21 @@ def get_sensors_all_info sensor_types = %w(ips-sensor ipsv2-sensor ipscp-sensor ipsg-sensor vault-sensor flow-sensor arubacentral-sensor mse-sensor meraki-sensor cisco-cloudproxy proxy-sensor scanner-sensor mse-sensor meraki-sensor ale-sensor cep-sensor device-sensor) sensor_types.each do |s_type| - sensors = search(:node, "role:#{s_type} AND -redborder_parent_id:*?").sort # get sensor where parent_id is nil + sensors = search(:node, "role:#{s_type}").sort # get sensor where parent_id is nil or sensor at parent_id is not a proxy sensors_info[s_type] = [] - sensors.each { |s| sensors_info[s_type] << s } + + sensors.each do |sensor| + + if sensor['parent_id'] + parent_sensor = search(:node,"id:#{sensor['parent_id']}").first + unless parent_sensor && parent_sensor['role']&.include?('proxy') + sensors_info[s_type] << sensor + end + else + sensors_info[s_type] << sensor + end + end end sensors_info diff --git a/resources/libraries/get_sensors_info.rb b/resources/libraries/get_sensors_info.rb index 340362bb..7d7cd0d4 100644 --- a/resources/libraries/get_sensors_info.rb +++ b/resources/libraries/get_sensors_info.rb @@ -7,10 +7,15 @@ def get_sensors_info ips-sensor ipsv2-sensor ipscp-sensor ipsg-sensor) locations = node['redborder']['locations'] sensor_types.each do |s_type| - # get sensor where parent_id is nil - sensors = search(:node, "role:#{s_type} AND -redborder_parent_id:*?").sort + # get sensor where parent_id is nil or sensor at parent_id is not a proxy + sensors = search(:node, "role:#{s_type}").sort sensors_info[s_type] = {} sensors.each do |s| + if s['redborder_parent_id'] + parent_sensor = search(:node, "id:#{s['redborder_parent_id']}").first + next if parent_sensor && parent_sensor['role']&.include?("proxy") + end + info = {} info['name'] = s.name info['ip'] = s['ipaddress'] @@ -27,11 +32,13 @@ def get_sensors_info info['locations'][loc] = s['redborder'][loc] end + sensors_info[s_type][s.name] = info end end sensors_info + end end end From 610ab20fdb793a9660fd1158017aef6c15c5a87b Mon Sep 17 00:00:00 2001 From: jnavarrorb Date: Mon, 4 Nov 2024 16:04:56 +0000 Subject: [PATCH 08/23] Fix lint errors --- resources/libraries/get_sensors_all_info.rb | 5 ++--- resources/libraries/get_sensors_info.rb | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/resources/libraries/get_sensors_all_info.rb b/resources/libraries/get_sensors_all_info.rb index 95650646..a057bc51 100644 --- a/resources/libraries/get_sensors_all_info.rb +++ b/resources/libraries/get_sensors_all_info.rb @@ -8,11 +8,10 @@ def get_sensors_all_info sensors = search(:node, "role:#{s_type}").sort # get sensor where parent_id is nil or sensor at parent_id is not a proxy sensors_info[s_type] = [] - - sensors.each do |sensor| + sensors.each do |sensor| if sensor['parent_id'] - parent_sensor = search(:node,"id:#{sensor['parent_id']}").first + parent_sensor = search(:node, "id:#{sensor['parent_id']}").first unless parent_sensor && parent_sensor['role']&.include?('proxy') sensors_info[s_type] << sensor end diff --git a/resources/libraries/get_sensors_info.rb b/resources/libraries/get_sensors_info.rb index 7d7cd0d4..daeead46 100644 --- a/resources/libraries/get_sensors_info.rb +++ b/resources/libraries/get_sensors_info.rb @@ -13,7 +13,7 @@ def get_sensors_info sensors.each do |s| if s['redborder_parent_id'] parent_sensor = search(:node, "id:#{s['redborder_parent_id']}").first - next if parent_sensor && parent_sensor['role']&.include?("proxy") + next if parent_sensor && parent_sensor['role']&.include?('proxy') end info = {} @@ -38,7 +38,6 @@ def get_sensors_info end sensors_info - end end end From 060f5d9b1025d9ac8a725e28c0a26cfc31b53185 Mon Sep 17 00:00:00 2001 From: jnavarrorb Date: Mon, 4 Nov 2024 16:28:44 +0000 Subject: [PATCH 09/23] Fix open kafka port for all IPS --- resources/libraries/open_kafka_port.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/libraries/open_kafka_port.rb b/resources/libraries/open_kafka_port.rb index 5c80e176..b536e824 100644 --- a/resources/libraries/open_kafka_port.rb +++ b/resources/libraries/open_kafka_port.rb @@ -2,7 +2,7 @@ module RbManager module Helpers def get_ip_of_manager_ips # IPS in manager mode has the role ips-sensor - sensors = search(:node, 'role:ips-sensor AND -redborder_parent_id:*?').sort + sensors = search(:node, 'role:ips-sensor').sort sensors.map { |s| { ipaddress: s['ipaddress'] } } end From 7f6b98eaec16899c954889f86cdb4badcdf2ff17 Mon Sep 17 00:00:00 2001 From: jnavarrorb Date: Tue, 5 Nov 2024 14:05:21 +0000 Subject: [PATCH 10/23] Fix parent_id to real_parent_id --- resources/libraries/get_sensors_all_info.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/libraries/get_sensors_all_info.rb b/resources/libraries/get_sensors_all_info.rb index a057bc51..f11e6b27 100644 --- a/resources/libraries/get_sensors_all_info.rb +++ b/resources/libraries/get_sensors_all_info.rb @@ -10,8 +10,8 @@ def get_sensors_all_info sensors_info[s_type] = [] sensors.each do |sensor| - if sensor['parent_id'] - parent_sensor = search(:node, "id:#{sensor['parent_id']}").first + if sensor['redborder_parent_id'] + parent_sensor = search(:node, "id:#{sensor['redborder_parent_id']}").first unless parent_sensor && parent_sensor['role']&.include?('proxy') sensors_info[s_type] << sensor end From 0e60c0a2277285a3ae32c0e39a1115ea2598d339 Mon Sep 17 00:00:00 2001 From: jnavarrorb Date: Tue, 5 Nov 2024 14:09:24 +0000 Subject: [PATCH 11/23] Fetch --- resources/libraries/get_sensors_all_info.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/libraries/get_sensors_all_info.rb b/resources/libraries/get_sensors_all_info.rb index f11e6b27..a057bc51 100644 --- a/resources/libraries/get_sensors_all_info.rb +++ b/resources/libraries/get_sensors_all_info.rb @@ -10,8 +10,8 @@ def get_sensors_all_info sensors_info[s_type] = [] sensors.each do |sensor| - if sensor['redborder_parent_id'] - parent_sensor = search(:node, "id:#{sensor['redborder_parent_id']}").first + if sensor['parent_id'] + parent_sensor = search(:node, "id:#{sensor['parent_id']}").first unless parent_sensor && parent_sensor['role']&.include?('proxy') sensors_info[s_type] << sensor end From 87628c71eb5bf94e5a04a78e97d450fe1bd2a27b Mon Sep 17 00:00:00 2001 From: jnavarrorb Date: Tue, 5 Nov 2024 14:11:56 +0000 Subject: [PATCH 12/23] Fix parent_id to real_parent_id --- resources/libraries/get_sensors_all_info.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/libraries/get_sensors_all_info.rb b/resources/libraries/get_sensors_all_info.rb index a057bc51..f11e6b27 100644 --- a/resources/libraries/get_sensors_all_info.rb +++ b/resources/libraries/get_sensors_all_info.rb @@ -10,8 +10,8 @@ def get_sensors_all_info sensors_info[s_type] = [] sensors.each do |sensor| - if sensor['parent_id'] - parent_sensor = search(:node, "id:#{sensor['parent_id']}").first + if sensor['redborder_parent_id'] + parent_sensor = search(:node, "id:#{sensor['redborder_parent_id']}").first unless parent_sensor && parent_sensor['role']&.include?('proxy') sensors_info[s_type] << sensor end From 72d2b00f731a7d70313577f5f708ecbbcda9e72f Mon Sep 17 00:00:00 2001 From: jnavarrorb Date: Wed, 6 Nov 2024 15:34:30 +0000 Subject: [PATCH 13/23] Fix sensors info with all sensors (proxy childs too) --- resources/libraries/get_sensors_all_info.rb | 11 ++--------- resources/libraries/get_sensors_info.rb | 7 +------ 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/resources/libraries/get_sensors_all_info.rb b/resources/libraries/get_sensors_all_info.rb index f11e6b27..5bc424a7 100644 --- a/resources/libraries/get_sensors_all_info.rb +++ b/resources/libraries/get_sensors_all_info.rb @@ -5,19 +5,12 @@ def get_sensors_all_info sensor_types = %w(ips-sensor ipsv2-sensor ipscp-sensor ipsg-sensor vault-sensor flow-sensor arubacentral-sensor mse-sensor meraki-sensor cisco-cloudproxy proxy-sensor scanner-sensor mse-sensor meraki-sensor ale-sensor cep-sensor device-sensor) sensor_types.each do |s_type| - sensors = search(:node, "role:#{s_type}").sort # get sensor where parent_id is nil or sensor at parent_id is not a proxy + sensors = search(:node, "role:#{s_type}").sort #get all s_type's sensor sensors_info[s_type] = [] sensors.each do |sensor| - if sensor['redborder_parent_id'] - parent_sensor = search(:node, "id:#{sensor['redborder_parent_id']}").first - unless parent_sensor && parent_sensor['role']&.include?('proxy') - sensors_info[s_type] << sensor - end - else - sensors_info[s_type] << sensor - end + sensors_info[s_type] << sensor end end diff --git a/resources/libraries/get_sensors_info.rb b/resources/libraries/get_sensors_info.rb index daeead46..3bdf885c 100644 --- a/resources/libraries/get_sensors_info.rb +++ b/resources/libraries/get_sensors_info.rb @@ -7,15 +7,10 @@ def get_sensors_info ips-sensor ipsv2-sensor ipscp-sensor ipsg-sensor) locations = node['redborder']['locations'] sensor_types.each do |s_type| - # get sensor where parent_id is nil or sensor at parent_id is not a proxy + #get all s_type's sensor sensors = search(:node, "role:#{s_type}").sort sensors_info[s_type] = {} sensors.each do |s| - if s['redborder_parent_id'] - parent_sensor = search(:node, "id:#{s['redborder_parent_id']}").first - next if parent_sensor && parent_sensor['role']&.include?('proxy') - end - info = {} info['name'] = s.name info['ip'] = s['ipaddress'] From aebf0a9ae6ed39f3e47b5b9871ddaed46259b875 Mon Sep 17 00:00:00 2001 From: jnavarrorb Date: Wed, 6 Nov 2024 15:44:33 +0000 Subject: [PATCH 14/23] fix lint cookstyle errors --- resources/libraries/get_sensors_all_info.rb | 2 +- resources/libraries/get_sensors_info.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/libraries/get_sensors_all_info.rb b/resources/libraries/get_sensors_all_info.rb index 5bc424a7..0bb73e0f 100644 --- a/resources/libraries/get_sensors_all_info.rb +++ b/resources/libraries/get_sensors_all_info.rb @@ -5,7 +5,7 @@ def get_sensors_all_info sensor_types = %w(ips-sensor ipsv2-sensor ipscp-sensor ipsg-sensor vault-sensor flow-sensor arubacentral-sensor mse-sensor meraki-sensor cisco-cloudproxy proxy-sensor scanner-sensor mse-sensor meraki-sensor ale-sensor cep-sensor device-sensor) sensor_types.each do |s_type| - sensors = search(:node, "role:#{s_type}").sort #get all s_type's sensor + sensors = search(:node, "role:#{s_type}").sort # get all s_type's sensor sensors_info[s_type] = [] diff --git a/resources/libraries/get_sensors_info.rb b/resources/libraries/get_sensors_info.rb index 3bdf885c..7801ac93 100644 --- a/resources/libraries/get_sensors_info.rb +++ b/resources/libraries/get_sensors_info.rb @@ -7,7 +7,7 @@ def get_sensors_info ips-sensor ipsv2-sensor ipscp-sensor ipsg-sensor) locations = node['redborder']['locations'] sensor_types.each do |s_type| - #get all s_type's sensor + # get all s_type's sensor sensors = search(:node, "role:#{s_type}").sort sensors_info[s_type] = {} sensors.each do |s| From 0fc8265e72a77d17180d9016f6a2ed314bfc42b5 Mon Sep 17 00:00:00 2001 From: Rafael Gomez Date: Thu, 7 Nov 2024 09:10:11 +0000 Subject: [PATCH 15/23] pump version --- CHANGELOG.md | 8 ++++++++ resources/metadata.rb | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b1331b7..285f1291 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ cookbook-rb-manager CHANGELOG =============== +## 4.4.2 + + - jnavarrorb + - [72d2b00] Fix sensors info with all sensors (proxy childs too) + - [87628c7] Fix parent_id to real_parent_id + - [060f5d9] Fix open kafka port for all IPS + - [a9a3efe] check if redborder_parent_id is nil or sensor at redborder_parent_id is not a proxy + ## 4.4.1 - JuanSheba diff --git a/resources/metadata.rb b/resources/metadata.rb index 283526d2..18562c7a 100644 --- a/resources/metadata.rb +++ b/resources/metadata.rb @@ -5,7 +5,7 @@ maintainer_email 'git@redborder.com' license 'AGPL-3.0' description 'Installs/Configures redborder manager' -version '4.4.1' +version '4.4.2' depends 'rb-common' depends 'chef-server' From 77547bdd110fef6000c69d9b2b79b9e75c0ec412 Mon Sep 17 00:00:00 2001 From: Daniel Castro Date: Fri, 8 Nov 2024 11:19:10 +0000 Subject: [PATCH 16/23] create sudoers file before redborder-monitor install --- resources/recipes/configure.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/resources/recipes/configure.rb b/resources/recipes/configure.rb index 869c3158..e702dd89 100644 --- a/resources/recipes/configure.rb +++ b/resources/recipes/configure.rb @@ -34,6 +34,15 @@ end end +# Sudoers +template '/etc/sudoers.d/redborder-manager' do + source 'redborder-manager.erb' + owner 'root' + group 'root' + mode '0440' + retries 2 +end + consul_config 'Configure Consul Server' do cdomain node['redborder']['cdomain'] dns_local_ip node['consul']['dns_local_ip'] @@ -658,15 +667,6 @@ end end -# Sudoers -template '/etc/sudoers.d/redborder-manager' do - source 'redborder-manager.erb' - owner 'root' - group 'root' - mode '0440' - retries 2 -end - # Pending Changes.. # pending_changes==0 -> has changes to apply at next chef-client run # pending_changes==1 -> chef-client has to run once From da722bb9ae5c892f1259cd5897086fb5108cefd2 Mon Sep 17 00:00:00 2001 From: Juan Soto <127120525+jsotofernandez@users.noreply.github.com> Date: Fri, 8 Nov 2024 15:47:08 +0000 Subject: [PATCH 17/23] Create and pass split_intrusion variables to logstash config (#216) Co-authored-by: David Vanhoucke --- resources/recipes/configure.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/resources/recipes/configure.rb b/resources/recipes/configure.rb index 869c3158..9f3b9f6a 100644 --- a/resources/recipes/configure.rb +++ b/resources/recipes/configure.rb @@ -401,6 +401,14 @@ end end +if manager_services['logstash'] + begin + split_intrusion = data_bag_item('rBglobal', 'splitintrusion')['logstash'] + rescue + split_intrusion = false + end +end + logstash_config 'Configure logstash' do if manager_services['logstash'] && node.run_state['pipelines'] && !node.run_state['pipelines'].empty? cdomain node['redborder']['cdomain'] @@ -414,6 +422,7 @@ vault_incidents_priority_filter node['redborder']['vault_incidents_priority_filter'] logstash_pipelines node.run_state['pipelines'] split_traffic_logstash split_traffic + split_intrusion_logstash split_intrusion action [:add, :register] else action [:remove, :deregister] From a4d134879dfb199b63be68384c920a641d27ff41 Mon Sep 17 00:00:00 2001 From: David Vanhoucke Date: Fri, 8 Nov 2024 15:49:08 +0000 Subject: [PATCH 18/23] release 4.4.3 --- CHANGELOG.md | 15 +++++++++++++++ resources/metadata.rb | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 285f1291..252d614c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,21 @@ cookbook-rb-manager CHANGELOG =============== +## 4.4.3 + + - Juan Soto + - [da722bb] Create and pass split_intrusion variables to logstash config (#216) + - Rafael Gomez + - [0fc8265] pump version + - [b0e84e3] Merge branch 'master' into bugfix/#19260_Wrong_check_in_get_sensors_all_info_and_get_sensors_info_on-_sensores_with_parent_id + - Rafa Gómez + - [146cac6] Merge pull request #237 from redBorder/bugfix/#19260_Wrong_check_in_get_sensors_all_info_and_get_sensors_info_on-_sensores_with_parent_id + - jnavarrorb + - [72d2b00] Fix sensors info with all sensors (proxy childs too) + - [87628c7] Fix parent_id to real_parent_id + - [060f5d9] Fix open kafka port for all IPS + - [a9a3efe] check if redborder_parent_id is nil or sensor at redborder_parent_id is not a proxy + ## 4.4.2 - jnavarrorb diff --git a/resources/metadata.rb b/resources/metadata.rb index 18562c7a..f75ea93c 100644 --- a/resources/metadata.rb +++ b/resources/metadata.rb @@ -5,7 +5,7 @@ maintainer_email 'git@redborder.com' license 'AGPL-3.0' description 'Installs/Configures redborder manager' -version '4.4.2' +version '4.4.3' depends 'rb-common' depends 'chef-server' From f7dd0cdad9c712188afb54657d1870957c3c468f Mon Sep 17 00:00:00 2001 From: david vhk <34706472+davidredborder@users.noreply.github.com> Date: Fri, 8 Nov 2024 15:52:40 +0000 Subject: [PATCH 19/23] release 4.4.3 (#243) * check if redborder_parent_id is nil or sensor at redborder_parent_id is not a proxy * Fix lint errors * Fix open kafka port for all IPS * Fix parent_id to real_parent_id * Fetch * Fix parent_id to real_parent_id * Fix sensors info with all sensors (proxy childs too) * fix lint cookstyle errors * pump version * Create and pass split_intrusion variables to logstash config (#216) Co-authored-by: David Vanhoucke * release 4.4.3 --------- Co-authored-by: jnavarrorb Co-authored-by: Rafael Gomez Co-authored-by: Juan Soto <127120525+jsotofernandez@users.noreply.github.com> --- CHANGELOG.md | 23 +++++++++++++++++++++ resources/libraries/get_sensors_all_info.rb | 7 +++++-- resources/libraries/get_sensors_info.rb | 5 +++-- resources/libraries/open_kafka_port.rb | 2 +- resources/metadata.rb | 2 +- resources/recipes/configure.rb | 9 ++++++++ 6 files changed, 42 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b1331b7..252d614c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,29 @@ cookbook-rb-manager CHANGELOG =============== +## 4.4.3 + + - Juan Soto + - [da722bb] Create and pass split_intrusion variables to logstash config (#216) + - Rafael Gomez + - [0fc8265] pump version + - [b0e84e3] Merge branch 'master' into bugfix/#19260_Wrong_check_in_get_sensors_all_info_and_get_sensors_info_on-_sensores_with_parent_id + - Rafa Gómez + - [146cac6] Merge pull request #237 from redBorder/bugfix/#19260_Wrong_check_in_get_sensors_all_info_and_get_sensors_info_on-_sensores_with_parent_id + - jnavarrorb + - [72d2b00] Fix sensors info with all sensors (proxy childs too) + - [87628c7] Fix parent_id to real_parent_id + - [060f5d9] Fix open kafka port for all IPS + - [a9a3efe] check if redborder_parent_id is nil or sensor at redborder_parent_id is not a proxy + +## 4.4.2 + + - jnavarrorb + - [72d2b00] Fix sensors info with all sensors (proxy childs too) + - [87628c7] Fix parent_id to real_parent_id + - [060f5d9] Fix open kafka port for all IPS + - [a9a3efe] check if redborder_parent_id is nil or sensor at redborder_parent_id is not a proxy + ## 4.4.1 - JuanSheba diff --git a/resources/libraries/get_sensors_all_info.rb b/resources/libraries/get_sensors_all_info.rb index 9a4ea65e..0bb73e0f 100644 --- a/resources/libraries/get_sensors_all_info.rb +++ b/resources/libraries/get_sensors_all_info.rb @@ -5,10 +5,13 @@ def get_sensors_all_info sensor_types = %w(ips-sensor ipsv2-sensor ipscp-sensor ipsg-sensor vault-sensor flow-sensor arubacentral-sensor mse-sensor meraki-sensor cisco-cloudproxy proxy-sensor scanner-sensor mse-sensor meraki-sensor ale-sensor cep-sensor device-sensor) sensor_types.each do |s_type| - sensors = search(:node, "role:#{s_type} AND -redborder_parent_id:*?").sort # get sensor where parent_id is nil + sensors = search(:node, "role:#{s_type}").sort # get all s_type's sensor sensors_info[s_type] = [] - sensors.each { |s| sensors_info[s_type] << s } + + sensors.each do |sensor| + sensors_info[s_type] << sensor + end end sensors_info diff --git a/resources/libraries/get_sensors_info.rb b/resources/libraries/get_sensors_info.rb index 340362bb..7801ac93 100644 --- a/resources/libraries/get_sensors_info.rb +++ b/resources/libraries/get_sensors_info.rb @@ -7,8 +7,8 @@ def get_sensors_info ips-sensor ipsv2-sensor ipscp-sensor ipsg-sensor) locations = node['redborder']['locations'] sensor_types.each do |s_type| - # get sensor where parent_id is nil - sensors = search(:node, "role:#{s_type} AND -redborder_parent_id:*?").sort + # get all s_type's sensor + sensors = search(:node, "role:#{s_type}").sort sensors_info[s_type] = {} sensors.each do |s| info = {} @@ -27,6 +27,7 @@ def get_sensors_info info['locations'][loc] = s['redborder'][loc] end + sensors_info[s_type][s.name] = info end end diff --git a/resources/libraries/open_kafka_port.rb b/resources/libraries/open_kafka_port.rb index 5c80e176..b536e824 100644 --- a/resources/libraries/open_kafka_port.rb +++ b/resources/libraries/open_kafka_port.rb @@ -2,7 +2,7 @@ module RbManager module Helpers def get_ip_of_manager_ips # IPS in manager mode has the role ips-sensor - sensors = search(:node, 'role:ips-sensor AND -redborder_parent_id:*?').sort + sensors = search(:node, 'role:ips-sensor').sort sensors.map { |s| { ipaddress: s['ipaddress'] } } end diff --git a/resources/metadata.rb b/resources/metadata.rb index 283526d2..f75ea93c 100644 --- a/resources/metadata.rb +++ b/resources/metadata.rb @@ -5,7 +5,7 @@ maintainer_email 'git@redborder.com' license 'AGPL-3.0' description 'Installs/Configures redborder manager' -version '4.4.1' +version '4.4.3' depends 'rb-common' depends 'chef-server' diff --git a/resources/recipes/configure.rb b/resources/recipes/configure.rb index 869c3158..9f3b9f6a 100644 --- a/resources/recipes/configure.rb +++ b/resources/recipes/configure.rb @@ -401,6 +401,14 @@ end end +if manager_services['logstash'] + begin + split_intrusion = data_bag_item('rBglobal', 'splitintrusion')['logstash'] + rescue + split_intrusion = false + end +end + logstash_config 'Configure logstash' do if manager_services['logstash'] && node.run_state['pipelines'] && !node.run_state['pipelines'].empty? cdomain node['redborder']['cdomain'] @@ -414,6 +422,7 @@ vault_incidents_priority_filter node['redborder']['vault_incidents_priority_filter'] logstash_pipelines node.run_state['pipelines'] split_traffic_logstash split_traffic + split_intrusion_logstash split_intrusion action [:add, :register] else action [:remove, :deregister] From f8578e15e1b073debc0d5211639e80a8269df216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20P=C3=A9rez?= Date: Fri, 8 Nov 2024 15:56:51 +0000 Subject: [PATCH 20/23] release 4.4.4 --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ resources/metadata.rb | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 252d614c..b64bce6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,32 @@ cookbook-rb-manager CHANGELOG =============== +## 4.4.4 + + - Pablo Pérez + - [d1af75b] Merge pull request #240 from redBorder/bugfix/#19198_vault_priorities_incorrect_values + - [7d9b0a6] Merge branch 'master' into bugfix/#19198_vault_priorities_incorrect_values + - David Vanhoucke + - [a4d1348] release 4.4.3 + - Juan Soto + - [da722bb] Create and pass split_intrusion variables to logstash config (#216) + - Rafael Gomez + - [0fc8265] pump version + - [b0e84e3] Merge branch 'master' into bugfix/#19260_Wrong_check_in_get_sensors_all_info_and_get_sensors_info_on-_sensores_with_parent_id + - Rafa Gómez + - [146cac6] Merge pull request #237 from redBorder/bugfix/#19260_Wrong_check_in_get_sensors_all_info_and_get_sensors_info_on-_sensores_with_parent_id + - jnavarrorb + - [aebf0a9] fix lint cookstyle errors + - [72d2b00] Fix sensors info with all sensors (proxy childs too) + - [87628c7] Fix parent_id to real_parent_id + - [0e60c0a] Fetch + - [7f6b98e] Fix parent_id to real_parent_id + - [060f5d9] Fix open kafka port for all IPS + - [610ab20] Fix lint errors + - [a9a3efe] check if redborder_parent_id is nil or sensor at redborder_parent_id is not a proxy + - ptorresred + - [80dda4a] Redmine #19198: Change vault priority default filter + ## 4.4.3 - Juan Soto diff --git a/resources/metadata.rb b/resources/metadata.rb index f75ea93c..f5271f54 100644 --- a/resources/metadata.rb +++ b/resources/metadata.rb @@ -5,7 +5,7 @@ maintainer_email 'git@redborder.com' license 'AGPL-3.0' description 'Installs/Configures redborder manager' -version '4.4.3' +version '4.4.4' depends 'rb-common' depends 'chef-server' From 95a4edb6a7578d95272020caaa78d7637fe441ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20P=C3=A9rez?= Date: Fri, 8 Nov 2024 16:13:43 +0000 Subject: [PATCH 21/23] release 4.4.4 (beautiful changelog) --- CHANGELOG.md | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b64bce6c..f02cac1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,27 +3,6 @@ cookbook-rb-manager CHANGELOG ## 4.4.4 - - Pablo Pérez - - [d1af75b] Merge pull request #240 from redBorder/bugfix/#19198_vault_priorities_incorrect_values - - [7d9b0a6] Merge branch 'master' into bugfix/#19198_vault_priorities_incorrect_values - - David Vanhoucke - - [a4d1348] release 4.4.3 - - Juan Soto - - [da722bb] Create and pass split_intrusion variables to logstash config (#216) - - Rafael Gomez - - [0fc8265] pump version - - [b0e84e3] Merge branch 'master' into bugfix/#19260_Wrong_check_in_get_sensors_all_info_and_get_sensors_info_on-_sensores_with_parent_id - - Rafa Gómez - - [146cac6] Merge pull request #237 from redBorder/bugfix/#19260_Wrong_check_in_get_sensors_all_info_and_get_sensors_info_on-_sensores_with_parent_id - - jnavarrorb - - [aebf0a9] fix lint cookstyle errors - - [72d2b00] Fix sensors info with all sensors (proxy childs too) - - [87628c7] Fix parent_id to real_parent_id - - [0e60c0a] Fetch - - [7f6b98e] Fix parent_id to real_parent_id - - [060f5d9] Fix open kafka port for all IPS - - [610ab20] Fix lint errors - - [a9a3efe] check if redborder_parent_id is nil or sensor at redborder_parent_id is not a proxy - ptorresred - [80dda4a] Redmine #19198: Change vault priority default filter From 224d30322521cead3207f8dad907d8003d505430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20P=C3=A9rez?= Date: Fri, 8 Nov 2024 16:15:59 +0000 Subject: [PATCH 22/23] fix 4.4.3 changelog --- CHANGELOG.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f02cac1e..926413c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,16 +10,6 @@ cookbook-rb-manager CHANGELOG - Juan Soto - [da722bb] Create and pass split_intrusion variables to logstash config (#216) - - Rafael Gomez - - [0fc8265] pump version - - [b0e84e3] Merge branch 'master' into bugfix/#19260_Wrong_check_in_get_sensors_all_info_and_get_sensors_info_on-_sensores_with_parent_id - - Rafa Gómez - - [146cac6] Merge pull request #237 from redBorder/bugfix/#19260_Wrong_check_in_get_sensors_all_info_and_get_sensors_info_on-_sensores_with_parent_id - - jnavarrorb - - [72d2b00] Fix sensors info with all sensors (proxy childs too) - - [87628c7] Fix parent_id to real_parent_id - - [060f5d9] Fix open kafka port for all IPS - - [a9a3efe] check if redborder_parent_id is nil or sensor at redborder_parent_id is not a proxy ## 4.4.2 From 666fe163243d560674be52a395776f8afbc3a882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20P=C3=A9rez?= Date: Mon, 11 Nov 2024 14:36:07 +0000 Subject: [PATCH 23/23] release 4.4.5 --- CHANGELOG.md | 5 +++++ resources/metadata.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 926413c1..a1854ee5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ cookbook-rb-manager CHANGELOG =============== +## 4.4.5 + + - Daniel Castro + - [77547bd] create sudoers file before redborder-monitor install + ## 4.4.4 - ptorresred diff --git a/resources/metadata.rb b/resources/metadata.rb index f5271f54..a7de3505 100644 --- a/resources/metadata.rb +++ b/resources/metadata.rb @@ -5,7 +5,7 @@ maintainer_email 'git@redborder.com' license 'AGPL-3.0' description 'Installs/Configures redborder manager' -version '4.4.4' +version '4.4.5' depends 'rb-common' depends 'chef-server'