Skip to content

Commit 4fc77cf

Browse files
authored
Merge pull request #75 from redBorder/development
Release 4.1.3
2 parents f13e473 + f5ee69d commit 4fc77cf

File tree

5 files changed

+28
-1
lines changed

5 files changed

+28
-1
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
cookbook-rb-proxy CHANGELOG
22
===============
33

4+
## 4.1.3
5+
6+
- Juan Soto
7+
- [133047f] Get flow sensors
8+
- [70a85d7] Send flow sensors to firewall cookbook
9+
- [6372c75] Define flow sensors in the proxies
10+
411
## 4.1.2
512

613
- Pablo Pérez
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module RbProxy
2+
module Helpers
3+
def get_flow_sensors_info(sensor_type)
4+
sensors_info = []
5+
begin
6+
sensors = search(:role, 'run_list:role\[proxy-sensor\]')
7+
.map { |role| role.override_attributes['redborder']['sensors_mapping'][sensor_type.to_s] }
8+
.reject { |s_type| s_type.nil? || s_type.empty? }
9+
sensors_info.concat(sensors) unless sensors.empty?
10+
rescue NoMethodError
11+
sensors_info = []
12+
end
13+
sensors_info
14+
end
15+
end
16+
end

resources/metadata.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
maintainer_email '[email protected]'
44
license 'AGPL-3.0'
55
description 'Installs/Configures redborder proxy'
6-
version '4.1.2'
6+
version '4.1.3'
77

88
depends 'rb-common'
99
depends 'rb-selinux'

resources/recipes/configure.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
end
2929

3030
rb_firewall_config 'Configure Firewall' do
31+
flow_sensor_in_proxy_nodes node.run_state['sensors_info_all']['flow-sensor']
3132
vault_sensor_in_proxy_nodes node.run_state['sensors_info_all']['vault-sensor']
3233
if proxy_services['firewall']
3334
action :add

resources/recipes/prepare_system.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@
5959
# get sensors info full info
6060
node.run_state['sensors_info_all'] = get_sensors_all_info()
6161

62+
# get flow sensors in proxy info
63+
node.run_state['sensors_info_all']['flow-sensor'] = get_flow_sensors_info('flow')
64+
6265
# get namespaces
6366
node.run_state['namespaces'] = get_namespaces
6467

0 commit comments

Comments
 (0)