From d20d0cc2288d07aa22f4127b26edbb19eca97679 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Tue, 26 Oct 2021 15:24:11 -0300 Subject: [PATCH 1/5] Update release 4.2.4 --- .../elastic-stack/attributes/versions.rb | 6 ++--- cookbooks/filebeat-oss/attributes/versions.rb | 6 ++--- cookbooks/filebeat/attributes/versions.rb | 6 ++--- cookbooks/opendistro/attributes/versions.rb | 10 ++++---- cookbooks/opendistro/recipes/prerequisites.rb | 6 ++--- .../opendistro/prerequisites_test.rb | 4 ++-- cookbooks/wazuh_agent/attributes/version.rb | 4 ++-- cookbooks/wazuh_agent/recipes/common.rb | 24 +++++++++---------- .../integration/wazuh_agent/common_test.rb | 18 +++++++------- .../wazuh_manager/attributes/versions.rb | 4 ++-- cookbooks/wazuh_manager/recipes/common.rb | 16 ++++++------- cookbooks/wazuh_manager/recipes/manager.rb | 2 +- .../templates/default/api.yaml.erb | 3 ++- .../integration/wazuh_manager/common_test.rb | 18 +++++++------- metadata.rb | 2 +- 15 files changed, 65 insertions(+), 64 deletions(-) diff --git a/cookbooks/elastic-stack/attributes/versions.rb b/cookbooks/elastic-stack/attributes/versions.rb index 3061f951..21f4f228 100644 --- a/cookbooks/elastic-stack/attributes/versions.rb +++ b/cookbooks/elastic-stack/attributes/versions.rb @@ -10,8 +10,8 @@ # Wazuh default['wazuh']['major_version'] = '4.x' -default['wazuh']['minor_version'] = '4.0' -default['wazuh']['patch_version'] = '4.0.4' +default['wazuh']['minor_version'] = '4.2' +default['wazuh']['patch_version'] = '4.2.4' # Kibana -default['wazuh']['kibana_plugin_version'] = '4.0.4_7.9.3' +default['wazuh']['kibana_plugin_version'] = '4.2.4_7.10.2' diff --git a/cookbooks/filebeat-oss/attributes/versions.rb b/cookbooks/filebeat-oss/attributes/versions.rb index 37276da8..144089ab 100644 --- a/cookbooks/filebeat-oss/attributes/versions.rb +++ b/cookbooks/filebeat-oss/attributes/versions.rb @@ -4,9 +4,9 @@ # ELK default['elk']['major_version'] = "7.x" -default['elk']['patch_version'] = "7.9.1" +default['elk']['patch_version'] = "7.11.2" # Wazuh default['wazuh']['major_version'] = "4.x" -default['wazuh']['minor_version'] = "4.0" -default['wazuh']['patch_version'] = "4.0.4" \ No newline at end of file +default['wazuh']['minor_version'] = "4.2" +default['wazuh']['patch_version'] = "4.2.4" \ No newline at end of file diff --git a/cookbooks/filebeat/attributes/versions.rb b/cookbooks/filebeat/attributes/versions.rb index 77435495..c0fd4fd1 100644 --- a/cookbooks/filebeat/attributes/versions.rb +++ b/cookbooks/filebeat/attributes/versions.rb @@ -4,9 +4,9 @@ # ELK default['elk']['major_version'] = "7.x" -default['elk']['patch_version'] = "7.9.3" +default['elk']['patch_version'] = "7.10.2" # Wazuh default['wazuh']['major_version'] = "4.x" -default['wazuh']['minor_version'] = "4.0" -default['wazuh']['patch_version'] = "4.0.4" \ No newline at end of file +default['wazuh']['minor_version'] = "4.2" +default['wazuh']['patch_version'] = "4.2.4" \ No newline at end of file diff --git a/cookbooks/opendistro/attributes/versions.rb b/cookbooks/opendistro/attributes/versions.rb index 94c9dfd4..2175d2a7 100644 --- a/cookbooks/opendistro/attributes/versions.rb +++ b/cookbooks/opendistro/attributes/versions.rb @@ -5,18 +5,18 @@ # Author:: Wazuh # Elastic Stack -default['elk']['patch_version'] = '7.9.1' +default['elk']['patch_version'] = '7.10.2' # Opendistro -default['odfe']['patch_version'] = '1.11.0' +default['odfe']['patch_version'] = '1.13.2' # Wazuh default['wazuh']['major_version'] = '4.x' -default['wazuh']['minor_version'] = '4.0' -default['wazuh']['patch_version'] = '4.0.4' +default['wazuh']['minor_version'] = '4.2' +default['wazuh']['patch_version'] = '4.2.4' # Kibana -default['wazuh']['kibana_plugin_version'] = '4.0.4_7.9.1' +default['wazuh']['kibana_plugin_version'] = '4.2.4_7.10.2' # Search guard default['searchguard']['version'] = '1.8' diff --git a/cookbooks/opendistro/recipes/prerequisites.rb b/cookbooks/opendistro/recipes/prerequisites.rb index d874f1f7..97c01282 100644 --- a/cookbooks/opendistro/recipes/prerequisites.rb +++ b/cookbooks/opendistro/recipes/prerequisites.rb @@ -52,19 +52,19 @@ if node['platform_version'] >= '8' dnf_package 'Install prerequisites packages' do - package_name %w[java-11-openjdk-devel libcap] + package_name %w[java-11-openjdk libcap] action :install end else yum_package 'Install prerequisites packages' do - package_name %w[java-11-openjdk-devel libcap] + package_name %w[java-11-openjdk libcap] action :install end end when 'opensuseleap', 'suse' # Install zypper prerequisites zypper_package 'Install prerequisites packages' do - package_name %w[libcap2 java-11-openjdk-devel] + package_name %w[libcap2 java-11-openjdk] end else raise 'Currently platforn not supported yet. Feel free to open an issue on https://www.github.com/wazuh/wazuh-chef if you consider that support for a specific OS should be added' diff --git a/cookbooks/opendistro/test/integration/opendistro/prerequisites_test.rb b/cookbooks/opendistro/test/integration/opendistro/prerequisites_test.rb index 9fce6529..ab839f7b 100644 --- a/cookbooks/opendistro/test/integration/opendistro/prerequisites_test.rb +++ b/cookbooks/opendistro/test/integration/opendistro/prerequisites_test.rb @@ -36,7 +36,7 @@ it { should be_installed } end - describe package('java-11-openjdk-devel') do + describe package('java-11-openjdk') do it { should be_installed } end when 'suse' @@ -44,7 +44,7 @@ it { should be_installed } end - describe package('java-11-openjdk-devel') do + describe package('java-11-openjdk') do it { should be_installed } end end diff --git a/cookbooks/wazuh_agent/attributes/version.rb b/cookbooks/wazuh_agent/attributes/version.rb index b860d415..dc945c09 100644 --- a/cookbooks/wazuh_agent/attributes/version.rb +++ b/cookbooks/wazuh_agent/attributes/version.rb @@ -3,5 +3,5 @@ # Author:: Wazuh = 15.0' %w(redhat centos oracle).each do |el| From 73164f9e10fc6261ef0b6f123e1b5d3bf53ba81f Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 27 Oct 2021 13:03:47 -0300 Subject: [PATCH 2/5] Update Release 4.2.4 --- .../elastic-stack/attributes/versions.rb | 2 +- cookbooks/filebeat-oss/attributes/versions.rb | 2 +- .../integration/wazuh_agent/common_test.rb | 8 ++++---- cookbooks/wazuh_manager/recipes/manager.rb | 2 +- .../templates/default/api.yaml.erb | 19 ++++++++++--------- .../integration/wazuh_manager/common_test.rb | 16 ++++++++-------- .../integration/wazuh_manager/manager_test.rb | 4 ++-- 7 files changed, 27 insertions(+), 26 deletions(-) diff --git a/cookbooks/elastic-stack/attributes/versions.rb b/cookbooks/elastic-stack/attributes/versions.rb index 21f4f228..983bb8bc 100644 --- a/cookbooks/elastic-stack/attributes/versions.rb +++ b/cookbooks/elastic-stack/attributes/versions.rb @@ -6,7 +6,7 @@ # ELK default['elk']['major_version'] = '7.x' -default['elk']['patch_version'] = '7.9.3' +default['elk']['patch_version'] = '7.11.2' # Wazuh default['wazuh']['major_version'] = '4.x' diff --git a/cookbooks/filebeat-oss/attributes/versions.rb b/cookbooks/filebeat-oss/attributes/versions.rb index 144089ab..65c069b1 100644 --- a/cookbooks/filebeat-oss/attributes/versions.rb +++ b/cookbooks/filebeat-oss/attributes/versions.rb @@ -4,7 +4,7 @@ # ELK default['elk']['major_version'] = "7.x" -default['elk']['patch_version'] = "7.11.2" +default['elk']['patch_version'] = "7.10.2" # Wazuh default['wazuh']['major_version'] = "4.x" diff --git a/cookbooks/wazuh_agent/test/integration/wazuh_agent/common_test.rb b/cookbooks/wazuh_agent/test/integration/wazuh_agent/common_test.rb index 31b93719..0c162ec4 100644 --- a/cookbooks/wazuh_agent/test/integration/wazuh_agent/common_test.rb +++ b/cookbooks/wazuh_agent/test/integration/wazuh_agent/common_test.rb @@ -9,19 +9,19 @@ its('exit_status') { should eq 0 } end -describe command('ps -ef | grep ossec-logcollector') do +describe command('ps -ef | grep wazuh-logcollector') do its('exit_status') { should eq 0 } end -describe command('ps -ef | grep ossec-syscheckd') do +describe command('ps -ef | grep wazuh-syscheckd') do its('exit_status') { should eq 0 } end -describe command('ps -ef | grep ossec-execd') do +describe command('ps -ef | grep wazuh-execd') do its('exit_status') { should eq 0 } end -describe command('ps -ef | grep ossec-agentd') do +describe command('ps -ef | grep wazuh-agentd') do its('exit_status') { should eq 0 } end diff --git a/cookbooks/wazuh_manager/recipes/manager.rb b/cookbooks/wazuh_manager/recipes/manager.rb index 6e377da3..932dcf7b 100644 --- a/cookbooks/wazuh_manager/recipes/manager.rb +++ b/cookbooks/wazuh_manager/recipes/manager.rb @@ -46,7 +46,7 @@ if node['ossec']['conf']['cluster']['node_type'] == 'master' execute 'Enable Authd' do command '/var/ossec/bin/wazuh-control enable auth' - not_if "ps axu | grep ossec-authd | grep -v grep" + not_if "ps axu | grep wazuh-authd | grep -v grep" end end diff --git a/cookbooks/wazuh_manager/templates/default/api.yaml.erb b/cookbooks/wazuh_manager/templates/default/api.yaml.erb index f629f586..a0183b58 100644 --- a/cookbooks/wazuh_manager/templates/default/api.yaml.erb +++ b/cookbooks/wazuh_manager/templates/default/api.yaml.erb @@ -4,18 +4,19 @@ host: <%= @host %> port: <%= @port %> # Set this option to "yes" in case the API is running behind a proxy server. Values: yes, no -behind_proxy_server: no +#behind_proxy_server: no # Advanced configuration -https: - enabled: yes - key: "api/configuration/ssl/server.key" - cert: "api/configuration/ssl/server.crt" - use_ca: False - ca: "api/configuration/ssl/ca.crt" - ssl_protocol: 'TLSv1.2' - ssl_ciphers: '""' +#https: + #enabled: yes + #key: "api/configuration/ssl/server.key" + #cert: "api/configuration/ssl/server.crt" + #use_ca: False + #ca: "api/configuration/ssl/ca.crt" + #ssl_protocol: 'TLSv1.2' + #ssl_ciphers: '""' + # Logging configuration # Values for API log level: disabled, info, warning, error, debug, debug2 (each level includes the previous level). diff --git a/cookbooks/wazuh_manager/test/integration/wazuh_manager/common_test.rb b/cookbooks/wazuh_manager/test/integration/wazuh_manager/common_test.rb index e02ce148..637cfc3e 100644 --- a/cookbooks/wazuh_manager/test/integration/wazuh_manager/common_test.rb +++ b/cookbooks/wazuh_manager/test/integration/wazuh_manager/common_test.rb @@ -17,27 +17,27 @@ its('exit_status') { should eq 0 } end -describe command('ps -ef | grep ossec-monitord') do +describe command('ps -ef | grep wazuh-monitord') do its('exit_status') { should eq 0 } end -describe command('ps -ef | grep ossec-logcollector') do +describe command('ps -ef | grep wazuh-logcollector') do its('exit_status') { should eq 0 } end -describe command('ps -ef | grep ossec-remoted') do +describe command('ps -ef | grep wazuh-remoted') do its('exit_status') { should eq 0 } end -describe command('ps -ef | grep ossec-syscheckd') do +describe command('ps -ef | grep wazuh-syscheckd') do its('exit_status') { should eq 0 } end -describe command('ps -ef | grep ossec-analysisd') do +describe command('ps -ef | grep wazuh-analysisd') do its('exit_status') { should eq 0 } end -describe command('ps -ef | grep ossec-execd') do +describe command('ps -ef | grep wazuh-execd') do its('exit_status') { should eq 0 } end @@ -45,11 +45,11 @@ its('exit_status') { should eq 0 } end -describe command('ps -ef | grep ossec-authd') do +describe command('ps -ef | grep wazuh-authd') do its('exit_status') { should eq 0 } end -describe command('ps -ef | grep ossec-apid') do +describe command('ps -ef | grep wazuh-apid') do its('exit_status') { should eq 0 } end diff --git a/cookbooks/wazuh_manager/test/integration/wazuh_manager/manager_test.rb b/cookbooks/wazuh_manager/test/integration/wazuh_manager/manager_test.rb index 32a7f5ca..22761ded 100644 --- a/cookbooks/wazuh_manager/test/integration/wazuh_manager/manager_test.rb +++ b/cookbooks/wazuh_manager/test/integration/wazuh_manager/manager_test.rb @@ -15,10 +15,10 @@ describe port(1515) do it { should be_listening } - its('processes') {should include 'ossec-authd'} + its('processes') {should include 'wazuh-authd'} end describe port(1514) do it { should be_listening } - its('processes') {should include 'ossec-remoted'} + its('processes') {should include 'wazuh-remoted'} end From 71343a2bd0ce1c3897b554eedf5ad5969b6703ba Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 27 Oct 2021 16:30:50 -0300 Subject: [PATCH 3/5] Update Release 4.2.4 --- cookbooks/elastic-stack/recipes/kibana.rb | 2 +- cookbooks/opendistro/recipes/kibana.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbooks/elastic-stack/recipes/kibana.rb b/cookbooks/elastic-stack/recipes/kibana.rb index 8508c084..28725528 100644 --- a/cookbooks/elastic-stack/recipes/kibana.rb +++ b/cookbooks/elastic-stack/recipes/kibana.rb @@ -35,7 +35,7 @@ source 'kibana.yml.erb' owner 'kibana' group 'kibana' - mode 0o755 + mode 0755 variables({ server_port: node['kibana']['yml']['server']['port'], server_host: node['kibana']['yml']['server']['host'], diff --git a/cookbooks/opendistro/recipes/kibana.rb b/cookbooks/opendistro/recipes/kibana.rb index f37e1661..72e2bc43 100644 --- a/cookbooks/opendistro/recipes/kibana.rb +++ b/cookbooks/opendistro/recipes/kibana.rb @@ -40,7 +40,7 @@ server_host: (node['kibana']['yml']['server']['host']).to_s, elasticsearch_hosts: node['kibana']['yml']['elasticsearch']['hosts'] }) - mode 0o755 + mode 0755 end # Update the optimize and plugins directories permissions From 625f330805b062484804597c7ff6da0bb2993127 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 27 Oct 2021 16:38:07 -0300 Subject: [PATCH 4/5] Update Release 4.2.4 --- CHANGELOG.md | 11 +++++++++++ README.md | 1 + 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ae0e5b3..165e17a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,17 @@ # Change Log All notable changes to this project will be documented in this file. +## Wazuh Chef v4.2.4 + +### Added + +- Update to Wazuh [v4.2.4](https://github.com/wazuh/wazuh/blob/v4.2.4/CHANGELOG.md#v424) + +### Fixed + +- References to ossec- files were modified by the new wazuh- nomenclature. +- Checks on the ossec-init.conf file, which does not exist since version 4.1.0, have been removed. + ## Wazuh Chef v4.0.4_1.11.0 ### Added diff --git a/README.md b/README.md index fc00cf56..1c52fdf1 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Deploy the Wazuh platform using Chef cookbooks. Chef recipes are prepared for in | Wazuh version | Elastic | ODFE | |---------------|---------|--------| +| v4.2.4 | v7.10.2 | v1.13.2| | v4.0.4 | v7.9.3 | v1.11.0| ## Dependencies From 5372df33ba1a5290ccfbc34ab862c9c44676847a Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 27 Oct 2021 17:09:29 -0300 Subject: [PATCH 5/5] Update Release 4.2.4 --- cookbooks/wazuh_agent/recipes/common.rb | 13 ------------- .../test/integration/wazuh_agent/common_test.rb | 11 ----------- cookbooks/wazuh_manager/recipes/common.rb | 9 --------- .../wazuh_manager/templates/default/api.yaml.erb | 15 --------------- .../test/integration/wazuh_manager/common_test.rb | 11 ----------- 5 files changed, 59 deletions(-) diff --git a/cookbooks/wazuh_agent/recipes/common.rb b/cookbooks/wazuh_agent/recipes/common.rb index ed1e25cd..ae6300dc 100644 --- a/cookbooks/wazuh_agent/recipes/common.rb +++ b/cookbooks/wazuh_agent/recipes/common.rb @@ -17,19 +17,6 @@ # limitations under the License. # -#ruby_block 'ossec install_type' do -# block do -# File.open('/var/ossec/etc/ossec-init.conf') do |file| -# file.each_line do |line| -# if line =~ /^TYPE="([^"]+)"/ -# type = Regexp.last_match(1) -# break -# end -# end -# end -# end -#end - # Gyoku renders the XML. chef_gem 'gyoku' do compile_time false if respond_to?(:compile_time) diff --git a/cookbooks/wazuh_agent/test/integration/wazuh_agent/common_test.rb b/cookbooks/wazuh_agent/test/integration/wazuh_agent/common_test.rb index 0c162ec4..2f8e5644 100644 --- a/cookbooks/wazuh_agent/test/integration/wazuh_agent/common_test.rb +++ b/cookbooks/wazuh_agent/test/integration/wazuh_agent/common_test.rb @@ -27,10 +27,6 @@ # Check OSSEC dir -#describe file('/var/ossec/etc/ossec-init.conf') do -# it { should be_symlink } -#end - describe file('/var/ossec') do it { should be_directory } its('mode') { should cmp '0750' } @@ -45,13 +41,6 @@ its('group') { should cmp 'ossec' } end -#describe file('/etc/ossec-init.conf') do -# it { should exist } -# its('owner') { should cmp 'root' } -# its('group') { should cmp 'ossec' } -# its('mode') { should cmp '0640' } -#end - describe file('/var/ossec/etc/ossec.conf') do it { should exist } its('owner') { should cmp 'root' } diff --git a/cookbooks/wazuh_manager/recipes/common.rb b/cookbooks/wazuh_manager/recipes/common.rb index 0e755948..2438d477 100644 --- a/cookbooks/wazuh_manager/recipes/common.rb +++ b/cookbooks/wazuh_manager/recipes/common.rb @@ -8,15 +8,6 @@ type = 'local' else type = "test" - -# File.open('/var/ossec/etc/ossec-init.conf') do |file| -# file.each_line do |line| -# if line =~ /^TYPE="([^"]+)"/ -# type = Regexp.last_match(1) -# break -# end -# end -# end end node.normal['ossec']['install_type'] = type diff --git a/cookbooks/wazuh_manager/templates/default/api.yaml.erb b/cookbooks/wazuh_manager/templates/default/api.yaml.erb index a0183b58..91165160 100644 --- a/cookbooks/wazuh_manager/templates/default/api.yaml.erb +++ b/cookbooks/wazuh_manager/templates/default/api.yaml.erb @@ -3,21 +3,6 @@ host: <%= @host %> port: <%= @port %> -# Set this option to "yes" in case the API is running behind a proxy server. Values: yes, no -#behind_proxy_server: no - -# Advanced configuration - -#https: - #enabled: yes - #key: "api/configuration/ssl/server.key" - #cert: "api/configuration/ssl/server.crt" - #use_ca: False - #ca: "api/configuration/ssl/ca.crt" - #ssl_protocol: 'TLSv1.2' - #ssl_ciphers: '""' - - # Logging configuration # Values for API log level: disabled, info, warning, error, debug, debug2 (each level includes the previous level). logs: diff --git a/cookbooks/wazuh_manager/test/integration/wazuh_manager/common_test.rb b/cookbooks/wazuh_manager/test/integration/wazuh_manager/common_test.rb index 637cfc3e..aaa96b29 100644 --- a/cookbooks/wazuh_manager/test/integration/wazuh_manager/common_test.rb +++ b/cookbooks/wazuh_manager/test/integration/wazuh_manager/common_test.rb @@ -55,10 +55,6 @@ # Check OSSEC dir -#describe file('/var/ossec/etc/ossec-init.conf') do -# it { should be_symlink } -#end - describe file('/var/ossec') do it { should be_directory } its('mode') { should cmp '0750' } @@ -73,13 +69,6 @@ its('group') { should cmp 'ossec' } end -#describe file('/etc/ossec-init.conf') do -# it { should exist } -# its('owner') { should cmp 'root' } -# its('group') { should cmp 'ossec' } -# its('mode') { should cmp '0640' } -#end - describe file('/var/ossec/etc/shared/default/agent.conf') do it { should exist } its('owner') { should cmp 'ossec' }