Resolved conflicts
This commit is contained in:
commit
01d79398f0
14
CHANGELOG.md
14
CHANGELOG.md
@ -1,6 +1,20 @@
|
|||||||
# 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.
|
||||||
|
|
||||||
|
## [v3.9.4_7.2.0]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Support for registring agents behind NAT [@jheikki100](https://github.com/jheikki100) [#208](https://github.com/wazuh/wazuh-ansible/pull/208)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Default protocol to TCP [@ionphractal](https://github.com/ionphractal) [#204](https://github.com/wazuh/wazuh-ansible/pull/204).
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed network.host is not localhost [@rshad](https://github.com/rshad) [#204](https://github.com/wazuh/wazuh-ansible/pull/212).
|
||||||
|
|
||||||
## [v3.9.3_7.2.0]
|
## [v3.9.3_7.2.0]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
5
Pipfile
5
Pipfile
@ -5,8 +5,8 @@ name = "pypi"
|
|||||||
|
|
||||||
[packages]
|
[packages]
|
||||||
docker-py = "*"
|
docker-py = "*"
|
||||||
ansible = "==2.7.12"
|
ansible = "==2.7.13"
|
||||||
molecule = "*"
|
molecule = "2.20"
|
||||||
|
|
||||||
[dev-packages]
|
[dev-packages]
|
||||||
|
|
||||||
@ -14,6 +14,7 @@ molecule = "*"
|
|||||||
python_version = "2.7"
|
python_version = "2.7"
|
||||||
|
|
||||||
[scripts]
|
[scripts]
|
||||||
|
destroy ="molecule destroy"
|
||||||
test ="molecule test"
|
test ="molecule test"
|
||||||
agent ="molecule test -s wazuh-agent"
|
agent ="molecule test -s wazuh-agent"
|
||||||
elasticsearch ="molecule test -s elasticsearch"
|
elasticsearch ="molecule test -s elasticsearch"
|
||||||
|
|||||||
4
VERSION
4
VERSION
@ -1,2 +1,2 @@
|
|||||||
WAZUH-ANSIBLE_VERSION="v3.9.3"
|
WAZUH-ANSIBLE_VERSION="v3.9.4"
|
||||||
REVISION="3930"
|
REVISION="3940"
|
||||||
|
|||||||
@ -8,18 +8,37 @@ lint:
|
|||||||
enabled: false
|
enabled: false
|
||||||
platforms:
|
platforms:
|
||||||
- name: bionic
|
- name: bionic
|
||||||
image: ubuntu:bionic
|
image: solita/ubuntu-systemd:bionic
|
||||||
|
command: /sbin/init
|
||||||
|
ulimits:
|
||||||
|
- nofile:262144:262144
|
||||||
|
privileged: true
|
||||||
|
memory_reservation: 2048m
|
||||||
- name: xenial
|
- name: xenial
|
||||||
image: solita/ubuntu-systemd:xenial
|
image: solita/ubuntu-systemd:xenial
|
||||||
privileged: true
|
privileged: true
|
||||||
|
memory_reservation: 2048m
|
||||||
command: /sbin/init
|
command: /sbin/init
|
||||||
- name: trusty
|
ulimits:
|
||||||
image: ubuntu:trusty
|
- nofile:262144:262144
|
||||||
- name: centos6
|
# - name: trusty
|
||||||
image: centos:6
|
# image: ubuntu:trusty
|
||||||
|
# privileged: true
|
||||||
|
# memory_reservation: 2048m
|
||||||
|
# ulimits:
|
||||||
|
# - nofile:262144:262144
|
||||||
|
# - name: centos6
|
||||||
|
# image: centos:6
|
||||||
|
# privileged: true
|
||||||
|
# memory_reservation: 2048m
|
||||||
|
# ulimits:
|
||||||
|
# - nofile:262144:262144
|
||||||
- name: centos7
|
- name: centos7
|
||||||
image: milcom/centos7-systemd
|
image: milcom/centos7-systemd
|
||||||
|
memory_reservation: 2048m
|
||||||
privileged: true
|
privileged: true
|
||||||
|
ulimits:
|
||||||
|
- nofile:262144:262144
|
||||||
provisioner:
|
provisioner:
|
||||||
name: ansible
|
name: ansible
|
||||||
env:
|
env:
|
||||||
|
|||||||
@ -4,7 +4,3 @@
|
|||||||
roles:
|
roles:
|
||||||
- role: wazuh/ansible-wazuh-manager
|
- role: wazuh/ansible-wazuh-manager
|
||||||
|
|
||||||
# - {role: wazuh/ansible-filebeat} #, filebeat_output_elasticsearch_hosts: 'your elastic stack server IP'
|
|
||||||
# Elasticsearch requires too much memory to test multiple containers concurrently - To Fix
|
|
||||||
# - {role: elastic-stack/ansible-elasticsearch, elasticsearch_network_host: 'localhost'}
|
|
||||||
# - {role: elastic-stack/ansible-kibana, elasticsearch_network_host: 'localhost'}
|
|
||||||
|
|||||||
@ -9,7 +9,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 "3.9.3"
|
return "3.9.4"
|
||||||
|
|
||||||
|
|
||||||
def test_wazuh_packages_are_installed(host):
|
def test_wazuh_packages_are_installed(host):
|
||||||
@ -74,7 +74,7 @@ def test_open_ports(host):
|
|||||||
distribution = host.system_info.distribution.lower()
|
distribution = host.system_info.distribution.lower()
|
||||||
if distribution == 'ubuntu':
|
if distribution == 'ubuntu':
|
||||||
assert host.socket("tcp://0.0.0.0:1515").is_listening
|
assert host.socket("tcp://0.0.0.0:1515").is_listening
|
||||||
assert not host.socket("tcp://0.0.0.0:1514").is_listening
|
assert host.socket("tcp://0.0.0.0:1514").is_listening
|
||||||
elif distribution == 'centos':
|
elif distribution == 'centos':
|
||||||
assert host.socket("tcp://:::1515").is_listening
|
assert host.socket("tcp://127.0.0.1:1515").is_listening
|
||||||
assert not host.socket("tcp://:::1514").is_listening
|
assert host.socket("tcp://127.0.0.1:1514").is_listening
|
||||||
|
|||||||
@ -23,18 +23,18 @@ platforms:
|
|||||||
command: /sbin/init
|
command: /sbin/init
|
||||||
ulimits:
|
ulimits:
|
||||||
- nofile:262144:262144
|
- nofile:262144:262144
|
||||||
# - name: trusty
|
#- name: trusty
|
||||||
# image: ubuntu:trusty
|
#image: ubuntu:trusty
|
||||||
# privileged: true
|
#privileged: true
|
||||||
# memory_reservation: 2048m
|
#memory_reservation: 2048m
|
||||||
# ulimits:
|
#ulimits:
|
||||||
# - nofile:262144:262144
|
#- nofile:262144:262144
|
||||||
- name: centos6
|
#- name: centos6
|
||||||
image: centos:6
|
# image: centos:6
|
||||||
privileged: true
|
# privileged: true
|
||||||
memory_reservation: 2048m
|
# memory_reservation: 2048m
|
||||||
ulimits:
|
# ulimits:
|
||||||
- nofile:262144:262144
|
# - nofile:262144:262144
|
||||||
- name: centos7
|
- name: centos7
|
||||||
image: milcom/centos7-systemd
|
image: milcom/centos7-systemd
|
||||||
memory_reservation: 2048m
|
memory_reservation: 2048m
|
||||||
|
|||||||
@ -9,8 +9,8 @@ lint:
|
|||||||
config-data:
|
config-data:
|
||||||
ignore: .virtualenv
|
ignore: .virtualenv
|
||||||
platforms:
|
platforms:
|
||||||
- name: trusty
|
# - name: trusty
|
||||||
image: ubuntu:trusty
|
# image: ubuntu:trusty
|
||||||
- name: bionic
|
- name: bionic
|
||||||
image: solita/ubuntu-systemd:bionic
|
image: solita/ubuntu-systemd:bionic
|
||||||
command: /sbin/init
|
command: /sbin/init
|
||||||
@ -19,12 +19,12 @@ platforms:
|
|||||||
image: solita/ubuntu-systemd:xenial
|
image: solita/ubuntu-systemd:xenial
|
||||||
privileged: true
|
privileged: true
|
||||||
command: /sbin/init
|
command: /sbin/init
|
||||||
- name: centos6
|
#- name: centos6
|
||||||
image: geerlingguy/docker-centos6-ansible
|
# image: geerlingguy/docker-centos6-ansible
|
||||||
privileged: true
|
# privileged: true
|
||||||
command: /sbin/init
|
# command: /sbin/init
|
||||||
volumes:
|
# volumes:
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
# - /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||||
- name: centos7
|
- name: centos7
|
||||||
image: milcom/centos7-systemd
|
image: milcom/centos7-systemd
|
||||||
privileged: true
|
privileged: true
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
- name: "Install Python packages for Trusty to solve trust issues"
|
- name: "Install Python packages for Trusty to solve trust issues"
|
||||||
package:
|
package:
|
||||||
name:
|
name:
|
||||||
|
- python-apt
|
||||||
- python-setuptools
|
- python-setuptools
|
||||||
- python-pip
|
- python-pip
|
||||||
state: latest
|
state: latest
|
||||||
|
|||||||
@ -28,12 +28,12 @@ platforms:
|
|||||||
# memory_reservation: 1024m
|
# memory_reservation: 1024m
|
||||||
# ulimits:
|
# ulimits:
|
||||||
# - nofile:262144:262144
|
# - nofile:262144:262144
|
||||||
- name: centos6
|
# - name: centos6
|
||||||
image: centos:6
|
# image: centos:6
|
||||||
privileged: true
|
# privileged: true
|
||||||
memory_reservation: 1024m
|
# memory_reservation: 1024m
|
||||||
ulimits:
|
# ulimits:
|
||||||
- nofile:262144:262144
|
# - nofile:262144:262144
|
||||||
- name: centos7
|
- name: centos7
|
||||||
image: milcom/centos7-systemd
|
image: milcom/centos7-systemd
|
||||||
memory_reservation: 1024m
|
memory_reservation: 1024m
|
||||||
@ -55,7 +55,6 @@ provisioner:
|
|||||||
group_vars:
|
group_vars:
|
||||||
all:
|
all:
|
||||||
elasticsearch_jvm_xms: 256
|
elasticsearch_jvm_xms: 256
|
||||||
kibana_plugin_install_ignore_error: true
|
|
||||||
verifier:
|
verifier:
|
||||||
name: testinfra
|
name: testinfra
|
||||||
lint:
|
lint:
|
||||||
|
|||||||
@ -2,4 +2,6 @@
|
|||||||
- name: Converge
|
- name: Converge
|
||||||
hosts: all
|
hosts: all
|
||||||
roles:
|
roles:
|
||||||
|
|
||||||
- role: elastic-stack/ansible-kibana
|
- role: elastic-stack/ansible-kibana
|
||||||
|
|
||||||
@ -9,7 +9,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 "3.9.3"
|
return "3.9.4"
|
||||||
|
|
||||||
|
|
||||||
def test_ossec_package_installed(Package):
|
def test_ossec_package_installed(Package):
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
wazuh_managers:
|
wazuh_managers:
|
||||||
- address: <your manager IP>
|
- address: <your manager IP>
|
||||||
port: 1514
|
port: 1514
|
||||||
protocol: udp
|
protocol: tcp
|
||||||
api_port: 55000
|
api_port: 55000
|
||||||
api_proto: 'http'
|
api_proto: 'http'
|
||||||
api_user: ansible
|
api_user: ansible
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
---
|
---
|
||||||
- hosts: <your elasticsearch host>
|
- hosts: <YOUR_ELASTICSEARCH_IP>
|
||||||
roles:
|
roles:
|
||||||
- {role: /etc/ansible/roles/wazuh-ansible/roles/elastic-stack/ansible-elasticsearch, elasticsearch_network_host: 'your elasticsearch IP'}
|
- role: /etc/ansible/roles/wazuh-ansible/roles/elastic-stack/ansible-elasticsearch
|
||||||
|
elasticsearch_network_host: '<YOUR_ELASTICSEARCH_IP>'
|
||||||
|
|||||||
@ -1,10 +1,6 @@
|
|||||||
---
|
---
|
||||||
- hosts: 172.16.0.162
|
- hosts: <KIBANA_HOST>
|
||||||
roles:
|
roles:
|
||||||
- role: ../roles/elastic-stack/ansible-kibana
|
- role: ../roles/elastic-stack/ansible-kibana
|
||||||
kibana_xpack_security: true
|
elasticsearch_network_host: <YOUR_ELASTICSEARCH_IP>
|
||||||
kibana_user: elastic
|
|
||||||
kibana_password: elastic_pass
|
|
||||||
kibana_node_name: node-2
|
|
||||||
elasticsearch_network_host: 172.16.0.161
|
|
||||||
node_certs_generator: false
|
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
---
|
---
|
||||||
- hosts: 172.16.0.161
|
- hosts: <WAZUH_MANAGER_HOST>
|
||||||
roles:
|
roles:
|
||||||
- role: ../roles/wazuh/ansible-wazuh-manager
|
- role: ../roles/wazuh/ansible-wazuh-manager
|
||||||
- role: ../roles/wazuh/ansible-filebeat
|
- role: ../roles/wazuh/ansible-filebeat
|
||||||
filebeat_output_elasticsearch_hosts: 172.16.0.161:9200
|
filebeat_output_elasticsearch_hosts: <YOUR_ELASTICSEARCH_IP>:9200
|
||||||
filebeat_xpack_security: true
|
|
||||||
filebeat_node_name: node-1
|
|
||||||
node_certs_generator: true
|
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@ elasticsearch_http_port: 9200
|
|||||||
elasticsearch_network_host: 127.0.0.1
|
elasticsearch_network_host: 127.0.0.1
|
||||||
elasticsearch_jvm_xms: null
|
elasticsearch_jvm_xms: null
|
||||||
elastic_stack_version: 7.2.0
|
elastic_stack_version: 7.2.0
|
||||||
single_node: false
|
single_node: true
|
||||||
elasticsearch_bootstrap_node: false
|
elasticsearch_bootstrap_node: false
|
||||||
elasticsearch_master_candidate: false
|
elasticsearch_master_candidate: false
|
||||||
elasticsearch_cluster_nodes:
|
elasticsearch_cluster_nodes:
|
||||||
|
|||||||
@ -8,12 +8,6 @@
|
|||||||
register: elasticsearch_ca_packages_installed
|
register: elasticsearch_ca_packages_installed
|
||||||
until: elasticsearch_ca_packages_installed is succeeded
|
until: elasticsearch_ca_packages_installed is succeeded
|
||||||
|
|
||||||
- name: "Install Java Repo for Trusty"
|
|
||||||
apt_repository: repo='ppa:openjdk-r/ppa'
|
|
||||||
when:
|
|
||||||
- ansible_distribution == "Ubuntu"
|
|
||||||
- ansible_distribution_major_version | int == 14
|
|
||||||
|
|
||||||
- name: Update and upgrade apt packages
|
- name: Update and upgrade apt packages
|
||||||
become: true
|
become: true
|
||||||
apt:
|
apt:
|
||||||
@ -24,14 +18,6 @@
|
|||||||
- ansible_distribution == "Ubuntu"
|
- ansible_distribution == "Ubuntu"
|
||||||
- ansible_distribution_major_version | int == 14
|
- ansible_distribution_major_version | int == 14
|
||||||
|
|
||||||
- name: Install Oracle Java 8
|
|
||||||
become: true
|
|
||||||
apt: name=openjdk-8-jdk state=latest
|
|
||||||
|
|
||||||
when:
|
|
||||||
- ansible_distribution == "Ubuntu"
|
|
||||||
- ansible_distribution_major_version | int == 14
|
|
||||||
|
|
||||||
- name: Update and upgrade apt packages
|
- name: Update and upgrade apt packages
|
||||||
become: true
|
become: true
|
||||||
apt:
|
apt:
|
||||||
|
|||||||
@ -9,13 +9,6 @@
|
|||||||
gpgcheck: true
|
gpgcheck: true
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: CentOS x.x => x.x < 7.0 | Installing Java
|
|
||||||
yum:
|
|
||||||
name: java-1.8.0-openjdk.x86_64
|
|
||||||
state: present
|
|
||||||
when:
|
|
||||||
- ansible_distribution in ['CentOS', 'RedHat'] and ansible_distribution_major_version|int < 7
|
|
||||||
|
|
||||||
- name: RedHat/CentOS/Fedora | Install Elasticsarch
|
- name: RedHat/CentOS/Fedora | Install Elasticsarch
|
||||||
package: name=elasticsearch-{{ elastic_stack_version }} state=present
|
package: name=elasticsearch-{{ elastic_stack_version }} state=present
|
||||||
tags: install
|
tags: install
|
||||||
|
|||||||
@ -65,7 +65,7 @@
|
|||||||
|
|
||||||
- name: Check if certificate exists locally
|
- name: Check if certificate exists locally
|
||||||
stat:
|
stat:
|
||||||
path: "{{node_certs_destination}}/{{ elasticsearch_node_name }}.crt"
|
path: "{{ node_certs_destination }}/{{ elasticsearch_node_name }}.crt"
|
||||||
register: certificate_file_exists
|
register: certificate_file_exists
|
||||||
when:
|
when:
|
||||||
- elasticsearch_xpack_security
|
- elasticsearch_xpack_security
|
||||||
@ -73,7 +73,7 @@
|
|||||||
- name: Write the instances.yml file in the selected node (force = no)
|
- name: Write the instances.yml file in the selected node (force = no)
|
||||||
template:
|
template:
|
||||||
src: instances.yml.j2
|
src: instances.yml.j2
|
||||||
dest: "{{node_certs_source}}/instances.yml"
|
dest: "{{ node_certs_source }}/instances.yml"
|
||||||
force: no
|
force: no
|
||||||
register: instances_file_exists
|
register: instances_file_exists
|
||||||
tags:
|
tags:
|
||||||
@ -86,23 +86,25 @@
|
|||||||
|
|
||||||
- name: Update instances.yml status after generation
|
- name: Update instances.yml status after generation
|
||||||
stat:
|
stat:
|
||||||
path: "{{node_certs_source}}/instances.yml"
|
path: "{{ node_certs_source }}/instances.yml"
|
||||||
register: instances_file_exists
|
register: instances_file_exists
|
||||||
when:
|
when:
|
||||||
- node_certs_generator
|
- node_certs_generator
|
||||||
- elasticsearch_xpack_security
|
- elasticsearch_xpack_security
|
||||||
|
|
||||||
- name: Check if the certificates ZIP file exists
|
- name: Check if the certificates ZIP file exists
|
||||||
stat:
|
stat:
|
||||||
path: "{{node_certs_source}}/certs.zip"
|
path: "{{ node_certs_source }}/certs.zip"
|
||||||
register: xpack_certs_zip
|
register: xpack_certs_zip
|
||||||
when:
|
when:
|
||||||
- node_certs_generator
|
- node_certs_generator
|
||||||
- elasticsearch_xpack_security
|
- elasticsearch_xpack_security
|
||||||
|
|
||||||
- name: Generating certificates for Elasticsearch security
|
- name: Generating certificates for Elasticsearch security
|
||||||
shell: "/usr/share/elasticsearch/bin/elasticsearch-certutil cert ca --pem --in {{node_certs_source}}/instances.yml --out {{node_certs_source}}/certs.zip"
|
command: >-
|
||||||
when:
|
"/usr/share/elasticsearch/bin/elasticsearch-certutil cert ca --pem --in
|
||||||
|
{{ node_certs_source }}/instances.yml --out {{ node_certs_source }}/certs.zip"
|
||||||
|
when:
|
||||||
- node_certs_generator
|
- node_certs_generator
|
||||||
- elasticsearch_xpack_security
|
- elasticsearch_xpack_security
|
||||||
- not xpack_certs_zip.stat.exists
|
- not xpack_certs_zip.stat.exists
|
||||||
@ -112,10 +114,10 @@
|
|||||||
|
|
||||||
- name: Unzip generated certs.zip
|
- name: Unzip generated certs.zip
|
||||||
unarchive:
|
unarchive:
|
||||||
src: "{{node_certs_source}}/certs.zip"
|
src: "{{ node_certs_source }}/certs.zip"
|
||||||
dest: "{{node_certs_source}}/"
|
dest: "{{ node_certs_source }}/"
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
when:
|
when:
|
||||||
- node_certs_generator
|
- node_certs_generator
|
||||||
- elasticsearch_xpack_security
|
- elasticsearch_xpack_security
|
||||||
- certs_file_generated is defined
|
- certs_file_generated is defined
|
||||||
@ -124,35 +126,39 @@
|
|||||||
|
|
||||||
- name: Copy key & certificate files in generator node (locally)
|
- name: Copy key & certificate files in generator node (locally)
|
||||||
synchronize:
|
synchronize:
|
||||||
src: "{{node_certs_source}}/{{elasticsearch_node_name}}/"
|
src: "{{ node_certs_source }}/{{ elasticsearch_node_name }}/"
|
||||||
dest: "{{node_certs_destination}}/"
|
dest: "{{ node_certs_destination }}/"
|
||||||
delegate_to: "{{ node_certs_generator_ip }}"
|
delegate_to: "{{ node_certs_generator_ip }}"
|
||||||
when:
|
when:
|
||||||
- node_certs_generator
|
- node_certs_generator
|
||||||
- elasticsearch_xpack_security
|
- elasticsearch_xpack_security
|
||||||
tags: xpack-security
|
tags: xpack-security
|
||||||
|
|
||||||
- name: Copy ca certificate file in generator node (locally)
|
- name: Copy ca certificate file in generator node (locally)
|
||||||
synchronize:
|
synchronize:
|
||||||
src: "{{node_certs_source}}/ca/"
|
src: "{{ node_certs_source }}/ca/"
|
||||||
dest: "{{node_certs_destination}}/"
|
dest: "{{ node_certs_destination }}/"
|
||||||
delegate_to: "{{ node_certs_generator_ip }}"
|
delegate_to: "{{ node_certs_generator_ip }}"
|
||||||
register: check_certs_permissions
|
register: check_certs_permissions
|
||||||
when:
|
when:
|
||||||
- node_certs_generator
|
- node_certs_generator
|
||||||
- elasticsearch_xpack_security
|
- elasticsearch_xpack_security
|
||||||
tags: xpack-security
|
tags: xpack-security
|
||||||
|
|
||||||
- name: Importing key & certificate files from generator node
|
- name: Importing key & certificate files from generator node
|
||||||
shell: "{{rsync_path}} {{rsync_extra_parameters}} {{rsync_user}}@{{node_certs_generator_ip}}:{{node_certs_source}}/{{elasticsearch_node_name}}/ {{node_certs_destination}}/"
|
command: >-
|
||||||
|
{{ rsync_path }} {{ rsync_extra_parameters }} {{ rsync_user }}@{{ node_certs_generator_ip }}:
|
||||||
|
{{ node_certs_source }}/{{ elasticsearch_node_name }}/ {{ node_certs_destination }}/
|
||||||
when:
|
when:
|
||||||
- not node_certs_generator
|
- not node_certs_generator
|
||||||
- elasticsearch_xpack_security
|
- elasticsearch_xpack_security
|
||||||
- not certificate_file_exists.stat.exists
|
- not certificate_file_exists.stat.exists
|
||||||
tags: xpack-security
|
tags: xpack-security
|
||||||
|
|
||||||
- name: Importing ca certificate file from generator node
|
- name: Importing ca certificate file from generator node
|
||||||
shell: "{{rsync_path}} {{rsync_extra_parameters}} {{rsync_user}}@{{node_certs_generator_ip}}:{{node_certs_source}}/ca/ {{node_certs_destination}}/"
|
command: >-
|
||||||
|
{{ rsync_path }} {{ rsync_extra_parameters }} {{ rsync_user }}@{{ node_certs_generator_ip }}:
|
||||||
|
{{ node_certs_source }}/ca/ {{ node_certs_destination }}/
|
||||||
when:
|
when:
|
||||||
- not node_certs_generator
|
- not node_certs_generator
|
||||||
- elasticsearch_xpack_security
|
- elasticsearch_xpack_security
|
||||||
@ -161,23 +167,32 @@
|
|||||||
tags: xpack-security
|
tags: xpack-security
|
||||||
|
|
||||||
- name: Ensuring certificates folder owner
|
- name: Ensuring certificates folder owner
|
||||||
shell: "chown -R elasticsearch: {{node_certs_destination}}/"
|
file:
|
||||||
|
path: "{{ node_certs_destination }}/"
|
||||||
|
state: directory
|
||||||
|
recurse: yes
|
||||||
|
owner: elasticsearch
|
||||||
|
group: elasticsearch
|
||||||
when:
|
when:
|
||||||
- check_certs_permissions is defined
|
- check_certs_permissions is defined
|
||||||
- elasticsearch_xpack_security
|
- elasticsearch_xpack_security
|
||||||
tags: xpack-security
|
tags: xpack-security
|
||||||
|
|
||||||
- name: Ensuring certificates folder owner
|
- name: Ensuring certificates folder owner
|
||||||
shell: "chmod -R 770 {{node_certs_destination}}/"
|
file:
|
||||||
|
path: "{{ node_certs_destination }}/"
|
||||||
|
mode: '0770'
|
||||||
|
recurse: yes
|
||||||
when:
|
when:
|
||||||
- check_certs_permissions is defined
|
- check_certs_permissions is defined
|
||||||
- elasticsearch_xpack_security
|
- elasticsearch_xpack_security
|
||||||
tags: xpack-security
|
tags: xpack-security
|
||||||
|
|
||||||
|
|
||||||
- name: Remove generated certs file
|
- name: Remove generated certs file
|
||||||
shell: /bin/rm -f {{node_certs_source}}/certs.zip*
|
file:
|
||||||
when:
|
state: absent
|
||||||
|
path: "{{ node_certs_source }}/certs.zip*"
|
||||||
|
when:
|
||||||
- node_certs_generator
|
- node_certs_generator
|
||||||
- elasticsearch_xpack_security
|
- elasticsearch_xpack_security
|
||||||
tags: xpack-security
|
tags: xpack-security
|
||||||
@ -193,10 +208,12 @@
|
|||||||
tags: configure
|
tags: configure
|
||||||
|
|
||||||
- name: Set elasticsearch bootstrap password
|
- name: Set elasticsearch bootstrap password
|
||||||
shell: "echo '{{elasticsearch_xpack_security_password}}' | {{node_certs_source}}/bin/elasticsearch-keystore add -xf 'bootstrap.password'"
|
shell: |
|
||||||
|
set -o pipefail
|
||||||
|
"echo '{{ elasticsearch_xpack_security_password }}' | {{ node_certs_source }}/bin/elasticsearch-keystore add -xf 'bootstrap.password'"
|
||||||
when:
|
when:
|
||||||
- elasticsearch_xpack_security
|
- elasticsearch_xpack_security
|
||||||
|
|
||||||
- name: Trusty | set MAX_LOCKED_MEMORY=unlimited in Elasticsearch in /etc/security/limits.conf
|
- name: Trusty | set MAX_LOCKED_MEMORY=unlimited in Elasticsearch in /etc/security/limits.conf
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: /etc/security/limits.conf
|
path: /etc/security/limits.conf
|
||||||
@ -228,13 +245,6 @@
|
|||||||
- not (ansible_distribution == "Debian" and ansible_distribution_version is version('8', '<'))
|
- not (ansible_distribution == "Debian" and ansible_distribution_version is version('8', '<'))
|
||||||
- not (ansible_os_family == "RedHat" and ansible_distribution_version is version('7', '<'))
|
- not (ansible_os_family == "RedHat" and ansible_distribution_version is version('7', '<'))
|
||||||
|
|
||||||
- name: Distribution is centos 6.* | Enable Elasticsearch
|
|
||||||
service: name=elasticsearch enabled=yes
|
|
||||||
|
|
||||||
- name: Distribution is centos 6.* | Start Elasticsearch
|
|
||||||
service: name=elasticsearch state=started
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
- name: Ensure Elasticsearch started and enabled
|
- name: Ensure Elasticsearch started and enabled
|
||||||
service:
|
service:
|
||||||
name: elasticsearch
|
name: elasticsearch
|
||||||
@ -242,7 +252,7 @@
|
|||||||
state: started
|
state: started
|
||||||
|
|
||||||
- name: Make sure Elasticsearch is running before proceeding
|
- name: Make sure Elasticsearch is running before proceeding
|
||||||
wait_for: host={{ elasticsearch_network_host }} port={{ elasticsearch_http_port }} delay=3 timeout=300
|
wait_for: host={{ elasticsearch_network_host }} port={{ elasticsearch_http_port }} delay=3 timeout=400
|
||||||
tags:
|
tags:
|
||||||
- configure
|
- configure
|
||||||
- init
|
- init
|
||||||
@ -252,7 +262,7 @@
|
|||||||
url: "http://{{ elasticsearch_network_host }}:{{ elasticsearch_http_port }}/_template/wazuh"
|
url: "http://{{ elasticsearch_network_host }}:{{ elasticsearch_http_port }}/_template/wazuh"
|
||||||
method: GET
|
method: GET
|
||||||
status_code: 200, 404
|
status_code: 200, 404
|
||||||
when:
|
when:
|
||||||
- elasticsearch_bootstrap_node or single_node
|
- elasticsearch_bootstrap_node or single_node
|
||||||
- not elasticsearch_xpack_security
|
- not elasticsearch_xpack_security
|
||||||
poll: 30
|
poll: 30
|
||||||
@ -267,7 +277,7 @@
|
|||||||
status_code: 200
|
status_code: 200
|
||||||
body_format: json
|
body_format: json
|
||||||
body: "{{ lookup('template','wazuh-elastic7-template-alerts.json.j2') }}"
|
body: "{{ lookup('template','wazuh-elastic7-template-alerts.json.j2') }}"
|
||||||
when:
|
when:
|
||||||
- wazuh_alerts_template_exits.status is defined
|
- wazuh_alerts_template_exits.status is defined
|
||||||
- wazuh_alerts_template_exits.status != 200
|
- wazuh_alerts_template_exits.status != 200
|
||||||
- not elasticsearch_xpack_security
|
- not elasticsearch_xpack_security
|
||||||
|
|||||||
@ -6,7 +6,7 @@ elasticsearch_network_host: "127.0.0.1"
|
|||||||
kibana_server_host: "0.0.0.0"
|
kibana_server_host: "0.0.0.0"
|
||||||
kibana_server_port: "5601"
|
kibana_server_port: "5601"
|
||||||
elastic_stack_version: 7.2.0
|
elastic_stack_version: 7.2.0
|
||||||
wazuh_version: 3.9.3
|
wazuh_version: 3.9.4
|
||||||
|
|
||||||
# Xpack Security
|
# Xpack Security
|
||||||
kibana_xpack_security: false
|
kibana_xpack_security: false
|
||||||
@ -23,3 +23,5 @@ node_certs_destination: /etc/kibana/certs
|
|||||||
rsync_path: /usr/bin/rsync
|
rsync_path: /usr/bin/rsync
|
||||||
rsync_user: vagrant
|
rsync_user: vagrant
|
||||||
rsync_extra_parameters: -avg -e 'ssh -o StrictHostKeyChecking=no' --rsync-path='sudo rsync'
|
rsync_extra_parameters: -avg -e 'ssh -o StrictHostKeyChecking=no' --rsync-path='sudo rsync'
|
||||||
|
|
||||||
|
kibana_plugin_install_ignore_error: true
|
||||||
@ -118,14 +118,15 @@
|
|||||||
tags: install
|
tags: install
|
||||||
|
|
||||||
- name: Install Wazuh-APP (can take a while)
|
- name: Install Wazuh-APP (can take a while)
|
||||||
shell: "/usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/wazuhapp/wazuhapp-{{ wazuh_version }}_{{ elastic_stack_version }}.zip"
|
shell: "/usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/wazuhapp/wazuhapp-{{ wazuh_version }}_{{ elastic_stack_version }}.zip"
|
||||||
environment:
|
environment:
|
||||||
NODE_OPTIONS: "--max-old-space-size=3072"
|
NODE_OPTIONS: "--max-old-space-size=3072"
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
creates: /usr/share/kibana/plugins/wazuh/package.json
|
creates: /usr/share/kibana/plugins/wazuh/package.json
|
||||||
notify: restart kibana
|
notify: restart kibana
|
||||||
ignore_errors: "{{ kibana_plugin_install_ignore_error }}"
|
become: yes
|
||||||
|
become_user: kibana
|
||||||
tags:
|
tags:
|
||||||
- install
|
- install
|
||||||
- skip_ansible_lint
|
- skip_ansible_lint
|
||||||
|
|||||||
@ -43,3 +43,8 @@ node_certs_destination: /etc/filebeat/certs
|
|||||||
rsync_path: /usr/bin/rsync
|
rsync_path: /usr/bin/rsync
|
||||||
rsync_user: vagrant
|
rsync_user: vagrant
|
||||||
rsync_extra_parameters: -avg -e 'ssh -o StrictHostKeyChecking=no' --rsync-path='sudo rsync'
|
rsync_extra_parameters: -avg -e 'ssh -o StrictHostKeyChecking=no' --rsync-path='sudo rsync'
|
||||||
|
|
||||||
|
filebeat_module_package_name: wazuh-filebeat-0.1.tar.gz
|
||||||
|
filebeat_module_package_path: /root/
|
||||||
|
filebeat_module_destination: /usr/share/filebeat/module
|
||||||
|
filebeat_module_folder: /usr/share/filebeat/module/wazuh
|
||||||
@ -88,6 +88,41 @@
|
|||||||
- filebeat_xpack_security
|
- filebeat_xpack_security
|
||||||
tags: xpack-security
|
tags: xpack-security
|
||||||
|
|
||||||
|
- name: Checking if Filebeat Module folder file exists
|
||||||
|
stat:
|
||||||
|
path: "{{ filebeat_module_folder }}"
|
||||||
|
register: filebeat_module_folder
|
||||||
|
|
||||||
|
|
||||||
|
- name: Download Filebeat module package
|
||||||
|
get_url:
|
||||||
|
url: https://packages.wazuh.com/3.x/filebeat/{{ filebeat_module_package_name }}
|
||||||
|
dest: "{{ filebeat_module_package_path }}"
|
||||||
|
when: not filebeat_module_folder.stat.exists
|
||||||
|
|
||||||
|
- name: Unpakcing Filebeat module package
|
||||||
|
unarchive:
|
||||||
|
src: "{{ filebeat_module_package_path }}/{{ filebeat_module_package_name }}"
|
||||||
|
dest: "{{ filebeat_module_destination }}"
|
||||||
|
remote_src: yes
|
||||||
|
when: not filebeat_module_folder.stat.exists
|
||||||
|
|
||||||
|
- name: Setting 0755 permission for Filebeat module folder
|
||||||
|
file: dest={{ filebeat_module_folder }} mode=u=rwX,g=rwX,o=rwX recurse=yes
|
||||||
|
when: not filebeat_module_folder.stat.exists
|
||||||
|
|
||||||
|
- name: Checking if Filebeat Module package file exists
|
||||||
|
stat:
|
||||||
|
path: "{{ filebeat_module_package_path }}/{{ filebeat_module_package_name }}"
|
||||||
|
register: filebeat_module_package
|
||||||
|
when: filebeat_module_package is not defined
|
||||||
|
|
||||||
|
- name: Delete Filebeat module package file
|
||||||
|
file:
|
||||||
|
state: absent
|
||||||
|
path: "{{ filebeat_module_package_path }}/{{ filebeat_module_package_name }}"
|
||||||
|
when: filebeat_module_package.stat.exists
|
||||||
|
|
||||||
- import_tasks: config.yml
|
- import_tasks: config.yml
|
||||||
when: filebeat_create_config
|
when: filebeat_create_config
|
||||||
notify: restart filebeat
|
notify: restart filebeat
|
||||||
|
|||||||
@ -32,7 +32,7 @@ The following is an example of how this role can be used:
|
|||||||
wazuh_managers:
|
wazuh_managers:
|
||||||
- address: 127.0.0.1
|
- address: 127.0.0.1
|
||||||
port: 1514
|
port: 1514
|
||||||
protocol: udp
|
protocol: tcp
|
||||||
api_port: 55000
|
api_port: 55000
|
||||||
api_proto: 'http'
|
api_proto: 'http'
|
||||||
api_user: 'ansible'
|
api_user: 'ansible'
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
wazuh_agent_version: 3.9.3
|
wazuh_agent_version: 3.9.4
|
||||||
wazuh_managers:
|
wazuh_managers:
|
||||||
- address: 127.0.0.1
|
- address: 127.0.0.1
|
||||||
port: 1514
|
port: 1514
|
||||||
@ -24,7 +24,7 @@ wazuh_winagent_config:
|
|||||||
install_dir_x86: 'C:\Program Files (x86)\ossec-agent\'
|
install_dir_x86: 'C:\Program Files (x86)\ossec-agent\'
|
||||||
auth_path: C:\'Program Files'\ossec-agent\agent-auth.exe
|
auth_path: C:\'Program Files'\ossec-agent\agent-auth.exe
|
||||||
auth_path_x86: C:\'Program Files (x86)'\ossec-agent\agent-auth.exe
|
auth_path_x86: C:\'Program Files (x86)'\ossec-agent\agent-auth.exe
|
||||||
version: '3.9.3'
|
version: '3.9.4'
|
||||||
revision: '1'
|
revision: '1'
|
||||||
repo: https://packages.wazuh.com/3.x/windows/
|
repo: https://packages.wazuh.com/3.x/windows/
|
||||||
md5: c3fdbd6c121ca371b8abcd477ed4e8a4
|
md5: c3fdbd6c121ca371b8abcd477ed4e8a4
|
||||||
@ -305,3 +305,4 @@ wazuh_agent_config:
|
|||||||
list:
|
list:
|
||||||
- key: Env
|
- key: Env
|
||||||
value: Production
|
value: Production
|
||||||
|
wazuh_agent_nat: false
|
||||||
|
|||||||
@ -54,6 +54,7 @@
|
|||||||
-A {{ agent_name }}
|
-A {{ agent_name }}
|
||||||
-m {{ wazuh_managers.0.address }}
|
-m {{ wazuh_managers.0.address }}
|
||||||
-p {{ wazuh_agent_authd.port }}
|
-p {{ wazuh_agent_authd.port }}
|
||||||
|
{% if wazuh_agent_nat %}-I "any" {% endif %}
|
||||||
{% if authd_pass is defined %}-P {{ authd_pass }}{% endif %}
|
{% if authd_pass is defined %}-P {{ authd_pass }}{% endif %}
|
||||||
{% if wazuh_agent_authd.ssl_agent_ca is not none %}
|
{% if wazuh_agent_authd.ssl_agent_ca is not none %}
|
||||||
-v "/var/ossec/etc/{{ wazuh_agent_authd.ssl_agent_ca | basename }}"
|
-v "/var/ossec/etc/{{ wazuh_agent_authd.ssl_agent_ca | basename }}"
|
||||||
@ -128,7 +129,7 @@
|
|||||||
environment:
|
environment:
|
||||||
OSSEC_ACTION: i
|
OSSEC_ACTION: i
|
||||||
OSSEC_AGENT_NAME: '{{ newagentdata_api.json.data.name }}'
|
OSSEC_AGENT_NAME: '{{ newagentdata_api.json.data.name }}'
|
||||||
OSSEC_AGENT_IP: '{{ newagentdata_api.json.data.ip }}'
|
OSSEC_AGENT_IP: '{% if wazuh_agent_nat %}any{% else %}{{ newagentdata_api.json.data.ip }}{% endif %}'
|
||||||
OSSEC_AGENT_ID: '{{ newagent_api.json.data.id }}'
|
OSSEC_AGENT_ID: '{{ newagent_api.json.data.id }}'
|
||||||
OSSEC_AGENT_KEY: '{{ newagent_api.json.data.key }}'
|
OSSEC_AGENT_KEY: '{{ newagent_api.json.data.key }}'
|
||||||
OSSEC_ACTION_CONFIRMED: y
|
OSSEC_ACTION_CONFIRMED: y
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
wazuh_manager_api_version: 3.9.3
|
wazuh_manager_api_version: 3.9.4
|
||||||
|
|
||||||
wazuh_manager_fqdn: "wazuh-server"
|
wazuh_manager_fqdn: "wazuh-server"
|
||||||
wazuh_manager_package_state: latest
|
wazuh_manager_package_state: latest
|
||||||
@ -42,7 +42,7 @@ wazuh_manager_config:
|
|||||||
connection:
|
connection:
|
||||||
- type: 'secure'
|
- type: 'secure'
|
||||||
port: '1514'
|
port: '1514'
|
||||||
protocol: 'udp'
|
protocol: 'tcp'
|
||||||
queue_size: 131072
|
queue_size: 131072
|
||||||
authd:
|
authd:
|
||||||
enable: true
|
enable: true
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user