Merge branch 'fix_tests' into 3.9.2_7.1.1_tests

This commit is contained in:
Rshad Zhran 2019-07-16 19:30:40 +02:00
commit dc87059ab8
128 changed files with 337 additions and 59 deletions

0
.gitignore vendored Normal file → Executable file
View File

BIN
.swp Executable file

Binary file not shown.

0
.yamllint Normal file → Executable file
View File

0
CHANGELOG.md Normal file → Executable file
View File

0
LICENSE Normal file → Executable file
View File

0
Pipfile Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

0
VERSION Normal file → Executable file
View File

0
molecule/default/Dockerfile.j2 Normal file → Executable file
View File

0
molecule/default/INSTALL.rst Normal file → Executable file
View File

0
molecule/default/create.yml Normal file → Executable file
View File

0
molecule/default/destroy.yml Normal file → Executable file
View File

0
molecule/default/molecule.yml Normal file → Executable file
View File

0
molecule/default/playbook.yml Normal file → Executable file
View File

0
molecule/default/prepare.yml Normal file → Executable file
View File

2
molecule/default/tests/test_default.py Normal file → Executable file
View File

@ -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.2" return "3.9.0"
def test_wazuh_packages_are_installed(host): def test_wazuh_packages_are_installed(host):

0
molecule/elasticsearch/Dockerfile.j2 Normal file → Executable file
View File

0
molecule/elasticsearch/INSTALL.rst Normal file → Executable file
View File

24
molecule/elasticsearch/molecule.yml Normal file → Executable file
View File

@ -5,6 +5,9 @@ driver:
name: docker name: docker
lint: lint:
name: yamllint name: yamllint
options:
config-data:
ignore: .virtualenv
platforms: platforms:
- name: bionic - name: bionic
image: solita/ubuntu-systemd:bionic image: solita/ubuntu-systemd:bionic
@ -12,28 +15,29 @@ platforms:
ulimits: ulimits:
- nofile:262144:262144 - nofile:262144:262144
privileged: true privileged: true
memory_reservation: 1024m memory_reservation: 2048m
- name: xenial - name: xenial
image: solita/ubuntu-systemd:xenial image: solita/ubuntu-systemd:xenial
privileged: true privileged: true
memory_reservation: 1024m memory_reservation: 2048m
command: /sbin/init command: /sbin/init
ulimits: ulimits:
- nofile:262144:262144 - nofile:262144:262144
- name: trusty # - name: trusty
image: ubuntu:trusty # image: ubuntu:trusty
memory_reservation: 1024m # privileged: true
ulimits: # memory_reservation: 2048m
- nofile:262144:262144 # ulimits:
# - nofile:262144:262144
- name: centos6 - name: centos6
image: centos:6 image: centos:6
privileged: true privileged: true
memory_reservation: 1024m 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: 1024m memory_reservation: 2048m
privileged: true privileged: true
ulimits: ulimits:
- nofile:262144:262144 - nofile:262144:262144
@ -48,7 +52,7 @@ provisioner:
ANSIBLE_ROLES_PATH: ../../roles ANSIBLE_ROLES_PATH: ../../roles
lint: lint:
name: ansible-lint name: ansible-lint
enabled: true enabled: false
inventory: inventory:
group_vars: group_vars:
all: all:

0
molecule/elasticsearch/playbook.yml Normal file → Executable file
View File

2
molecule/elasticsearch/tests/test_default.py Normal file → Executable file
View File

@ -10,7 +10,7 @@ def test_elasticsearch_is_installed(host):
"""Test if the elasticsearch package is installed.""" """Test if the elasticsearch package is installed."""
elasticsearch = host.package("elasticsearch") elasticsearch = host.package("elasticsearch")
assert elasticsearch.is_installed assert elasticsearch.is_installed
assert elasticsearch.version.startswith('6.7.1') assert elasticsearch.version.startswith('7.1.1')
def test_elasticsearch_is_running(host): def test_elasticsearch_is_running(host):

View File

@ -0,0 +1,117 @@
<html>
<head>
<title>Unauthorized Request</title>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<link rel="stylesheet" type="text/css" href="/errors/us/assets/hp-styles.css" />
<link rel="stylesheet" type="text/css" href="/errors/us/assets/master-master.css" />
<body style="margin: 0px" bgcolor=#ffffff>
<div id="banner">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td rowspan="2" valign="middle" nowrap><a href="http://www.oracle.com"><img src="/errors/us/assets/oralogo-small.gif" width="154" height="19" hspace="10" vspace="25" border="0" ></a></td>
<td align="right" valign="top" width="70%" nowrap class="padMid"><div id="bannerMid"> </div></td>
<td width="30%" align="left" valign="bottom" nowrap></td>
</tr>
<tr>
<td align="right" valign="bottom" nowrap class="padMid"></td>
<td width="30%" align="left" valign="bottom" nowrap></td>
</tr>
</table>
</div>
<!-- Header END //-->
<table BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<tr>
<TD><IMG SRC="/errors/us/assets/spacer.gif" BORDER=0 ALT=""></TD>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><IMG SRC="/errors/us/assets/spacer.gif" BORDER=0 ALT="" height="15"></td>
</tr>
<tr>
<td><h1>Sorry!</h1></td>
</tr>
<tr>
<td><IMG SRC="/errors/us/assets/spacer.gif" BORDER=0 ALT="" height="5"></td>
</tr>
<tr>
<td colspan="2">In order to download products from Oracle Technology
Network you must agree to the OTN license terms.</td>
</tr>
<tr>
<td><IMG SRC="/errors/us/assets/spacer.gif" BORDER=0 ALT="" height="5"></td>
</tr>
<tr>
<td><IMG SRC="/errors/us/assets/spacer.gif" BORDER=0 ALT="" height="5"></td>
</tr>
<tr>
<td colspan="2"><strong>Be sure that...</strong></td>
</tr>
<tr>
<td><img alt="" src="/errors/us/assets/004894.gif" height="7" vspace="3">
Your browser has "cookies" and JavaScript enabled.</td>
</tr>
<tr>
<td colspan="2"><img alt="" src="/errors/us/assets/004894.gif" height="7" vspace="3">
You clicked on "Accept License" for the product you wish to download.</td>
</tr>
<tr>
<td colspan="2"><img alt="" src="/errors/us/assets/004894.gif" height="7" vspace="3">
You attempt the download within 30 minutes of accepting the license.</td>
</tr>
<tr>
<td><IMG SRC="/errors/us/assets/spacer.gif" BORDER=0 ALT="" height="5"></td>
</tr>
<tr>
<td colspan="2"><strong>From here you can go...</strong></td>
</tr>
<tr>
<td><IMG SRC="/errors/us/assets/spacer.gif" BORDER=0 ALT="" height="5"></td>
</tr>
<tr>
<td><IMG SRC="/errors/us/assets/spacer.gif" BORDER=0 ALT="" height="5"></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td align="right" valign="top" width="2%"><img src="/errors/us/assets/004894.gif" height="7" vspace="3"></td>
<td><a href="javascript:history.back(-1)">Back to Previous Page</a></td>
</tr>
<tr valign="middle">
<td align="right" valign="top"><img src="/errors/us/assets/004894.gif" height="7" vspace="3"></td>
<td><a href="http://www.oracle.com/us/sitemaps/index.html#otn">Site Map</a></td>
</tr>
<tr valign="middle">
<td align="right" valign="top"><img src="/errors/us/assets/004894.gif" height="7" vspace="3"></td>
<td><a href="http://www.oracle.com/technetwork/index.html">OTN Homepage</a></td>
</tr>
</table>
<br>
<div id="footer">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" class="legalese" align="right" valign="top">&nbsp;</td>
<td width="50%" class="legalese" align="left" valign="top" >&nbsp;</td>
</tr>
<tr>
<td width="50%" class="legalese" align="left" valign="top">&nbsp;</td>
<td width="50%" class="legalese" align="right" valign="top"><a class=legalese href="http://www.oracle.com/rss/index.html" target="_top">RSS <img src="/errors/us/assets/feed-icon-14x14.png" width="14" height="14" border="0"></A><span class=navlink> | </span> <a class=legalese href="http://www.oracle.com/html/copyright.html" target="_top">Legal Notices and Terms for Use</a><span class=navlink> | </span> <a class=legalese href="http://www.oracle.com/html/privacy.html" target="_top">Privacy Statement</a><br />
</td>
</tr>
<tr>
<td width="50%" class="legalese" align="right" valign="top">&nbsp;</td>
<td width="50%" class="legalese" align="left" valign="top" ></td>
</tr>
</table>
</div>
</td>
<TD WIDTH="10"><IMG SRC="/errors/us/assets/spacer.gif" BORDER=0 ALT="" WIDTH="10"></TD>
</tr>
</table>
</body>
</html>

0
molecule/filebeat/Dockerfile.j2 Normal file → Executable file
View File

0
molecule/filebeat/INSTALL.rst Normal file → Executable file
View File

3
molecule/filebeat/molecule.yml Normal file → Executable file
View File

@ -5,6 +5,9 @@ driver:
name: docker name: docker
lint: lint:
name: yamllint name: yamllint
options:
config-data:
ignore: .virtualenv
platforms: platforms:
- name: trusty - name: trusty
image: ubuntu:trusty image: ubuntu:trusty

0
molecule/filebeat/playbook.yml Normal file → Executable file
View File

0
molecule/filebeat/prepare.yml Normal file → Executable file
View File

7
molecule/filebeat/tests/test_default.py Normal file → Executable file
View File

@ -4,3 +4,10 @@ import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_filebeat_is_installed(host):
"""Test if the elasticsearch package is installed."""
filebeat = host.package("filebeat")
assert filebeat.is_installed
assert filebeat.version.startswith('7.1.1')

0
molecule/kibana/Dockerfile.j2 Normal file → Executable file
View File

0
molecule/kibana/INSTALL.rst Normal file → Executable file
View File

13
molecule/kibana/molecule.yml Normal file → Executable file
View File

@ -5,6 +5,9 @@ driver:
name: docker name: docker
lint: lint:
name: yamllint name: yamllint
options:
config-data:
ignore: .virtualenv
platforms: platforms:
- name: bionic - name: bionic
image: solita/ubuntu-systemd:bionic image: solita/ubuntu-systemd:bionic
@ -20,11 +23,11 @@ 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
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

0
molecule/kibana/playbook.yml Normal file → Executable file
View File

0
molecule/kibana/prepare.yml Normal file → Executable file
View File

2
molecule/kibana/tests/test_default.py Normal file → Executable file
View File

@ -14,7 +14,7 @@ def test_port_kibana_is_open(host):
def test_find_correct_elasticsearch_version(host): def test_find_correct_elasticsearch_version(host):
"""Test if we find the kibana/elasticsearch version in package.json""" """Test if we find the kibana/elasticsearch version in package.json"""
kibana = host.file("/usr/share/kibana/plugins/wazuh/package.json") kibana = host.file("/usr/share/kibana/plugins/wazuh/package.json")
assert kibana.contains("6.7.1") assert kibana.contains("7.1.1")
def test_wazuh_plugin_installed(host): def test_wazuh_plugin_installed(host):

0
molecule/wazuh-agent/Dockerfile.j2 Normal file → Executable file
View File

0
molecule/wazuh-agent/INSTALL.rst Normal file → Executable file
View File

6
molecule/wazuh-agent/molecule.yml Normal file → Executable file
View File

@ -3,8 +3,13 @@ dependency:
name: galaxy name: galaxy
driver: driver:
name: docker name: docker
#lint:
# name: yamllint
lint: lint:
name: yamllint name: yamllint
options:
config-data:
ignore: .virtualenv
platforms: platforms:
- name: wazuh_server_centos7 - name: wazuh_server_centos7
image: milcom/centos7-systemd image: milcom/centos7-systemd
@ -72,7 +77,6 @@ provisioner:
ssl_agent_cert: null ssl_agent_cert: null
ssl_agent_key: null ssl_agent_key: null
ssl_auto_negotiate: 'no' ssl_auto_negotiate: 'no'
lint: lint:
name: ansible-lint name: ansible-lint
enabled: true enabled: true

0
molecule/wazuh-agent/playbook.yml Normal file → Executable file
View File

0
molecule/wazuh-agent/prepare.yml Normal file → Executable file
View File

5
molecule/wazuh-agent/tests/test_agents.py Normal file → Executable file
View File

@ -7,6 +7,11 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('agent') os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('agent')
def get_wazuh_version():
"""This return the version of Wazuh."""
return "3.9.0"
def test_ossec_package_installed(Package): def test_ossec_package_installed(Package):
ossec = Package('wazuh-agent') ossec = Package('wazuh-agent')
assert ossec.is_installed assert ossec.is_installed

0
molecule/wazuh-agent/tests/test_manager.py Normal file → Executable file
View File

0
playbooks/wazuh-agent.yml Normal file → Executable file
View File

0
playbooks/wazuh-elastic.yml Normal file → Executable file
View File

0
playbooks/wazuh-elastic_stack-distributed.yml Normal file → Executable file
View File

0
playbooks/wazuh-elastic_stack-single.yml Normal file → Executable file
View File

0
playbooks/wazuh-kibana.yml Normal file → Executable file
View File

0
playbooks/wazuh-manager.yml Normal file → Executable file
View File

0
roles/ansible-galaxy/meta/main.yml Normal file → Executable file
View File

0
roles/elastic-stack/ansible-elasticsearch/README.md Normal file → Executable file
View File

View File

View File

View File

View File

@ -14,17 +14,47 @@
- ansible_distribution == "Ubuntu" - ansible_distribution == "Ubuntu"
- ansible_distribution_major_version | int == 14 - ansible_distribution_major_version | int == 14
- name: Update and upgrade apt packages
become: true
apt:
upgrade: yes
update_cache: yes
cache_valid_time: 86400 #One day
when:
- ansible_distribution == "Ubuntu"
- ansible_distribution_major_version | int == 14
- name: Install Oracle Java 8
become: yes
apt: name=openjdk-8-jdk state=latest
when:
- ansible_distribution == "Ubuntu"
- ansible_distribution_major_version | int == 14
- name: Update and upgrade apt packages
become: true
apt:
upgrade: yes
update_cache: yes
cache_valid_time: 86400 #One day
when:
- ansible_distribution == "Ubuntu"
- ansible_distribution_major_version | int == 14
- name: Debian/Ubuntu | Add Elasticsearch GPG key. - name: Debian/Ubuntu | Add Elasticsearch GPG key.
apt_key: apt_key:
url: "https://artifacts.elastic.co/GPG-KEY-elasticsearch" url: "https://artifacts.elastic.co/GPG-KEY-elasticsearch"
state: present state: present
- name: Debian/Ubuntu | Install Elastic repo - name: Debian/Ubuntu | Install Elastic repo
apt_repository: apt_repository:
repo: 'deb https://artifacts.elastic.co/packages/7.x/apt stable main' repo: 'deb https://artifacts.elastic.co/packages/7.x/apt stable main'
state: present state: present
filename: 'elastic_repo' filename: 'elastic_repo'
update_cache: true update_cache: true
changed_when: false
- name: Debian/Ubuntu | Install Elasticsarch - name: Debian/Ubuntu | Install Elasticsarch
apt: apt:

View File

View File

View File

@ -9,6 +9,13 @@
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

View File

@ -197,7 +197,29 @@
when: when:
- elasticsearch_xpack_security - elasticsearch_xpack_security
- name: Reload systemd - name: Trusty | set MAX_LOCKED_MEMORY=unlimited in Elasticsearch in /etc/security/limits.conf
lineinfile:
path: /etc/security/limits.conf
line: elasticsearch - memlock unlimited
create: yes
become: yes
when:
- ansible_distribution == "Ubuntu"
- ansible_distribution_major_version | int == 14
changed_when: false
- name: Trusty | set MAX_LOCKED_MEMORY=unlimited in Elasticsearch in /etc/security/limits.d/elasticsearch.conf
lineinfile:
path: /etc/security/limits.d/elasticsearch.conf
line: elasticsearch - memlock unlimited
create: yes
become: yes
changed_when: false
when:
- ansible_distribution == "Ubuntu"
- ansible_distribution_major_version | int == 14
- name: Distribution != one of [ centos 6.*, trusty ] | Reload systemd
systemd: daemon_reload=true systemd: daemon_reload=true
ignore_errors: true ignore_errors: true
when: when:
@ -206,6 +228,13 @@
- 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
@ -247,6 +276,5 @@
- import_tasks: "RMRedHat.yml" - import_tasks: "RMRedHat.yml"
when: ansible_os_family == "RedHat" when: ansible_os_family == "RedHat"
- import_tasks: "RMDebian.yml" - import_tasks: "RMDebian.yml"
when: ansible_os_family == "Debian" when: ansible_os_family == "Debian"

View File

View File

0
roles/elastic-stack/ansible-kibana/README.md Normal file → Executable file
View File

0
roles/elastic-stack/ansible-kibana/defaults/main.yml Normal file → Executable file
View File

0
roles/elastic-stack/ansible-kibana/handlers/main.yml Normal file → Executable file
View File

0
roles/elastic-stack/ansible-kibana/meta/main.yml Normal file → Executable file
View File

0
roles/elastic-stack/ansible-kibana/tasks/Debian.yml Normal file → Executable file
View File

0
roles/elastic-stack/ansible-kibana/tasks/RMDebian.yml Normal file → Executable file
View File

0
roles/elastic-stack/ansible-kibana/tasks/RMRedHat.yml Normal file → Executable file
View File

0
roles/elastic-stack/ansible-kibana/tasks/RedHat.yml Normal file → Executable file
View File

40
roles/elastic-stack/ansible-kibana/tasks/main.yml Normal file → Executable file
View File

@ -16,17 +16,17 @@
- name: Check if certificate exists locally - name: Check if certificate exists locally
stat: stat:
path: "{{node_certs_destination}}/{{ kibana_node_name }}.crt" path: "{{ node_certs_destination }}/{{ kibana_node_name }}.crt"
register: certificate_file_exists register: certificate_file_exists
when: when:
- kibana_xpack_security - kibana_xpack_security
- name: Copy key & certificate files in generator node (locally) - name: Copy key & certificate files in generator node (locally)
synchronize: synchronize:
src: "{{node_certs_source}}/{{kibana_node_name}}/" src: "{{ node_certs_source }}/{{ kibana_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
- kibana_xpack_security - kibana_xpack_security
- not certificate_file_exists.stat.exists - not certificate_file_exists.stat.exists
@ -34,25 +34,29 @@
- 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 }}"
when: when:
- node_certs_generator - node_certs_generator
- kibana_xpack_security - kibana_xpack_security
- not certificate_file_exists.stat.exists - not certificate_file_exists.stat.exists
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}}/{{kibana_node_name}}/ {{node_certs_destination}}/" command: >-
{{ rsync_path }} {{ rsync_extra_parameters }} {{ rsync_user }}@{{ node_certs_generator_ip }}:
{{ node_certs_source }}/{{ kibana_node_name }}/ {{ node_certs_destination }}/
when: when:
- not node_certs_generator - not node_certs_generator
- kibana_xpack_security - kibana_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
- kibana_xpack_security - kibana_xpack_security
@ -61,14 +65,22 @@
tags: xpack-security tags: xpack-security
- name: Ensuring certificates folder owner - name: Ensuring certificates folder owner
shell: "chown -R kibana: {{node_certs_destination}}/" file:
path: "{{ node_certs_destination }}/"
state: directory
recurse: yes
owner: kibana
group: kibana
when: when:
- check_certs_permissions is defined - check_certs_permissions is defined
- kibana_xpack_security - kibana_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
- kibana_xpack_security - kibana_xpack_security

View File

0
roles/wazuh/ansible-filebeat/README.md Normal file → Executable file
View File

2
roles/wazuh/ansible-filebeat/defaults/main.yml Normal file → Executable file
View File

@ -1,4 +1,6 @@
--- ---
filebeat_version: 7.1.1
filebeat_create_config: true filebeat_create_config: true
filebeat_prospectors: filebeat_prospectors:

0
roles/wazuh/ansible-filebeat/handlers/main.yml Normal file → Executable file
View File

0
roles/wazuh/ansible-filebeat/meta/main.yml Normal file → Executable file
View File

0
roles/wazuh/ansible-filebeat/tasks/Debian.yml Normal file → Executable file
View File

0
roles/wazuh/ansible-filebeat/tasks/RMDebian.yml Normal file → Executable file
View File

0
roles/wazuh/ansible-filebeat/tasks/RMRedHat.yml Normal file → Executable file
View File

0
roles/wazuh/ansible-filebeat/tasks/RedHat.yml Normal file → Executable file
View File

0
roles/wazuh/ansible-filebeat/tasks/config.yml Normal file → Executable file
View File

50
roles/wazuh/ansible-filebeat/tasks/main.yml Normal file → Executable file
View File

@ -5,26 +5,40 @@
- import_tasks: Debian.yml - import_tasks: Debian.yml
when: ansible_os_family == 'Debian' when: ansible_os_family == 'Debian'
- name: Install Filebeat. - name: CentOS/RedHat | Install Filebeat.
package: name=filebeat state=present package: name=filebeat-{{ filebeat_version }} state=present
register: filebeat_installing_package register: filebeat_installing_package
until: filebeat_installing_package is succeeded until: filebeat_installing_package is succeeded
when:
- ansible_distribution in ['CentOS','RedHat']
tags: tags:
- install - install
- name: Debian/Ubuntu | Install Filebeat.
apt:
name: filebeat={{ filebeat_version }}
state: present
cache_valid_time: 3600
register: filebeat_installing_package_debian
until: filebeat_installing_package_debian is succeeded
when:
- not (ansible_distribution in ['CentOS','RedHat'])
tags:
- init
- name: Check if certificate exists locally - name: Check if certificate exists locally
stat: stat:
path: "{{node_certs_destination}}/{{ filebeat_node_name }}.crt" path: "{{ node_certs_destination }}/{{ filebeat_node_name }}.crt"
register: certificate_file_exists register: certificate_file_exists
when: when:
- filebeat_xpack_security - filebeat_xpack_security
- name: Copy key & certificate files in generator node (locally) - name: Copy key & certificate files in generator node (locally)
synchronize: synchronize:
src: "{{node_certs_source}}/{{filebeat_node_name}}/" src: "{{ node_certs_source }}/{{ filebeat_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
- filebeat_xpack_security - filebeat_xpack_security
- not certificate_file_exists.stat.exists - not certificate_file_exists.stat.exists
@ -32,26 +46,30 @@
- 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 }}"
when: when:
- node_certs_generator - node_certs_generator
- filebeat_xpack_security - filebeat_xpack_security
- not certificate_file_exists.stat.exists - not certificate_file_exists.stat.exists
register: check_certs_permissions register: check_certs_permissions
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}}/{{filebeat_node_name}}/ {{node_certs_destination}}/" command: >-
{{ rsync_path }} {{ rsync_extra_parameters }} {{ rsync_user }}@{{ node_certs_generator_ip }}:
{{ node_certs_source }}/{{ filebeat_node_name }}/ {{ node_certs_destination }}/
when: when:
- not node_certs_generator - not node_certs_generator
- filebeat_xpack_security - filebeat_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
- filebeat_xpack_security - filebeat_xpack_security
@ -60,7 +78,11 @@
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
- filebeat_xpack_security - filebeat_xpack_security

View File

0
roles/wazuh/ansible-filebeat/templates/filebeat.yml.j2 Normal file → Executable file
View File

0
roles/wazuh/ansible-filebeat/tests/requirements.yml Normal file → Executable file
View File

0
roles/wazuh/ansible-filebeat/tests/test.yml Normal file → Executable file
View File

0
roles/wazuh/ansible-wazuh-agent/README.md Normal file → Executable file
View File

5
roles/wazuh/ansible-wazuh-agent/defaults/main.yml Normal file → Executable file
View File

@ -1,4 +1,5 @@
--- ---
wazuh_agent_version: 3.9.0
wazuh_managers: wazuh_managers:
- address: 127.0.0.1 - address: 127.0.0.1
port: 1514 port: 1514
@ -23,10 +24,10 @@ 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.2' version: '3.9.3'
revision: '1' revision: '1'
repo: https://packages.wazuh.com/3.x/windows/ repo: https://packages.wazuh.com/3.x/windows/
md5: 43936e7bc7eb51bd186f47dac4a6f477 md5: c3fdbd6c121ca371b8abcd477ed4e8a4
wazuh_agent_config: wazuh_agent_config:
active_response: active_response:
ar_disabled: 'no' ar_disabled: 'no'

0
roles/wazuh/ansible-wazuh-agent/handlers/main.yml Normal file → Executable file
View File

0
roles/wazuh/ansible-wazuh-agent/meta/main.yml Normal file → Executable file
View File

0
roles/wazuh/ansible-wazuh-agent/tasks/Debian.yml Normal file → Executable file
View File

18
roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml Normal file → Executable file
View File

@ -5,10 +5,22 @@
- import_tasks: "Debian.yml" - import_tasks: "Debian.yml"
when: ansible_os_family == "Debian" when: ansible_os_family == "Debian"
- name: Linux | Install wazuh-agent - name: Linux CentOS/RedHat | Install wazuh-agent
package: name=wazuh-agent state=present package: name=wazuh-agent-{{ wazuh_agent_version }}-1 state=present
async: 90 async: 90
poll: 15 poll: 30
when:
- ansible_distribution in ['CentOS','RedHat']
tags:
- init
- name: Linux Debian | Install wazuh-agent
apt:
name: "wazuh-agent={{ wazuh_agent_version }}-1"
state: present
cache_valid_time: 3600
when:
- not (ansible_distribution in ['CentOS','RedHat'])
tags: tags:
- init - init

0
roles/wazuh/ansible-wazuh-agent/tasks/RMDebian.yml Normal file → Executable file
View File

0
roles/wazuh/ansible-wazuh-agent/tasks/RMRedHat.yml Normal file → Executable file
View File

0
roles/wazuh/ansible-wazuh-agent/tasks/RedHat.yml Normal file → Executable file
View File

0
roles/wazuh/ansible-wazuh-agent/tasks/Windows.yml Normal file → Executable file
View File

0
roles/wazuh/ansible-wazuh-agent/tasks/main.yml Normal file → Executable file
View File

Some files were not shown because too many files have changed in this diff Show More