commit
1c6c235c5d
12
CHANGELOG.md
12
CHANGELOG.md
@ -1,6 +1,18 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [v4.3.0]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Update to [Wazuh v4.3.0](https://github.com/wazuh/wazuh/blob/v4.3.0/CHANGELOG.md#v430)
|
||||||
|
|
||||||
|
## [v4.2.0]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Update to [Wazuh v4.2.0](https://github.com/wazuh/wazuh/blob/v4.2.0/CHANGELOG.md#v420)
|
||||||
|
|
||||||
## [v4.1.4]
|
## [v4.1.4]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@ -14,7 +14,10 @@ These playbooks install and configure Wazuh agent, manager and Elastic Stack.
|
|||||||
|
|
||||||
| Wazuh version | Elastic | ODFE |
|
| Wazuh version | Elastic | ODFE |
|
||||||
|---------------|---------|--------|
|
|---------------|---------|--------|
|
||||||
|
| v4.3.0 | 7.10.0 | 1.12.0 |
|
||||||
|
|---------------|---------|--------|
|
||||||
|
| v4.2.0 | 7.10.0 | 1.12.0 |
|
||||||
|
|---------------|---------|--------|
|
||||||
| v4.1.4 | 7.10.0 | 1.12.0 |
|
| v4.1.4 | 7.10.0 | 1.12.0 |
|
||||||
|---------------|---------|--------|
|
|---------------|---------|--------|
|
||||||
| v4.1.3 | 7.10.0 | 1.12.0 |
|
| v4.1.3 | 7.10.0 | 1.12.0 |
|
||||||
|
|||||||
@ -8,7 +8,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
|||||||
|
|
||||||
def get_wazuh_version():
|
def get_wazuh_version():
|
||||||
"""This return the version of Wazuh."""
|
"""This return the version of Wazuh."""
|
||||||
return "4.1.4"
|
return "4.3.0"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -47,8 +47,8 @@ def test_wazuh_services_are_running(host):
|
|||||||
@pytest.mark.parametrize("wazuh_file, wazuh_owner, wazuh_group, wazuh_mode", [
|
@pytest.mark.parametrize("wazuh_file, wazuh_owner, wazuh_group, wazuh_mode", [
|
||||||
("/var/ossec/etc/sslmanager.cert", "root", "root", 0o640),
|
("/var/ossec/etc/sslmanager.cert", "root", "root", 0o640),
|
||||||
("/var/ossec/etc/sslmanager.key", "root", "root", 0o640),
|
("/var/ossec/etc/sslmanager.key", "root", "root", 0o640),
|
||||||
("/var/ossec/etc/rules/local_rules.xml", "ossec", "ossec", 0o640),
|
("/var/ossec/etc/rules/local_rules.xml", "wazuh", "wazuh", 0o640),
|
||||||
("/var/ossec/etc/lists/audit-keys", "ossec", "ossec", 0o660),
|
("/var/ossec/etc/lists/audit-keys", "wazuh", "wazuh", 0o660),
|
||||||
])
|
])
|
||||||
def test_wazuh_files(host, wazuh_file, wazuh_owner, wazuh_group, wazuh_mode):
|
def test_wazuh_files(host, wazuh_file, wazuh_owner, wazuh_group, wazuh_mode):
|
||||||
"""Test Wazuh related files exist and have proper owners and mode."""
|
"""Test Wazuh related files exist and have proper owners and mode."""
|
||||||
|
|||||||
@ -18,11 +18,11 @@ elastic_stack_version: 7.10.2
|
|||||||
filebeat_version: 7.10.2
|
filebeat_version: 7.10.2
|
||||||
|
|
||||||
# Debian packages need the ${VERSION}-1
|
# Debian packages need the ${VERSION}-1
|
||||||
wazuh_manager_version: 4.1.4-1
|
wazuh_manager_version: 4.3.0-1
|
||||||
wazuh_agent_version: 4.1.4-1
|
wazuh_agent_version: 4.3.0-1
|
||||||
|
|
||||||
# Kibana role appends it automatically.
|
# Kibana role appends it automatically.
|
||||||
wazuh_version: 4.1.4
|
wazuh_version: 4.3.0
|
||||||
|
|
||||||
########################################################
|
########################################################
|
||||||
# General ELK stack variables
|
# General ELK stack variables
|
||||||
|
|||||||
@ -8,7 +8,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
|||||||
|
|
||||||
def get_wazuh_version():
|
def get_wazuh_version():
|
||||||
"""This return the version of Wazuh."""
|
"""This return the version of Wazuh."""
|
||||||
return "4.1.4"
|
return "4.3.0"
|
||||||
|
|
||||||
|
|
||||||
def test_wazuh_packages_are_installed(host):
|
def test_wazuh_packages_are_installed(host):
|
||||||
@ -46,8 +46,8 @@ def test_wazuh_services_are_running(host):
|
|||||||
@pytest.mark.parametrize("wazuh_file, wazuh_owner, wazuh_group, wazuh_mode", [
|
@pytest.mark.parametrize("wazuh_file, wazuh_owner, wazuh_group, wazuh_mode", [
|
||||||
("/var/ossec/etc/sslmanager.cert", "root", "root", 0o640),
|
("/var/ossec/etc/sslmanager.cert", "root", "root", 0o640),
|
||||||
("/var/ossec/etc/sslmanager.key", "root", "root", 0o640),
|
("/var/ossec/etc/sslmanager.key", "root", "root", 0o640),
|
||||||
("/var/ossec/etc/rules/local_rules.xml", "ossec", "ossec", 0o640),
|
("/var/ossec/etc/rules/local_rules.xml", "wazuh", "wazuh", 0o640),
|
||||||
("/var/ossec/etc/lists/audit-keys", "ossec", "ossec", 0o660),
|
("/var/ossec/etc/lists/audit-keys", "wazuh", "wazuh", 0o660),
|
||||||
])
|
])
|
||||||
def test_wazuh_files(host, wazuh_file, wazuh_owner, wazuh_group, wazuh_mode):
|
def test_wazuh_files(host, wazuh_file, wazuh_owner, wazuh_group, wazuh_mode):
|
||||||
"""Test Wazuh related files exist and have proper owners and mode."""
|
"""Test Wazuh related files exist and have proper owners and mode."""
|
||||||
|
|||||||
@ -16,9 +16,8 @@ elastic_stack_version: 7.10.2
|
|||||||
filebeat_version: 7.10.2
|
filebeat_version: 7.10.2
|
||||||
|
|
||||||
# Debian packages need the ${VERSION}-1
|
# Debian packages need the ${VERSION}-1
|
||||||
wazuh_manager_version: 4.1.4-1
|
wazuh_manager_version: 4.3.0-1
|
||||||
wazuh_agent_version: 4.1.4-1
|
wazuh_agent_version: 4.3.0-1
|
||||||
|
|
||||||
# Kibana role appends it automatically.
|
# Kibana role appends it automatically.
|
||||||
wazuh_version: 4.1.4
|
wazuh_version: 4.3.0
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
|||||||
|
|
||||||
def get_wazuh_version():
|
def get_wazuh_version():
|
||||||
"""This return the version of Wazuh."""
|
"""This return the version of Wazuh."""
|
||||||
return "4.1.4"
|
return "4.3.0"
|
||||||
|
|
||||||
|
|
||||||
def test_wazuh_packages_are_installed(host):
|
def test_wazuh_packages_are_installed(host):
|
||||||
@ -46,8 +46,8 @@ def test_wazuh_services_are_running(host):
|
|||||||
@pytest.mark.parametrize("wazuh_file, wazuh_owner, wazuh_group, wazuh_mode", [
|
@pytest.mark.parametrize("wazuh_file, wazuh_owner, wazuh_group, wazuh_mode", [
|
||||||
("/var/ossec/etc/sslmanager.cert", "root", "root", 0o640),
|
("/var/ossec/etc/sslmanager.cert", "root", "root", 0o640),
|
||||||
("/var/ossec/etc/sslmanager.key", "root", "root", 0o640),
|
("/var/ossec/etc/sslmanager.key", "root", "root", 0o640),
|
||||||
("/var/ossec/etc/rules/local_rules.xml", "ossec", "ossec", 0o640),
|
("/var/ossec/etc/rules/local_rules.xml", "wazuh", "wazuh", 0o640),
|
||||||
("/var/ossec/etc/lists/audit-keys", "ossec", "ossec", 0o660),
|
("/var/ossec/etc/lists/audit-keys", "wazuh", "wazuh", 0o660),
|
||||||
])
|
])
|
||||||
def test_wazuh_files(host, wazuh_file, wazuh_owner, wazuh_group, wazuh_mode):
|
def test_wazuh_files(host, wazuh_file, wazuh_owner, wazuh_group, wazuh_mode):
|
||||||
"""Test Wazuh related files exist and have proper owners and mode."""
|
"""Test Wazuh related files exist and have proper owners and mode."""
|
||||||
|
|||||||
@ -40,8 +40,8 @@ filebeat_version: 7.10.0
|
|||||||
kibana_opendistro_version: 1.12.0-1
|
kibana_opendistro_version: 1.12.0-1
|
||||||
|
|
||||||
# Debian packages need the ${VERSION}-1
|
# Debian packages need the ${VERSION}-1
|
||||||
wazuh_manager_version: 4.1.4-1
|
wazuh_manager_version: 4.3.0-1
|
||||||
wazuh_agent_version: 4.1.4-1
|
wazuh_agent_version: 4.3.0-1
|
||||||
|
|
||||||
# Kibana role appends it automatically.
|
# Kibana role appends it automatically.
|
||||||
wazuh_version: 4.1.4
|
wazuh_version: 4.3.0
|
||||||
|
|||||||
@ -8,7 +8,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
|||||||
|
|
||||||
def get_wazuh_version():
|
def get_wazuh_version():
|
||||||
"""This return the version of Wazuh."""
|
"""This return the version of Wazuh."""
|
||||||
return "4.1.4"
|
return "4.3.0"
|
||||||
|
|
||||||
|
|
||||||
def test_wazuh_packages_are_installed(host):
|
def test_wazuh_packages_are_installed(host):
|
||||||
@ -46,8 +46,8 @@ def test_wazuh_services_are_running(host):
|
|||||||
@pytest.mark.parametrize("wazuh_file, wazuh_owner, wazuh_group, wazuh_mode", [
|
@pytest.mark.parametrize("wazuh_file, wazuh_owner, wazuh_group, wazuh_mode", [
|
||||||
("/var/ossec/etc/sslmanager.cert", "root", "root", 0o640),
|
("/var/ossec/etc/sslmanager.cert", "root", "root", 0o640),
|
||||||
("/var/ossec/etc/sslmanager.key", "root", "root", 0o640),
|
("/var/ossec/etc/sslmanager.key", "root", "root", 0o640),
|
||||||
("/var/ossec/etc/rules/local_rules.xml", "ossec", "ossec", 0o640),
|
("/var/ossec/etc/rules/local_rules.xml", "wazuh", "wazuh", 0o640),
|
||||||
("/var/ossec/etc/lists/audit-keys", "ossec", "ossec", 0o660),
|
("/var/ossec/etc/lists/audit-keys", "wazuh", "wazuh", 0o660),
|
||||||
])
|
])
|
||||||
def test_wazuh_files(host, wazuh_file, wazuh_owner, wazuh_group, wazuh_mode):
|
def test_wazuh_files(host, wazuh_file, wazuh_owner, wazuh_group, wazuh_mode):
|
||||||
"""Test Wazuh related files exist and have proper owners and mode."""
|
"""Test Wazuh related files exist and have proper owners and mode."""
|
||||||
|
|||||||
@ -3,4 +3,5 @@
|
|||||||
roles:
|
roles:
|
||||||
- role: ../roles/elastic-stack/ansible-kibana
|
- role: ../roles/elastic-stack/ansible-kibana
|
||||||
elasticsearch_network_host: <YOUR_ELASTICSEARCH_IP>
|
elasticsearch_network_host: <YOUR_ELASTICSEARCH_IP>
|
||||||
|
vars:
|
||||||
|
ansible_shell_allow_world_readable_temp: true
|
||||||
|
|||||||
@ -186,3 +186,4 @@
|
|||||||
node6:
|
node6:
|
||||||
name: node-6
|
name: node-6
|
||||||
ip: "{{ hostvars.kibana.private_ip }}"
|
ip: "{{ hostvars.kibana.private_ip }}"
|
||||||
|
ansible_shell_allow_world_readable_temp: true
|
||||||
|
|||||||
@ -18,4 +18,5 @@
|
|||||||
instances:
|
instances:
|
||||||
node1:
|
node1:
|
||||||
name: node-1 # Important: must be equal to elasticsearch_node_name.
|
name: node-1 # Important: must be equal to elasticsearch_node_name.
|
||||||
ip: <your server host>
|
ip: <your server host>
|
||||||
|
ansible_shell_allow_world_readable_temp: true
|
||||||
@ -2,3 +2,5 @@
|
|||||||
- hosts: es1
|
- hosts: es1
|
||||||
roles:
|
roles:
|
||||||
- role: ../roles/opendistro/opendistro-kibana
|
- role: ../roles/opendistro/opendistro-kibana
|
||||||
|
vars:
|
||||||
|
ansible_shell_allow_world_readable_temp: true
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "wazuh-ansible"
|
name = "wazuh-ansible"
|
||||||
version = "4.1.4"
|
version = "4.3.0"
|
||||||
description = ""
|
description = ""
|
||||||
authors = ["neonmei <neonmei@pm.me>"]
|
authors = ["neonmei <neonmei@pm.me>"]
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ kibana_server_host: "0.0.0.0"
|
|||||||
kibana_server_port: "5601"
|
kibana_server_port: "5601"
|
||||||
kibana_conf_path: /etc/kibana
|
kibana_conf_path: /etc/kibana
|
||||||
elastic_stack_version: 7.10.2
|
elastic_stack_version: 7.10.2
|
||||||
wazuh_version: 4.1.4
|
wazuh_version: 4.3.0
|
||||||
wazuh_app_url: https://packages.wazuh.com/4.x/ui/kibana/wazuh_kibana
|
wazuh_app_url: https://packages.wazuh.com/4.x/ui/kibana/wazuh_kibana
|
||||||
|
|
||||||
elasticrepo:
|
elasticrepo:
|
||||||
|
|||||||
@ -32,6 +32,12 @@ package_repos:
|
|||||||
opendistro:
|
opendistro:
|
||||||
baseurl: 'https://packages.wazuh.com/4.x/yum/'
|
baseurl: 'https://packages.wazuh.com/4.x/yum/'
|
||||||
gpg: 'https://packages.wazuh.com/key/GPG-KEY-WAZUH'
|
gpg: 'https://packages.wazuh.com/key/GPG-KEY-WAZUH'
|
||||||
|
apt:
|
||||||
|
opendistro:
|
||||||
|
baseurl: 'deb https://packages.wazuh.com/4.x/apt/ stable main'
|
||||||
|
gpg: 'https://packages.wazuh.com/key/GPG-KEY-WAZUH'
|
||||||
|
openjdk:
|
||||||
|
baseurl: 'deb http://deb.debian.org/debian stretch-backports main'
|
||||||
|
|
||||||
opendistro_sec_plugin_conf_path: /usr/share/elasticsearch/plugins/opendistro_security/securityconfig
|
opendistro_sec_plugin_conf_path: /usr/share/elasticsearch/plugins/opendistro_security/securityconfig
|
||||||
opendistro_sec_plugin_tools_path: /usr/share/elasticsearch/plugins/opendistro_security/tools
|
opendistro_sec_plugin_tools_path: /usr/share/elasticsearch/plugins/opendistro_security/tools
|
||||||
|
|||||||
43
roles/opendistro/opendistro-elasticsearch/tasks/Debian.yml
Normal file
43
roles/opendistro/opendistro-elasticsearch/tasks/Debian.yml
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
#- name: Install OpenDistro dependencies
|
||||||
|
# apt:
|
||||||
|
# name: [
|
||||||
|
# 'unzip', 'wget', 'curl',
|
||||||
|
# 'apt-transport-https', software-properties-common
|
||||||
|
# ]
|
||||||
|
# state: present
|
||||||
|
|
||||||
|
- name: Add openjdk repository
|
||||||
|
apt_repository:
|
||||||
|
repo: "{{ package_repos.apt.openjdk.baseurl }}"
|
||||||
|
state: present
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: Install openjdk-11-jdk
|
||||||
|
apt:
|
||||||
|
name: openjdk-11-jdk
|
||||||
|
state: present
|
||||||
|
environment:
|
||||||
|
JAVA_HOME: /usr
|
||||||
|
|
||||||
|
- name: Add Opendistro repository
|
||||||
|
block:
|
||||||
|
- name: Add apt repository signing key
|
||||||
|
apt_key:
|
||||||
|
url: "{{ package_repos.apt.opendistro.gpg }}"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Add Opendistro repository
|
||||||
|
apt_repository:
|
||||||
|
repo: "{{ package_repos.apt.opendistro.baseurl }}"
|
||||||
|
state: present
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: Install OpenDistro
|
||||||
|
apt:
|
||||||
|
name: opendistroforelasticsearch={{ opendistro_version }}-1
|
||||||
|
state: present
|
||||||
|
register: install
|
||||||
|
tags: install
|
||||||
@ -39,5 +39,12 @@
|
|||||||
- wget
|
- wget
|
||||||
- unzip
|
- unzip
|
||||||
|
|
||||||
|
- name: Install OpenDistro
|
||||||
|
package:
|
||||||
|
name: opendistroforelasticsearch-{{ opendistro_version }}
|
||||||
|
state: present
|
||||||
|
register: install
|
||||||
|
tags: install
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
- install
|
- install
|
||||||
|
|||||||
@ -8,18 +8,13 @@
|
|||||||
- import_tasks: RedHat.yml
|
- import_tasks: RedHat.yml
|
||||||
when: ansible_os_family == 'RedHat'
|
when: ansible_os_family == 'RedHat'
|
||||||
|
|
||||||
- name: Install OpenDistro
|
- import_tasks: Debian.yml
|
||||||
package:
|
when: ansible_os_family == 'Debian'
|
||||||
name: opendistroforelasticsearch-{{ opendistro_version }}
|
|
||||||
state: present
|
|
||||||
register: install
|
|
||||||
tags: install
|
|
||||||
|
|
||||||
- name: Remove elasticsearch configuration file
|
- name: Remove elasticsearch configuration file
|
||||||
file:
|
file:
|
||||||
path: "{{ opendistro_conf_path }}/elasticsearch.yml"
|
path: "{{ opendistro_conf_path }}/elasticsearch.yml"
|
||||||
state: absent
|
state: absent
|
||||||
when: install.changed
|
|
||||||
tags: install
|
tags: install
|
||||||
|
|
||||||
- name: Copy Configuration File
|
- name: Copy Configuration File
|
||||||
@ -30,13 +25,12 @@
|
|||||||
group: elasticsearch
|
group: elasticsearch
|
||||||
mode: 0640
|
mode: 0640
|
||||||
marker: "## {mark} Opendistro general settings ##"
|
marker: "## {mark} Opendistro general settings ##"
|
||||||
when: install.changed
|
|
||||||
tags: install
|
tags: install
|
||||||
|
|
||||||
- include_tasks: security_actions.yml
|
- include_tasks: security_actions.yml
|
||||||
tags:
|
tags:
|
||||||
- security
|
- security
|
||||||
when: install.changed
|
|
||||||
|
|
||||||
- name: Configure OpenDistro Elasticsearch JVM memmory.
|
- name: Configure OpenDistro Elasticsearch JVM memmory.
|
||||||
template:
|
template:
|
||||||
|
|||||||
@ -10,7 +10,7 @@ kibana_server_port: "5601"
|
|||||||
kibana_server_name: "kibana"
|
kibana_server_name: "kibana"
|
||||||
kibana_max_payload_bytes: 1048576
|
kibana_max_payload_bytes: 1048576
|
||||||
elastic_stack_version: 7.10.0
|
elastic_stack_version: 7.10.0
|
||||||
wazuh_version: 4.1.4
|
wazuh_version: 4.3.0
|
||||||
wazuh_app_url: https://packages.wazuh.com/4.x/ui/kibana/wazuh_kibana
|
wazuh_app_url: https://packages.wazuh.com/4.x/ui/kibana/wazuh_kibana
|
||||||
|
|
||||||
# The OpenDistro package repository
|
# The OpenDistro package repository
|
||||||
@ -21,7 +21,10 @@ package_repos:
|
|||||||
opendistro:
|
opendistro:
|
||||||
baseurl: 'https://packages.wazuh.com/4.x/yum/'
|
baseurl: 'https://packages.wazuh.com/4.x/yum/'
|
||||||
gpg: 'https://packages.wazuh.com/key/GPG-KEY-WAZUH'
|
gpg: 'https://packages.wazuh.com/key/GPG-KEY-WAZUH'
|
||||||
|
apt:
|
||||||
|
opendistro:
|
||||||
|
baseurl: 'deb https://packages.wazuh.com/4.x/apt/ stable main'
|
||||||
|
gpg: 'https://packages.wazuh.com/key/GPG-KEY-WAZUH'
|
||||||
|
|
||||||
# API credentials
|
# API credentials
|
||||||
wazuh_api_credentials:
|
wazuh_api_credentials:
|
||||||
@ -38,7 +41,7 @@ kibana_telemetry_optin: "false"
|
|||||||
kibana_telemetry_enabled: "false"
|
kibana_telemetry_enabled: "false"
|
||||||
|
|
||||||
opendistro_admin_password: changeme
|
opendistro_admin_password: changeme
|
||||||
opendistro_kibana_user: admin
|
opendistro_kibana_user: changeme
|
||||||
opendistro_kibana_password: changeme
|
opendistro_kibana_password: changeme
|
||||||
local_certs_path: "{{ playbook_dir }}/opendistro/certificates"
|
local_certs_path: "{{ playbook_dir }}/opendistro/certificates"
|
||||||
|
|
||||||
|
|||||||
23
roles/opendistro/opendistro-kibana/tasks/Debian.yml
Normal file
23
roles/opendistro/opendistro-kibana/tasks/Debian.yml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
- block:
|
||||||
|
|
||||||
|
- include_vars: debian.yml
|
||||||
|
- name: Add apt repository signing key
|
||||||
|
apt_key:
|
||||||
|
url: "{{ package_repos.apt.opendistro.gpg }}"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Debian systems | Add OpenDistro repo
|
||||||
|
apt_repository:
|
||||||
|
repo: "{{ package_repos.apt.opendistro.baseurl }}"
|
||||||
|
state: present
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: Install Kibana
|
||||||
|
apt:
|
||||||
|
name: "opendistroforelasticsearch-kibana={{ kibana_opendistro_version }}"
|
||||||
|
state: present
|
||||||
|
register: install
|
||||||
|
|
||||||
|
tags:
|
||||||
|
- install
|
||||||
@ -10,5 +10,11 @@
|
|||||||
gpgkey: "{{ package_repos.yum.opendistro.gpg }}"
|
gpgkey: "{{ package_repos.yum.opendistro.gpg }}"
|
||||||
gpgcheck: true
|
gpgcheck: true
|
||||||
|
|
||||||
|
- name: Install Kibana
|
||||||
|
package:
|
||||||
|
name: "opendistroforelasticsearch-kibana-{{ kibana_opendistro_version }}"
|
||||||
|
state: present
|
||||||
|
register: install
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
- install
|
- install
|
||||||
|
|||||||
@ -11,12 +11,8 @@
|
|||||||
- import_tasks: RedHat.yml
|
- import_tasks: RedHat.yml
|
||||||
when: ansible_os_family == 'RedHat'
|
when: ansible_os_family == 'RedHat'
|
||||||
|
|
||||||
- name: Install Kibana
|
- import_tasks: Debian.yml
|
||||||
package:
|
when: ansible_os_family == 'Debian'
|
||||||
name: "opendistroforelasticsearch-kibana-{{ kibana_opendistro_version }}"
|
|
||||||
state: present
|
|
||||||
register: install
|
|
||||||
tags: install
|
|
||||||
|
|
||||||
- name: Remove Kibana configuration file
|
- name: Remove Kibana configuration file
|
||||||
file:
|
file:
|
||||||
|
|||||||
3
roles/opendistro/opendistro-kibana/vars/debian.yml
Normal file
3
roles/opendistro/opendistro-kibana/vars/debian.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
kibana_opendistro_version: 1.12.0
|
||||||
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
filebeat_version: 7.10.0
|
filebeat_version: 7.10.0
|
||||||
|
|
||||||
wazuh_template_branch: v4.1.4
|
wazuh_template_branch: v4.3.0
|
||||||
|
|
||||||
filebeat_output_elasticsearch_hosts:
|
filebeat_output_elasticsearch_hosts:
|
||||||
- "localhost:9200"
|
- "localhost:9200"
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
filebeat_version: 7.10.2
|
filebeat_version: 7.10.2
|
||||||
|
|
||||||
wazuh_template_branch: v4.1.4
|
wazuh_template_branch: v4.3.0
|
||||||
|
|
||||||
|
|
||||||
filebeat_create_config: true
|
filebeat_create_config: true
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
wazuh_agent_version: 4.1.4-1
|
wazuh_agent_version: 4.3.0-1
|
||||||
|
|
||||||
|
|
||||||
# Custom packages installation
|
# Custom packages installation
|
||||||
|
|
||||||
@ -13,7 +12,7 @@ wazuh_custom_packages_installation_agent_rpm_url: ""
|
|||||||
|
|
||||||
wazuh_agent_sources_installation:
|
wazuh_agent_sources_installation:
|
||||||
enabled: false
|
enabled: false
|
||||||
branch: "v4.1.4"
|
branch: "v4.3.0"
|
||||||
user_language: "y"
|
user_language: "y"
|
||||||
user_no_stop: "y"
|
user_no_stop: "y"
|
||||||
user_install_type: "agent"
|
user_install_type: "agent"
|
||||||
@ -56,8 +55,8 @@ wazuh_winagent_config:
|
|||||||
auth_path_x86: C:\'Program Files (x86)'\ossec-agent\agent-auth.exe
|
auth_path_x86: C:\'Program Files (x86)'\ossec-agent\agent-auth.exe
|
||||||
check_md5: True
|
check_md5: True
|
||||||
md5: 8ffa75d13280f1aa6ffca54f4273df4d
|
md5: 8ffa75d13280f1aa6ffca54f4273df4d
|
||||||
wazuh_winagent_config_url: https://packages.wazuh.com/4.x/windows/wazuh-agent-4.1.4-1.msi
|
wazuh_winagent_config_url: https://packages.wazuh.com/4.x/windows/wazuh-agent-4.3.0-1.msi
|
||||||
wazuh_winagent_package_name: wazuh-agent-4.1.4-1.msi
|
wazuh_winagent_package_name: wazuh-agent-4.3.0-1.msi
|
||||||
|
|
||||||
wazuh_dir: "/var/ossec"
|
wazuh_dir: "/var/ossec"
|
||||||
|
|
||||||
|
|||||||
@ -3,4 +3,4 @@
|
|||||||
service: name=wazuh-agent state=restarted enabled=yes
|
service: name=wazuh-agent state=restarted enabled=yes
|
||||||
|
|
||||||
- name: Windows | Restart Wazuh Agent
|
- name: Windows | Restart Wazuh Agent
|
||||||
win_service: name=OssecSvc start_mode=auto state=restarted
|
win_service: name=WazuhSvc start_mode=auto state=restarted
|
||||||
|
|||||||
@ -223,7 +223,7 @@
|
|||||||
src: var-ossec-etc-ossec-agent.conf.j2
|
src: var-ossec-etc-ossec-agent.conf.j2
|
||||||
dest: "{{ wazuh_dir }}/etc/ossec.conf"
|
dest: "{{ wazuh_dir }}/etc/ossec.conf"
|
||||||
owner: root
|
owner: root
|
||||||
group: ossec
|
group: wazuh
|
||||||
mode: 0644
|
mode: 0644
|
||||||
notify: restart wazuh-agent
|
notify: restart wazuh-agent
|
||||||
tags:
|
tags:
|
||||||
@ -235,7 +235,7 @@
|
|||||||
src: var-ossec-etc-local-internal-options.conf.j2
|
src: var-ossec-etc-local-internal-options.conf.j2
|
||||||
dest: "{{ wazuh_dir }}/etc/local_internal_options.conf"
|
dest: "{{ wazuh_dir }}/etc/local_internal_options.conf"
|
||||||
owner: root
|
owner: root
|
||||||
group: ossec
|
group: wazuh
|
||||||
mode: 0640
|
mode: 0640
|
||||||
notify: restart wazuh-agent
|
notify: restart wazuh-agent
|
||||||
tags:
|
tags:
|
||||||
@ -246,8 +246,8 @@
|
|||||||
template:
|
template:
|
||||||
src: authd_pass.j2
|
src: authd_pass.j2
|
||||||
dest: "{{ wazuh_dir }}/etc/authd.pass"
|
dest: "{{ wazuh_dir }}/etc/authd.pass"
|
||||||
owner: ossec
|
owner: wazuh
|
||||||
group: ossec
|
group: wazuh
|
||||||
mode: 0640
|
mode: 0640
|
||||||
when:
|
when:
|
||||||
- wazuh_agent_config.enrollment.enabled == 'yes'
|
- wazuh_agent_config.enrollment.enabled == 'yes'
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
wazuh_manager_version: 4.1.4-1
|
wazuh_manager_version: 4.3.0-1
|
||||||
|
|
||||||
wazuh_manager_fqdn: "wazuh-server"
|
wazuh_manager_fqdn: "wazuh-server"
|
||||||
wazuh_manager_package_state: present
|
wazuh_manager_package_state: present
|
||||||
@ -13,7 +13,7 @@ wazuh_custom_packages_installation_manager_rpm_url: "https://s3-us-west-1.amazon
|
|||||||
# Sources installation
|
# Sources installation
|
||||||
wazuh_manager_sources_installation:
|
wazuh_manager_sources_installation:
|
||||||
enabled: false
|
enabled: false
|
||||||
branch: "v4.1.4"
|
branch: "v4.3.0"
|
||||||
user_language: "en"
|
user_language: "en"
|
||||||
user_no_stop: "y"
|
user_no_stop: "y"
|
||||||
user_install_type: "server"
|
user_install_type: "server"
|
||||||
@ -62,7 +62,7 @@ wazuh_manager_mailto:
|
|||||||
- 'admin@example.net'
|
- 'admin@example.net'
|
||||||
|
|
||||||
wazuh_manager_email_smtp_server: smtp.example.wazuh.com
|
wazuh_manager_email_smtp_server: smtp.example.wazuh.com
|
||||||
wazuh_manager_email_from: ossecm@example.wazuh.com
|
wazuh_manager_email_from: wazuh@example.wazuh.com
|
||||||
wazuh_manager_email_maxperhour: 12
|
wazuh_manager_email_maxperhour: 12
|
||||||
wazuh_manager_email_queue_size: 131072
|
wazuh_manager_email_queue_size: 131072
|
||||||
wazuh_manager_email_log_source: 'alerts.log'
|
wazuh_manager_email_log_source: 'alerts.log'
|
||||||
@ -260,7 +260,7 @@ wazuh_manager_commands:
|
|||||||
executable: 'restart-ossec.sh'
|
executable: 'restart-ossec.sh'
|
||||||
expect: ''
|
expect: ''
|
||||||
- name: 'firewall-drop'
|
- name: 'firewall-drop'
|
||||||
executable: 'firewall-drop.sh'
|
executable: 'firewall-drop'
|
||||||
expect: 'srcip'
|
expect: 'srcip'
|
||||||
timeout_allowed: 'yes'
|
timeout_allowed: 'yes'
|
||||||
- name: 'host-deny'
|
- name: 'host-deny'
|
||||||
|
|||||||
@ -97,6 +97,12 @@
|
|||||||
tags:
|
tags:
|
||||||
- config
|
- config
|
||||||
|
|
||||||
|
- name: Install dependencies to build from sources
|
||||||
|
apt:
|
||||||
|
name: ['make', 'gcc', 'automake', 'autoconf', 'libtool', 'tar', 'libssl-dev', 'g++']
|
||||||
|
state: present
|
||||||
|
when: wazuh_manager_sources_installation.enabled
|
||||||
|
|
||||||
- name: Debian/Ubuntu | Install wazuh-manager
|
- name: Debian/Ubuntu | Install wazuh-manager
|
||||||
apt:
|
apt:
|
||||||
name:
|
name:
|
||||||
|
|||||||
@ -92,6 +92,12 @@
|
|||||||
when:
|
when:
|
||||||
- ansible_distribution == "Amazon" and ansible_distribution_major_version == "NA"
|
- ansible_distribution == "Amazon" and ansible_distribution_major_version == "NA"
|
||||||
|
|
||||||
|
- name: Install dependencies to build from sources
|
||||||
|
yum:
|
||||||
|
name: ['make', 'gcc', 'automake', 'autoconf', 'libtool', 'tar', 'openssl-devel', 'gcc-c++']
|
||||||
|
state: present
|
||||||
|
when: wazuh_manager_sources_installation.enabled
|
||||||
|
|
||||||
- name: CentOS/RedHat/Amazon | Install wazuh-manager
|
- name: CentOS/RedHat/Amazon | Install wazuh-manager
|
||||||
package:
|
package:
|
||||||
name: "wazuh-manager-{{ wazuh_manager_version }}"
|
name: "wazuh-manager-{{ wazuh_manager_version }}"
|
||||||
|
|||||||
40
roles/wazuh/ansible-wazuh-manager/tasks/install_cmake.yml
Normal file
40
roles/wazuh/ansible-wazuh-manager/tasks/install_cmake.yml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
# Vars
|
||||||
|
# cmake_download_url: http://packages.wazuh.com/utils/cmake/cmake-3.18.3.tar.gz
|
||||||
|
# cmake_version: 3.18.3
|
||||||
|
#
|
||||||
|
- name: Include CMake install vars
|
||||||
|
include_vars: install_cmake.yml
|
||||||
|
|
||||||
|
- name: Download CMake sources
|
||||||
|
get_url:
|
||||||
|
url: "{{ cmake_download_url }}"
|
||||||
|
dest: "/tmp/cmake-{{ cmake_version }}.tar.gz"
|
||||||
|
register: cmake_download
|
||||||
|
|
||||||
|
- name: Unpack CMake
|
||||||
|
unarchive:
|
||||||
|
copy: no
|
||||||
|
dest: /tmp/
|
||||||
|
src: "{{ cmake_download.dest }}"
|
||||||
|
when: cmake_download.changed
|
||||||
|
register: cmake_unpack
|
||||||
|
|
||||||
|
- name: Configure CMake
|
||||||
|
command: "./bootstrap"
|
||||||
|
args:
|
||||||
|
chdir: "/tmp/cmake-{{ cmake_version }}"
|
||||||
|
when: cmake_unpack.changed
|
||||||
|
register: cmake_configure
|
||||||
|
|
||||||
|
- name: Install CMake
|
||||||
|
shell: make && make install
|
||||||
|
args:
|
||||||
|
chdir: "/tmp/cmake-{{ cmake_version }}"
|
||||||
|
when: cmake_configure.changed
|
||||||
|
|
||||||
|
- name: Delete installation files
|
||||||
|
file:
|
||||||
|
state: absent
|
||||||
|
path: "/tmp/cmake-{{ cmake_version }}"
|
||||||
@ -2,8 +2,8 @@
|
|||||||
# Wazuh Manager
|
# Wazuh Manager
|
||||||
- name: Check if Wazuh Manager is already installed
|
- name: Check if Wazuh Manager is already installed
|
||||||
stat:
|
stat:
|
||||||
path: "{{ wazuh_dir }}/bin/ossec-control"
|
path: "{{ wazuh_dir }}/bin/wazuh-control"
|
||||||
register: wazuh_ossec_control
|
register: wazuh_control_path
|
||||||
|
|
||||||
- name: Installing Wazuh Manager from sources
|
- name: Installing Wazuh Manager from sources
|
||||||
block:
|
block:
|
||||||
@ -18,6 +18,9 @@
|
|||||||
- tar
|
- tar
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
- name: Install CMake
|
||||||
|
include_tasks: install_cmake.yml
|
||||||
|
|
||||||
- name: Removing old files
|
- name: Removing old files
|
||||||
file:
|
file:
|
||||||
path: "/tmp/{{ wazuh_manager_sources_installation.branch }}.tar.gz"
|
path: "/tmp/{{ wazuh_manager_sources_installation.branch }}.tar.gz"
|
||||||
@ -102,6 +105,8 @@
|
|||||||
changed_when: installation_result == 0
|
changed_when: installation_result == 0
|
||||||
args:
|
args:
|
||||||
chdir: "/tmp/wazuh-{{ wazuh_manager_sources_installation.branch }}"
|
chdir: "/tmp/wazuh-{{ wazuh_manager_sources_installation.branch }}"
|
||||||
|
environment:
|
||||||
|
PATH: /usr/local/bin:{{ ansible_env.PATH }}
|
||||||
|
|
||||||
- name: Cleanup downloaded files
|
- name: Cleanup downloaded files
|
||||||
file:
|
file:
|
||||||
@ -114,7 +119,7 @@
|
|||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
when:
|
when:
|
||||||
- not wazuh_ossec_control.stat.exists
|
- not wazuh_control_path.stat.exists
|
||||||
- wazuh_manager_sources_installation.enabled
|
- wazuh_manager_sources_installation.enabled
|
||||||
tags:
|
tags:
|
||||||
- manager
|
- manager
|
||||||
|
|||||||
@ -81,8 +81,8 @@
|
|||||||
- name: Installing the local_rules.xml (default local_rules.xml)
|
- name: Installing the local_rules.xml (default local_rules.xml)
|
||||||
template: src=var-ossec-rules-local_rules.xml.j2
|
template: src=var-ossec-rules-local_rules.xml.j2
|
||||||
dest="{{ wazuh_dir }}/etc/rules/local_rules.xml"
|
dest="{{ wazuh_dir }}/etc/rules/local_rules.xml"
|
||||||
owner=ossec
|
owner=wazuh
|
||||||
group=ossec
|
group=wazuh
|
||||||
mode=0640
|
mode=0640
|
||||||
notify: restart wazuh-manager
|
notify: restart wazuh-manager
|
||||||
tags:
|
tags:
|
||||||
@ -93,8 +93,8 @@
|
|||||||
- name: Adding local rules files
|
- name: Adding local rules files
|
||||||
copy: src="{{ wazuh_manager_config.ruleset.rules_path }}"
|
copy: src="{{ wazuh_manager_config.ruleset.rules_path }}"
|
||||||
dest="{{ wazuh_dir }}/etc/rules/"
|
dest="{{ wazuh_dir }}/etc/rules/"
|
||||||
owner=ossec
|
owner=wazuh
|
||||||
group=ossec
|
group=wazuh
|
||||||
mode=0640
|
mode=0640
|
||||||
notify: restart wazuh-manager
|
notify: restart wazuh-manager
|
||||||
tags:
|
tags:
|
||||||
@ -105,8 +105,8 @@
|
|||||||
- name: Installing the local_decoder.xml
|
- name: Installing the local_decoder.xml
|
||||||
template: src=var-ossec-rules-local_decoder.xml.j2
|
template: src=var-ossec-rules-local_decoder.xml.j2
|
||||||
dest="{{ wazuh_dir }}/etc/decoders/local_decoder.xml"
|
dest="{{ wazuh_dir }}/etc/decoders/local_decoder.xml"
|
||||||
owner=ossec
|
owner=wazuh
|
||||||
group=ossec
|
group=wazuh
|
||||||
mode=0640
|
mode=0640
|
||||||
notify: restart wazuh-manager
|
notify: restart wazuh-manager
|
||||||
tags:
|
tags:
|
||||||
@ -117,8 +117,8 @@
|
|||||||
- name: Adding local decoders files
|
- name: Adding local decoders files
|
||||||
copy: src="{{ wazuh_manager_config.ruleset.decoders_path }}"
|
copy: src="{{ wazuh_manager_config.ruleset.decoders_path }}"
|
||||||
dest="{{ wazuh_dir }}/etc/decoders/"
|
dest="{{ wazuh_dir }}/etc/decoders/"
|
||||||
owner=ossec
|
owner=wazuh
|
||||||
group=ossec
|
group=wazuh
|
||||||
mode=0640
|
mode=0640
|
||||||
notify: restart wazuh-manager
|
notify: restart wazuh-manager
|
||||||
tags:
|
tags:
|
||||||
@ -130,8 +130,8 @@
|
|||||||
template:
|
template:
|
||||||
src: var-ossec-etc-shared-agent.conf.j2
|
src: var-ossec-etc-shared-agent.conf.j2
|
||||||
dest: "{{ wazuh_dir }}/etc/shared/default/agent.conf"
|
dest: "{{ wazuh_dir }}/etc/shared/default/agent.conf"
|
||||||
owner: ossec
|
owner: wazuh
|
||||||
group: ossec
|
group: wazuh
|
||||||
mode: 0640
|
mode: 0640
|
||||||
validate: "{{ wazuh_dir }}/bin/verify-agent-conf -f %s"
|
validate: "{{ wazuh_dir }}/bin/verify-agent-conf -f %s"
|
||||||
notify: restart wazuh-manager
|
notify: restart wazuh-manager
|
||||||
@ -141,24 +141,11 @@
|
|||||||
when:
|
when:
|
||||||
- shared_agent_config is defined
|
- shared_agent_config is defined
|
||||||
|
|
||||||
- name: Installing the api.yaml (api configuration)
|
|
||||||
template: src=api.yaml.j2
|
|
||||||
dest="{{ wazuh_dir }}/api/configuration/api.yaml"
|
|
||||||
owner=root
|
|
||||||
group=ossec
|
|
||||||
mode=0640
|
|
||||||
notify: restart wazuh-manager
|
|
||||||
when:
|
|
||||||
- wazuh_manager_config.cluster.node_type == "master"
|
|
||||||
tags:
|
|
||||||
- init
|
|
||||||
- config
|
|
||||||
|
|
||||||
- name: Installing the local_internal_options.conf
|
- name: Installing the local_internal_options.conf
|
||||||
template: src=var-ossec-etc-local-internal-options.conf.j2
|
template: src=var-ossec-etc-local-internal-options.conf.j2
|
||||||
dest="{{ wazuh_dir }}/etc/local_internal_options.conf"
|
dest="{{ wazuh_dir }}/etc/local_internal_options.conf"
|
||||||
owner=root
|
owner=root
|
||||||
group=ossec
|
group=wazuh
|
||||||
mode=0640
|
mode=0640
|
||||||
notify: restart wazuh-manager
|
notify: restart wazuh-manager
|
||||||
tags:
|
tags:
|
||||||
@ -197,7 +184,7 @@
|
|||||||
- config
|
- config
|
||||||
|
|
||||||
- name: Enable client-syslog
|
- name: Enable client-syslog
|
||||||
command: "{{ wazuh_dir }}/bin/ossec-control enable client-syslog"
|
command: "{{ wazuh_dir }}/bin/wazuh-control enable client-syslog"
|
||||||
notify: restart wazuh-manager
|
notify: restart wazuh-manager
|
||||||
when:
|
when:
|
||||||
- csyslog_enabled.stdout == '0' or "skipped" in csyslog_enabled.stdout
|
- csyslog_enabled.stdout == '0' or "skipped" in csyslog_enabled.stdout
|
||||||
@ -219,7 +206,7 @@
|
|||||||
- config
|
- config
|
||||||
|
|
||||||
- name: Enable ossec-agentlessd
|
- name: Enable ossec-agentlessd
|
||||||
command: "{{ wazuh_dir }}/bin/ossec-control enable agentless"
|
command: "{{ wazuh_dir }}/bin/wazuh-control enable agentless"
|
||||||
notify: restart wazuh-manager
|
notify: restart wazuh-manager
|
||||||
when:
|
when:
|
||||||
- agentlessd_enabled.stdout == '0' or "skipped" in agentlessd_enabled.stdout
|
- agentlessd_enabled.stdout == '0' or "skipped" in agentlessd_enabled.stdout
|
||||||
@ -241,7 +228,7 @@
|
|||||||
src: var-ossec-etc-ossec-server.conf.j2
|
src: var-ossec-etc-ossec-server.conf.j2
|
||||||
dest: "{{ wazuh_dir }}/etc/ossec.conf"
|
dest: "{{ wazuh_dir }}/etc/ossec.conf"
|
||||||
owner: root
|
owner: root
|
||||||
group: ossec
|
group: wazuh
|
||||||
mode: 0644
|
mode: 0644
|
||||||
notify: restart wazuh-manager
|
notify: restart wazuh-manager
|
||||||
tags:
|
tags:
|
||||||
@ -252,8 +239,8 @@
|
|||||||
template:
|
template:
|
||||||
src: authd_pass.j2
|
src: authd_pass.j2
|
||||||
dest: "{{ wazuh_dir }}/etc/authd.pass"
|
dest: "{{ wazuh_dir }}/etc/authd.pass"
|
||||||
owner: ossec
|
owner: wazuh
|
||||||
group: ossec
|
group: wazuh
|
||||||
mode: 0640
|
mode: 0640
|
||||||
no_log: true
|
no_log: true
|
||||||
notify: restart wazuh-manager
|
notify: restart wazuh-manager
|
||||||
@ -270,7 +257,7 @@
|
|||||||
src: create_user.py
|
src: create_user.py
|
||||||
dest: "{{ wazuh_dir }}/framework/scripts/create_user.py"
|
dest: "{{ wazuh_dir }}/framework/scripts/create_user.py"
|
||||||
owner: root
|
owner: root
|
||||||
group: ossec
|
group: wazuh
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
|
||||||
- name: Execute create_user script
|
- name: Execute create_user script
|
||||||
|
|||||||
4
roles/wazuh/ansible-wazuh-manager/vars/install_cmake.yml
Normal file
4
roles/wazuh/ansible-wazuh-manager/vars/install_cmake.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# Install cmake vars
|
||||||
|
|
||||||
|
cmake_version: 3.18.3
|
||||||
|
cmake_download_url: "http://packages.wazuh.com/utils/cmake/cmake-{{ cmake_version }}.tar.gz"
|
||||||
Loading…
Reference in New Issue
Block a user