Indexer and dashboard variables names updated

This commit is contained in:
Gonzalo Acuña 2022-02-07 17:01:52 -03:00
parent d67ae78712
commit a5441ddc8a
No known key found for this signature in database
GPG Key ID: 646BA79A313A2270
21 changed files with 50 additions and 48 deletions

View File

@ -180,7 +180,7 @@ The hereunder example playbook uses the `wazuh-ansible` role to provision a prod
nodes: nodes:
- "{{ hostvars.manager.private_ip }}" - "{{ hostvars.manager.private_ip }}"
hidden: 'no' hidden: 'no'
filebeat_output_elasticsearch_hosts: filebeat_output_indexer_hosts:
- "{{ hostvars.es1.private_ip }}" - "{{ hostvars.es1.private_ip }}"
- "{{ hostvars.es2.private_ip }}" - "{{ hostvars.es2.private_ip }}"
- "{{ hostvars.es3.private_ip }}" - "{{ hostvars.es3.private_ip }}"
@ -209,7 +209,7 @@ The hereunder example playbook uses the `wazuh-ansible` role to provision a prod
nodes: nodes:
- "{{ hostvars.manager.private_ip }}" - "{{ hostvars.manager.private_ip }}"
hidden: 'no' hidden: 'no'
filebeat_output_elasticsearch_hosts: filebeat_output_indexer_hosts:
- "{{ hostvars.es1.private_ip }}" - "{{ hostvars.es1.private_ip }}"
- "{{ hostvars.es2.private_ip }}" - "{{ hostvars.es2.private_ip }}"
- "{{ hostvars.es3.private_ip }}" - "{{ hostvars.es3.private_ip }}"
@ -319,7 +319,7 @@ The hereunder example playbook uses the `wazuh-ansible` role to provision a sing
elasticsearch_node_master: true elasticsearch_node_master: true
elasticsearch_network_host: <your server host> elasticsearch_network_host: <your server host>
filebeat_node_name: node-1 filebeat_node_name: node-1
filebeat_output_elasticsearch_hosts: <your server host> filebeat_output_indexer_hosts: <your server host>
ansible_ssh_user: vagrant ansible_ssh_user: vagrant
ansible_ssh_private_key_file: /path/to/ssh/key.pem ansible_ssh_private_key_file: /path/to/ssh/key.pem
ansible_ssh_extra_args: '-o StrictHostKeyChecking=no' ansible_ssh_extra_args: '-o StrictHostKeyChecking=no'

View File

@ -3,7 +3,7 @@
roles: roles:
- role: ../roles/wazuh/ansible-wazuh-manager - role: ../roles/wazuh/ansible-wazuh-manager
- role: ../roles/wazuh/ansible-filebeat-oss - role: ../roles/wazuh/ansible-filebeat-oss
filebeat_output_elasticsearch_hosts: filebeat_output_indexer_hosts:
- "<elastic-node-1>:9200" - "<elastic-node-1>:9200"
- "<elastic-node-2>:9200" - "<elastic-node-2>:9200"
- "<elastic-node-2>:9200" - "<elastic-node-2>:9200"

View File

@ -2,7 +2,7 @@
# Certificates generation # Certificates generation
- hosts: es1 - hosts: es1
roles: roles:
- role: ../roles/opendistro/opendistro-elasticsearch - role: ../roles/opensearch/wazuh-indexer
elasticsearch_network_host: "{{ private_ip }}" elasticsearch_network_host: "{{ private_ip }}"
elasticsearch_cluster_nodes: elasticsearch_cluster_nodes:
- "{{ hostvars.es1.private_ip }}" - "{{ hostvars.es1.private_ip }}"
@ -43,7 +43,7 @@
- hosts: odfe_cluster - hosts: odfe_cluster
strategy: free strategy: free
roles: roles:
- role: ../roles/opendistro/opendistro-elasticsearch - role: ../roles/opensearch/wazuh-indexer
elasticsearch_network_host: "{{ private_ip }}" elasticsearch_network_host: "{{ private_ip }}"
become: yes become: yes
become_user: root become_user: root
@ -105,7 +105,7 @@
wazuh_api_users: wazuh_api_users:
- username: custom-user - username: custom-user
password: .S3cur3Pa55w0rd*- password: .S3cur3Pa55w0rd*-
filebeat_output_elasticsearch_hosts: filebeat_output_indexer_hosts:
- "{{ hostvars.es1.private_ip }}" - "{{ hostvars.es1.private_ip }}"
- "{{ hostvars.es2.private_ip }}" - "{{ hostvars.es2.private_ip }}"
- "{{ hostvars.es3.private_ip }}" - "{{ hostvars.es3.private_ip }}"
@ -134,7 +134,7 @@
nodes: nodes:
- "{{ hostvars.manager.private_ip }}" - "{{ hostvars.manager.private_ip }}"
hidden: 'no' hidden: 'no'
filebeat_output_elasticsearch_hosts: filebeat_output_indexer_hosts:
- "{{ hostvars.es1.private_ip }}" - "{{ hostvars.es1.private_ip }}"
- "{{ hostvars.es2.private_ip }}" - "{{ hostvars.es2.private_ip }}"
- "{{ hostvars.es3.private_ip }}" - "{{ hostvars.es3.private_ip }}"
@ -142,8 +142,8 @@
#ODFE+Kibana node #ODFE+Kibana node
- hosts: kibana - hosts: kibana
roles: roles:
- role: "../roles/opendistro/opendistro-elasticsearch" - role: "../roles/opensearch/wazuh-indexer"
- role: "../roles/opendistro/opendistro-kibana" - role: "../roles/opensearch/wazuh-dashboard"
become: yes become: yes
become_user: root become_user: root
vars: vars:

View File

@ -4,17 +4,17 @@
become: yes become: yes
become_user: root become_user: root
roles: roles:
- role: ../roles/opendistro/opendistro-elasticsearch - role: ../roles/opensearch/wazuh-indexer
- role: ../roles/wazuh/ansible-wazuh-manager - role: ../roles/wazuh/ansible-wazuh-manager
- role: ../roles/wazuh/ansible-filebeat-oss - role: ../roles/wazuh/ansible-filebeat-oss
- role: ../roles/opendistro/opendistro-kibana - role: ../roles/opensearch/wazuh-dashboard
vars: vars:
single_node: true single_node: true
minimum_master_nodes: 1 minimum_master_nodes: 1
elasticsearch_node_master: true elasticsearch_node_master: true
elasticsearch_network_host: 127.0.0.1 elasticsearch_network_host: 127.0.0.1
filebeat_node_name: node-1 filebeat_node_name: node-1
filebeat_output_elasticsearch_hosts: 127.0.0.1 filebeat_output_indexer_hosts: 127.0.0.1
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.

View File

@ -1,6 +1,6 @@
--- ---
- hosts: es1 - hosts: es1
roles: roles:
- role: ../roles/opendistro/opendistro-kibana - role: ../roles/opensearch/wazuh-dashboard
vars: vars:
ansible_shell_allow_world_readable_temp: true ansible_shell_allow_world_readable_temp: true

View File

@ -1,7 +1,7 @@
--- ---
- hosts: es_cluster - hosts: es_cluster
roles: roles:
- role: ../roles/opendistro/opendistro-elasticsearch - role: ../roles/opensearch/wazuh-indexer
vars: vars:
instances: # A certificate will be generated for every node using the name as CN. instances: # A certificate will be generated for every node using the name as CN.

View File

@ -49,7 +49,7 @@ dashboard_security: true
#kibana_telemetry_enabled: "false" #kibana_telemetry_enabled: "false"
indexer_admin_password: changeme indexer_admin_password: changeme
dashboard_user: dashboardserver dashboard_user: kibanaserver
dashboard_password: changeme dashboard_password: changeme
local_certs_path: "{{ playbook_dir }}/indexer/certificates" local_certs_path: "{{ playbook_dir }}/indexer/certificates"

View File

@ -7,7 +7,7 @@
url: "{{ package_repos.apt.dashboard.gpg }}" url: "{{ package_repos.apt.dashboard.gpg }}"
state: present state: present
- name: Debian systems | Add OpenDistro repo - name: Debian systems | Add Wazuh-Dashboard repo
apt_repository: apt_repository:
repo: "{{ package_repos.apt.dashboard.baseurl }}" repo: "{{ package_repos.apt.dashboard.baseurl }}"
state: present state: present

View File

@ -15,8 +15,8 @@ indexer_start_timeout: 90
#elasticsearch_lower_disk_requirements: false #elasticsearch_lower_disk_requirements: false
indexer_cluster_nodes: indexer_cluster_nodes:
- 127.0.0.1 - 127.0.0.1
#elasticsearch_discovery_nodes: indexer_discovery_nodes:
# - 127.0.0.1 - 127.0.0.1
local_certs_path: "{{ playbook_dir }}/indexer/certificates" local_certs_path: "{{ playbook_dir }}/indexer/certificates"
##check if it is the correct directory ##check if it is the correct directory

View File

@ -45,11 +45,11 @@
url: "{{ package_repos.apt.indexer.gpg }}" url: "{{ package_repos.apt.indexer.gpg }}"
state: present state: present
- name: Add Opendistro repository - name: Add Indexer repository
apt_repository: apt_repository:
repo: "{{ package_repos.apt.indexer.baseurl }}" repo: "{{ package_repos.apt.indexer.baseurl }}"
state: present state: present
filename: 'wazuh-opendistro' filename: 'wazuh-indexer'
update_cache: yes update_cache: yes
- name: Install Wazuh-Indexer - name: Install Wazuh-Indexer

View File

@ -1,7 +1,7 @@
--- ---
- name: RedHat/CentOS/Fedora | Remove Elasticsearch repository (and clean up left-over metadata) - name: RedHat/CentOS/Fedora | Remove Wazuh-Indexer repository (and clean up left-over metadata)
## 732 will not be needed and if it is needed the wazuh repo should be removed. ## 732 will not be needed and if it is needed the wazuh repo should be removed.
yum_repository: yum_repository:
name: opendistro_repo name: wazuh_repo
state: absent state: absent
changed_when: false changed_when: false

View File

@ -46,7 +46,7 @@
when: when:
- ansible_distribution == 'Amazon' - ansible_distribution == 'Amazon'
- name: RedHat/CentOS/Fedora | Install OpenDistro dependencies - name: RedHat/CentOS/Fedora | Install Indexer dependencies
yum: yum:
name: "{{ packages }}" name: "{{ packages }}"
vars: vars:

View File

@ -91,7 +91,7 @@
state: absent state: absent
with_items: "{{ files_to_delete.files }}" with_items: "{{ files_to_delete.files }}"
- name: Ensure Elasticsearch started and enabled - name: Ensure Wazuh-Indexer started and enabled
## 732 the service name should be updated ## 732 the service name should be updated
service: service:
name: wazuh-indexer name: wazuh-indexer
@ -101,7 +101,7 @@
- name: Wait for Wazuh-Indexer API - name: Wait for Wazuh-Indexer API
uri: uri:
url: "https://{{ inventory_hostname if not single_node else indexer_network_host }}:{{ indexer_http_port }}/_cat/health/" url: "https://{{ inventory_hostname if not single_node else indexer_network_host }}:{{ indexer_http_port }}/_cat/health/"
user: "admin" # Default OpenDistro user is always "admin" user: "admin" # Default Indexer user is always "admin"
password: "{{ indexer_admin_password }}" password: "{{ indexer_admin_password }}"
validate_certs: no validate_certs: no
status_code: 200,401 status_code: 200,401
@ -117,10 +117,10 @@
when: when:
- hostvars[inventory_hostname]['private_ip'] is not defined or not hostvars[inventory_hostname]['private_ip'] - hostvars[inventory_hostname]['private_ip'] is not defined or not hostvars[inventory_hostname]['private_ip']
- name: Wait for Elasticsearch API (Private IP) - name: Wait for Wazuh-Indexer API (Private IP)
uri: uri:
url: "https://{{ hostvars[inventory_hostname]['private_ip'] if not single_node else indexer_network_host }}:{{ indexer_http_port }}/_cat/health/" url: "https://{{ hostvars[inventory_hostname]['private_ip'] if not single_node else indexer_network_host }}:{{ indexer_http_port }}/_cat/health/"
user: "admin" # Default OpenDistro user is always "admin" user: "admin" # Default Indexer user is always "admin"
password: "{{ indexer_admin_password }}" password: "{{ indexer_admin_password }}"
validate_certs: no validate_certs: no
status_code: 200,401 status_code: 200,401

View File

@ -22,7 +22,7 @@
- hostvars[inventory_hostname]['private_ip'] is not defined - hostvars[inventory_hostname]['private_ip'] is not defined
- name: Copy the node & admin certificates to Elasticsearch cluster - name: Copy the node & admin certificates to Wazuh-Indexer cluster
copy: copy:
src: "{{ local_certs_path }}/certs/{{ item }}" src: "{{ local_certs_path }}/certs/{{ item }}"
dest: "{{ indexer_conf_path }}/certs/" dest: "{{ indexer_conf_path }}/certs/"
@ -55,12 +55,12 @@
# replace: 'opendistro_security' # replace: 'opendistro_security'
# tags: local # tags: local
- name: Restart elasticsearch with security configuration - name: Restart Wazuh-Indexer with security configuration
systemd: systemd:
name: wazuh-indexer name: wazuh-indexer
state: restarted state: restarted
- name: Copy the OpenDistro security internal users template - name: Copy the Opensearch security internal users template
template: template:
src: "templates/internal_users.yml.j2" src: "templates/internal_users.yml.j2"
dest: "{{ indexer_sec_plugin_conf_path }}/internal_users.yml" dest: "{{ indexer_sec_plugin_conf_path }}/internal_users.yml"
@ -77,15 +77,15 @@
replace: replace:
path: "{{ indexer_sec_plugin_conf_path }}/internal_users.yml" path: "{{ indexer_sec_plugin_conf_path }}/internal_users.yml"
regexp: '(?<=admin:\n hash: )(.*)(?=)' regexp: '(?<=admin:\n hash: )(.*)(?=)'
replace: "{{ odfe_password_hash | quote }}" replace: "{{ indexer_password_hash | quote }}"
vars: vars:
odfe_password_hash: "{{ indexer_admin_password_hashed.stdout_lines | last }}" indexer_password_hash: "{{ indexer_admin_password_hashed.stdout_lines | last }}"
run_once: true run_once: true
# this can also be achieved with password_hash, but it requires dependencies on the controller # this can also be achieved with password_hash, but it requires dependencies on the controller
- name: Hash the kibanaserver role/user pasword - name: Hash the kibanaserver role/user pasword
command: "{{ indexer_sec_plugin_tools_path }}/hash.sh -p {{ dashboard_password }}" # noqa 301 command: "{{ indexer_sec_plugin_tools_path }}/hash.sh -p {{ dashboard_password }}" # noqa 301
register: opendistro_kibanaserver_password_hashed register: indexer_kibanaserver_password_hashed
no_log: '{{ indexer_nolog_sensible | bool }}' no_log: '{{ indexer_nolog_sensible | bool }}'
run_once: true run_once: true
@ -93,12 +93,12 @@
replace: replace:
path: "{{ indexer_sec_plugin_conf_path }}/internal_users.yml" path: "{{ indexer_sec_plugin_conf_path }}/internal_users.yml"
regexp: '(?<=kibanaserver:\n hash: )(.*)(?=)' regexp: '(?<=kibanaserver:\n hash: )(.*)(?=)'
replace: "{{ odfe_password_hash | quote }}" replace: "{{ indexer_password_hash | quote }}"
vars: vars:
odfe_password_hash: "{{ opendistro_kibanaserver_password_hashed.stdout_lines | last }}" indexer_password_hash: "{{ indexer_kibanaserver_password_hashed.stdout_lines | last }}"
run_once: true run_once: true
- name: Initialize the OpenDistro security index in elasticsearch - name: Initialize the Opensearch security index in Wazuh-Indexer
command: > command: >
sudo -u wazuh-indexer OPENSEARCH_PATH_CONF={{ indexer_conf_path }} sudo -u wazuh-indexer OPENSEARCH_PATH_CONF={{ indexer_conf_path }}
JAVA_HOME=/usr/share/wazuh-indexer/jdk JAVA_HOME=/usr/share/wazuh-indexer/jdk
@ -116,7 +116,7 @@
uri: uri:
url: "https://{{ target_address }}:{{ indexer_http_port }}/_plugins/_security/api/internalusers/{{ indexer_custom_user }}" url: "https://{{ target_address }}:{{ indexer_http_port }}/_plugins/_security/api/internalusers/{{ indexer_custom_user }}"
method: PUT method: PUT
user: "admin" # Default OpenDistro user is always "admin" user: "admin" # Default Indexer user is always "admin"
password: "{{ indexer_admin_password }}" password: "{{ indexer_admin_password }}"
body: | body: |
{ {

View File

@ -1,6 +1,7 @@
nodes: nodes:
# Elasticsearch server nodes # Elasticsearch server nodes
elasticsearch: elasticsearch:
## 732 this will change to indexer:
{% for (key,value) in instances.items() %} {% for (key,value) in instances.items() %}
{% if (value.role is defined and value.role == 'indexer') %} {% if (value.role is defined and value.role == 'indexer') %}
name: {{ value.name }} name: {{ value.name }}
@ -25,6 +26,7 @@ nodes:
# Kibana node # Kibana node
kibana: kibana:
## 732 this will change to dashboards:
{% for (key,value) in instances.items() %} {% for (key,value) in instances.items() %}
{% if (value.role is defined and value.role == 'dashboard') %} {% if (value.role is defined and value.role == 'dashboard') %}
name: {{ value.name }} name: {{ value.name }}

View File

@ -9,7 +9,7 @@ cluster.initial_master_nodes:
{% endfor %} {% endfor %}
discovery.seed_hosts: discovery.seed_hosts:
{% for item in elasticsearch_discovery_nodes %} {% for item in indexer_discovery_nodes %}
- {{ item }} - {{ item }}
{% endfor %} {% endfor %}
{% endif %} {% endif %}

View File

@ -19,7 +19,7 @@ Role Variables
Available variables are listed below, along with default values (see `defaults/main.yml`): Available variables are listed below, along with default values (see `defaults/main.yml`):
``` ```
filebeat_output_elasticsearch_hosts: filebeat_output_indexer_hosts:
- "localhost:9200" - "localhost:9200"
``` ```

View File

@ -3,7 +3,7 @@ filebeat_version: 7.10.2
wazuh_template_branch: v4.2.5 wazuh_template_branch: v4.2.5
filebeat_output_elasticsearch_hosts: filebeat_output_indexer_hosts:
- "localhost:9700" - "localhost:9700"
#filebeat_module_package_url: https://packages.wazuh.com/4.x/filebeat #filebeat_module_package_url: https://packages.wazuh.com/4.x/filebeat
@ -18,7 +18,7 @@ indexer_security_password: changeme
filebeat_security: true filebeat_security: true
filebeat_ssl_dir: /etc/pki/filebeat filebeat_ssl_dir: /etc/pki/filebeat
# Local path to store the generated certificates (OpenDistro security plugin) # Local path to store the generated certificates (Opensearch security plugin)
local_certs_path: ./indexer/certificates local_certs_path: ./indexer/certificates
filebeatrepo: filebeatrepo:

View File

@ -1,6 +1,6 @@
--- ---
- name: RedHat/CentOS/Fedora | Remove Filebeat repository (and clean up left-over metadata) - name: RedHat/CentOS/Fedora | Remove Filebeat repository (and clean up left-over metadata)
yum_repository: yum_repository:
name: elastic_oss-repo_7 name: wazuh_repo
state: absent state: absent
changed_when: false changed_when: false

View File

@ -1,8 +1,8 @@
--- ---
- name: RedHat/CentOS/Fedora/Amazon Linux | Install Filebeats repo - name: RedHat/CentOS/Fedora/Amazon Linux | Install Filebeats repo
yum_repository: yum_repository:
name: elastic_oss-repo_7 name: wazuh_repo
description: Elastic repository for 7.x packages description: Wazuh Repo
baseurl: "{{ filebeatrepo.yum }}" baseurl: "{{ filebeatrepo.yum }}"
gpgkey: "{{ filebeatrepo.gpg }}" gpgkey: "{{ filebeatrepo.gpg }}"
gpgcheck: true gpgcheck: true

View File

@ -14,9 +14,9 @@ setup.template.json.name: 'wazuh'
setup.template.overwrite: true setup.template.overwrite: true
setup.ilm.enabled: false setup.ilm.enabled: false
# Send events directly to Elasticsearch # Send events directly to Opensearch
output.elasticsearch: output.elasticsearch:
hosts: {{ filebeat_output_elasticsearch_hosts | to_json }} hosts: {{ filebeat_output_indexer_hosts | to_json }}
{% if filebeat_security %} {% if filebeat_security %}
username: {{ indexer_security_user }} username: {{ indexer_security_user }}
@ -28,5 +28,5 @@ output.elasticsearch:
ssl.key: "{{ filebeat_ssl_dir }}/{{ filebeat_node_name }}-key.pem" ssl.key: "{{ filebeat_ssl_dir }}/{{ filebeat_node_name }}-key.pem"
{% endif %} {% endif %}
# Optional. Send events to Logstash instead of Elasticsearch # Optional. Send events to Logstash instead of Opensearch
#output.logstash.hosts: ["YOUR_LOGSTASH_SERVER_IP:5000"] #output.logstash.hosts: ["YOUR_LOGSTASH_SERVER_IP:5000"]