Skip to content

Commit f4ab4a8

Browse files
author
Manuel J. Bernal
authored
Merge pull request #286 from wazuh/feature-adapt-major-version
Adapt modules to next major version
2 parents 7c8e36d + 6bebaed commit f4ab4a8

File tree

20 files changed

+418
-205
lines changed

20 files changed

+418
-205
lines changed

README.md

Lines changed: 95 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
[![Slack](https://img.shields.io/badge/slack-join-blue.svg)](https://wazuh.com/community/join-us-on-slack/)
44
[![Email](https://img.shields.io/badge/email-join-blue.svg)](https://groups.google.com/forum/#!forum/wazuh)
55
[![Documentation](https://img.shields.io/badge/docs-view-green.svg)](https://documentation.wazuh.com)
6-
[![Documentation](https://img.shields.io/badge/web-view-green.svg)](https://wazuh.com)
6+
[![Web](https://img.shields.io/badge/web-view-green.svg)](https://wazuh.com)
7+
![Kitchen tests](https://github.com/wazuh/wazuh-puppet/workflows/Kitchen%20tests/badge.svg)
78

89
This module installs and configure Wazuh agent and manager.
910

@@ -18,87 +19,117 @@ This module installs and configure Wazuh agent and manager.
1819
wazuh-puppet/
1920
├── CHANGELOG.md
2021
├── checksums.json
22+
├── data
23+
│ └── common.yaml
2124
├── files
22-
   └── ossec-logrotate.te
25+
└── ossec-logrotate.te
2326
├── Gemfile
27+
├── kitchen
28+
│ ├── chefignore
29+
│ ├── clean.sh
30+
│ ├── Gemfile
31+
│ ├── hieradata
32+
│ │ ├── common.yaml
33+
│ │ └── roles
34+
│ │ └── default.yaml
35+
│ ├── kitchen.yml
36+
│ ├── manifests
37+
│ │ └── site.pp.template
38+
│ ├── Puppetfile
39+
│ ├── README.md
40+
│ ├── run.sh
41+
│ └── test
42+
│ └── integration
43+
│ ├── agent
44+
│ │ └── agent_spec.rb
45+
│ └── mngr
46+
│ └── manager_spec.rb
2447
├── LICENSE.txt
2548
├── manifests
26-
│   ├── activeresponse.pp
27-
│   ├── addlog.pp
28-
│   ├── agent.pp
29-
│   ├── command.pp
30-
│   ├── elasticsearch.pp
31-
│   ├── email_alert.pp
32-
│   ├── filebeat.pp
33-
│   ├── init.pp
34-
│   ├── integration.pp
35-
│   ├── kibana.pp
36-
│   ├── manager.pp
37-
│   ├── params_agent.pp
38-
│   ├── params_elastic.pp
39-
│   ├── params_manager.pp
40-
│   ├── repo_elastic.pp
41-
│   ├── repo.pp
42-
│   ├── reports.pp
43-
│   └── wazuh_api.pp
49+
│ ├── activeresponse.pp
50+
│ ├── addlog.pp
51+
│ ├── agent.pp
52+
│ ├── audit.pp
53+
│ ├── command.pp
54+
│ ├── elasticsearch.pp
55+
│ ├── email_alert.pp
56+
│ ├── filebeat_oss.pp
57+
│ ├── filebeat.pp
58+
│ ├── init.pp
59+
│ ├── integration.pp
60+
│ ├── kibana_od.pp
61+
│ ├── kibana.pp
62+
│ ├── manager.pp
63+
│ ├── opendistro.pp
64+
│ ├── params_agent.pp
65+
│ ├── params_elastic.pp
66+
│ ├── params_manager.pp
67+
│ ├── params_opendistro.pp
68+
│ ├── repo_elastic_oss.pp
69+
│ ├── repo_elastic.pp
70+
│ ├── repo_elasticsearch-oss.pp
71+
│ ├── repo_opendistro.pp
72+
│ ├── repo.pp
73+
│ ├── reports.pp
74+
│ └── tests.pp
4475
├── metadata.json
4576
├── Rakefile
4677
├── README.md
4778
├── spec
48-
   ├── classes
49-
   │   ├── client_spec.rb
50-
   │   ├── init_spec.rb
51-
   │   └── server_spec.rb
52-
   └── spec_helper.rb
79+
├── classes
80+
├── client_spec.rb
81+
├── init_spec.rb
82+
└── server_spec.rb
83+
└── spec_helper.rb
5384
├── templates
54-
│   ├── api
55-
│   │   └── config.js.erb
56-
│   ├── default_commands.erb
57-
│   ├── elasticsearch_yml.erb
58-
│   ├── filebeat_yml.erb
59-
│   ├── fragments
60-
│   │   ├── _activeresponse.erb
61-
│   │   ├── _auth.erb
62-
│   │   ├── _cluster.erb
63-
│   │   ├── _command.erb
64-
│   │   ├── _default_activeresponse.erb
85+
│ ├── default_commands.erb
86+
│ ├── elasticsearch_yml.erb
87+
│ ├── filebeat_oss_yml.erb
88+
│ ├── filebeat_yml.erb
89+
│ ├── fragments
90+
│ │ ├── _activeresponse.erb
91+
│ │ ├── _auth.erb
92+
│ │ ├── _cluster.erb
93+
│ │ ├── _command.erb
94+
│ │ ├── _default_activeresponse.erb
6595
│ │ ├── _email_alert.erb
66-
│   │   ├── _integration.erb
67-
│   │   ├── _localfile.erb
68-
│   │   ├── _localfile_generation.erb
69-
│   │   ├── _reports.erb
70-
│   │   ├── _rootcheck.erb
71-
│   │   ├── _ruleset.erb
72-
│   │   ├── _sca.erb
73-
│   │   ├── _syscheck.erb
74-
│   │   ├── _wodle_cis_cat.erb
75-
│   │   ├── _wodle_openscap.erb
76-
│   │   ├── _wodle_osquery.erb
77-
│   │   ├── _wodle_syscollector.erb
78-
│   │   └── _wodle_vulnerability_detector.erb
79-
│   ├── jvm_options.erb
80-
│   ├── kibana_yml.erb
81-
│   ├── local_decoder.xml.erb
82-
│   ├── local_rules.xml.erb
83-
│   ├── ossec_shared_agent.conf.erb
84-
│   ├── process_list.erb
85-
│   ├── wazuh_agent.conf.erb
86-
│   └── wazuh_manager.conf.erb
87-
├── tests
88-
│   └── init.pp
96+
│ │ ├── _integration.erb
97+
│ │ ├── _labels.erb
98+
│ │ ├── _localfile.erb
99+
│ │ ├── _localfile_generation.erb
100+
│ │ ├── _reports.erb
101+
│ │ ├── _rootcheck.erb
102+
│ │ ├── _ruleset.erb
103+
│ │ ├── _sca.erb
104+
│ │ ├── _syscheck.erb
105+
│ │ ├── _syslog_output.erb
106+
│ │ ├── _vulnerability_detector.erb
107+
│ │ ├── _wodle_cis_cat.erb
108+
│ │ ├── _wodle_openscap.erb
109+
│ │ ├── _wodle_osquery.erb
110+
│ │ └── _wodle_syscollector.erb
111+
│ ├── jvm_options.erb
112+
│ ├── kibana_od_yml.erb
113+
│ ├── kibana_yml.erb
114+
│ ├── local_decoder.xml.erb
115+
│ ├── local_rules.xml.erb
116+
│ ├── opendistro_yml.erb
117+
│ ├── ossec_shared_agent.conf.erb
118+
│ ├── process_list.erb
119+
│ ├── wazuh_agent.conf.erb
120+
│ ├── wazuh_api_yml.erb
121+
│ ├── wazuh_manager.conf.erb
122+
│ └── wazuh_yml.erb
89123
└── VERSION
90124

91125
## Branches
92126

93-
* `stable` branch on correspond to the last Wazuh-Puppet stable version.
127+
* `4.0` branch on correspond to the last Wazuh-Puppet stable version.
94128
* `master` branch contains the latest code, be aware of possible bugs on this branch.
95129

96130
## Contribute
97131

98-
If you would like to contribute to our repository, please fork our Github repository and submit a pull request.
99-
100-
If you are not familiar with Github, you can also share them through [our users mailing list](https://groups.google.com/d/forum/wazuh), to which you can subscribe by sending an email to `wazuh+subscribe@googlegroups.com`.
101-
132+
If you want to contribute to our project please don't hesitate to send a pull request. You can also join our users [mailing list](https://groups.google.com/d/forum/wazuh) or the [Wazuh Slack community channel](https://wazuh.com/community/join-us-on-slack/) to ask questions and participate in discussions.
102133

103134
## Credits and thank you
104135

@@ -109,10 +140,6 @@ This Puppet module has been authored by Nicolas Zin, and updated by Jonathan Gaz
109140
WAZUH
110141
Copyright (C) 2020 Wazuh Inc. (License GPLv2)
111142

112-
Based on OSSEC
113-
Copyright (C) 2015 Trend Micro Inc.
114-
115-
116143
## Web References
117144

118145
* [Wazuh website](http://wazuh.com)

VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
WAZUH-PUPPET_VERSION="v3.13.2"
2-
REVISION="31320"
1+
WAZUH-PUPPET_VERSION="v4.0.0"
2+
REVISION="40000"

kitchen/test/integration/agent/agent_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe package('wazuh-agent') do
22
it { is_expected.to be_installed }
3-
its('version') { is_expected.to eq '3.13.2-1' }
3+
its('version') { is_expected.to eq '4.0.0-1' }
44
end
55

66
describe service('wazuh-agent') do
@@ -15,7 +15,7 @@
1515
'ossec-agentd' => 'ossec',
1616
'ossec-execd' => 'root',
1717
'ossec-syscheckd' => 'root',
18-
'wazuh-modulesd' => 'root',
18+
# 'wazuh-modulesd' => 'root',
1919
}
2020

2121
wazuh_daemons.each do |key, value|

kitchen/test/integration/mngr/manager_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe package('wazuh-manager') do
22
it { is_expected.to be_installed }
3-
its('version') { is_expected.to eq '3.13.2-1' }
3+
its('version') { is_expected.to eq '4.0.0-1' }
44
end
55

66
describe service('wazuh-manager') do

manifests/agent.pp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,25 @@
7272
$client_buffer_queue_size = $wazuh::params_agent::client_buffer_queue_size,
7373
$client_buffer_events_per_second = $wazuh::params_agent::client_buffer_events_per_second,
7474

75+
# Auto enrollment configuration
76+
77+
$wazuh_enrollment_enabled = $wazuh::params_agent::wazuh_enrollment_enabled,
78+
$wazuh_enrollment_manager_address = $wazuh::params_agent::wazuh_enrollment_manager_address,
79+
$wazuh_enrollment_port = $wazuh::params_agent::wazuh_enrollment_port,
80+
$wazuh_enrollment_agent_name = $wazuh::params_agent::wazuh_enrollment_agent_name,
81+
$wazuh_enrollment_groups = $wazuh::params_agent::wazuh_enrollment_groups,
82+
$wazuh_enrollment_agent_address = $wazuh::params_agent::wazuh_enrollment_agent_address,
83+
$wazuh_enrollment_ssl_cipher = $wazuh::params_agent::wazuh_enrollment_ssl_cipher,
84+
$wazuh_enrollment_server_ca_path = $wazuh::params_agent::wazuh_enrollment_server_ca_path,
85+
$wazuh_enrollment_agent_cert_path = $wazuh::params_agent::wazuh_enrollment_agent_cert_path,
86+
$wazuh_enrollment_agent_key_path = $wazuh::params_agent::wazuh_enrollment_agent_key_path,
87+
$wazuh_enrollment_auth_pass = $wazuh::params_agent::wazuh_enrollment_auth_pass,
88+
$wazuh_enrollment_auth_pass_path = $wazuh::params_agent::wazuh_enrollment_auth_pass_path,
89+
$wazuh_enrollment_auto_method = $wazuh::params_agent::wazuh_enrollment_auto_method,
90+
$wazuh_delay_after_enrollment = $wazuh::params_agent::wazuh_delay_after_enrollment,
91+
$wazuh_enrollment_use_source_ip = $wazuh::params_agent::wazuh_enrollment_use_source_ip,
92+
93+
7594
# Rootcheck
7695
$ossec_rootcheck_disabled = $wazuh::params_agent::ossec_rootcheck_disabled,
7796
$ossec_rootcheck_check_files = $wazuh::params_agent::ossec_rootcheck_check_files,
@@ -617,4 +636,15 @@
617636
],
618637
}
619638
}
639+
640+
if ( $wazuh_enrollment_auth_pass ) {
641+
file { $wazuh::params_agent::authd_pass_file:
642+
owner => 'root',
643+
group => 'ossec',
644+
mode => '0640',
645+
content => $wazuh::params_agent::wazuh_enrollment_auth_pass,
646+
require => Package[$wazuh::params_agent::agent_package_name],
647+
}
648+
}
649+
620650
}

manifests/filebeat.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
$filebeat_package = 'filebeat',
99
$filebeat_service = 'filebeat',
10-
$filebeat_version = '7.9.1',
11-
$wazuh_app_version = '3.13.2_7.9.1',
12-
$wazuh_extensions_version = 'v3.13.2',
10+
$filebeat_version = '7.9.2',
11+
$wazuh_app_version = '4.0.0_7.9.2',
12+
$wazuh_extensions_version = 'v4.0.0',
1313
$wazuh_filebeat_module = 'wazuh-filebeat-0.1.tar.gz',
1414
){
1515

manifests/filebeat_oss.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
$filebeat_oss_elastic_user = 'admin',
1111
$filebeat_oss_elastic_password = 'admin',
1212
$filebeat_oss_version = '7.8.0',
13-
$wazuh_app_version = '3.13.2_7.8.0',
14-
$wazuh_extensions_version = 'v3.13.2',
13+
$wazuh_app_version = '4.0.0_7.9.1',
14+
$wazuh_extensions_version = 'v4.0.0',
1515
$wazuh_filebeat_module = 'wazuh-filebeat-0.1.tar.gz',
1616
){
1717

manifests/kibana.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
class wazuh::kibana (
44
$kibana_package = 'kibana',
55
$kibana_service = 'kibana',
6-
$kibana_version = '7.9.1',
7-
$kibana_app_version = '3.13.2_7.9.1',
6+
$kibana_version = '7.9.2',
7+
$kibana_app_version = '4.0.0_7.9.2',
88
$kibana_elasticsearch_ip = 'localhost',
99
$kibana_elasticsearch_port = '9200',
1010

manifests/kibana_od.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
$kibana_od_version = '1.9.0',
77
$kibana_od_elastic_user = 'admin',
88
$kibana_od_elastic_password = 'admin',
9-
$kibana_od_app_version = '3.13.2_7.8.0',
9+
$kibana_od_app_version = '4.0.0_7.9.1',
1010
$kibana_od_elasticsearch_ip = 'localhost',
1111
$kibana_od_elasticsearch_port = '9200',
1212

manifests/manager.pp

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,46 @@
260260
$wazuh_manager_server_key = $wazuh::params_manager::wazuh_manager_server_key,
261261

262262
$ossec_local_files = $::wazuh::params_manager::default_local_files,
263+
264+
# API
265+
266+
267+
$wazuh_api_host = $wazuh::params_manager::wazuh_api_host,
268+
269+
$wazuh_api_port = $wazuh::params_manager::wazuh_api_port,
270+
$wazuh_api_file = $wazuh::params_manager::wazuh_api_file,
271+
272+
$wazuh_api_behind_proxy_server = $wazuh::params_manager::wazuh_api_behind_proxy_server,
273+
$wazuh_api_https_enabled = $wazuh::params_manager::wazuh_api_https_enabled,
274+
$wazuh_api_https_key = $wazuh::params_manager::wazuh_api_https_key,
275+
276+
$wazuh_api_https_cert = $wazuh::params_manager::wazuh_api_https_cert,
277+
$wazuh_api_https_use_ca = $wazuh::params_manager::wazuh_api_https_use_ca,
278+
$wazuh_api_https_ca = $wazuh::params_manager::wazuh_api_https_ca,
279+
$wazuh_api_logs_level = $wazuh::params_manager::wazuh_api_logs_level,
280+
$wazuh_api_logs_path = $wazuh::params_manager::wazuh_api_logs_path,
281+
282+
$wazuh_api_cors_enabled = $wazuh::params_manager::wazuh_api_cors_enabled,
283+
$wazuh_api_cors_source_route = $wazuh::params_manager::wazuh_api_cors_source_route,
284+
$wazuh_api_cors_expose_headers = $wazuh::params_manager::wazuh_api_cors_expose_headers,
285+
286+
287+
$wazuh_api_cors_allow_credentials = $::wazuh::params_manager::wazuh_api_cors_allow_credentials,
288+
$wazuh_api_cache_enabled = $::wazuh::params_manager::wazuh_api_cache_enabled,
289+
290+
$wazuh_api_cache_time = $::wazuh::params_manager::wazuh_api_cache_time,
291+
292+
$wazuh_api_access_max_login_attempts = $::wazuh::params_manager::wazuh_api_access_max_login_attempts,
293+
$wazuh_api_access_block_time = $::wazuh::params_manager::wazuh_api_access_block_time,
294+
$wazuh_api_access_max_request_per_minute = $::wazuh::params_manager::wazuh_api_access_max_request_per_minute,
295+
$wazuh_api_use_only_authd = $::wazuh::params_manager::wazuh_api_use_only_authd,
296+
$wazuh_api_drop_privileges = $::wazuh::params_manager::wazuh_api_drop_privileges,
297+
$wazuh_api_experimental_features = $::wazuh::params_manager::wazuh_api_experimental_features,
298+
$wazuh_api_template = $::wazuh::params_manager::wazuh_api_template,
299+
300+
301+
302+
263303
) inherits wazuh::params_manager {
264304
validate_bool(
265305
$manage_repos, $syslog_output,$wazuh_manager_verify_manager_ssl
@@ -320,7 +360,6 @@
320360
Class['wazuh::repo'] -> Package[$wazuh::params_manager::server_package]
321361
}
322362
}
323-
324363
# Install and configure Wazuh-manager package
325364

326365
package { $wazuh::params_manager::server_package:
@@ -609,4 +648,12 @@
609648
}
610649
}
611650

651+
file { '/var/ossec/api/configuration/api.yaml':
652+
owner => 'root',
653+
group => 'ossec',
654+
mode => '0640',
655+
content => template('wazuh/wazuh_api_yml.erb'),
656+
notify => Service[$wazuh::params_manager::server_service]
657+
}
658+
612659
}

0 commit comments

Comments
 (0)