Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollover alias script execution added #1110

Merged
merged 4 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion roles/wazuh/vars/repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ wazuh_macos_arm_package_url: "https://packages.wazuh.com/4.x/macos/{{ wazuh_maco
certs_gen_tool_version: 4.8

# Url of certificates generator tool
certs_gen_tool_url: "https://packages.wazuh.com/{{ certs_gen_tool_version }}/wazuh-certs-tool.sh"
certs_gen_tool_url: "https://packages.wazuh.com/{{ certs_gen_tool_version }}/wazuh-certs-tool.sh"
2 changes: 1 addition & 1 deletion roles/wazuh/vars/repo_pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ wazuh_macos_arm_package_url: "https://packages-dev.wazuh.com/pre-release/macos/{
certs_gen_tool_version: 4.8

# Url of certificates generator tool
certs_gen_tool_url: "https://packages-dev.wazuh.com/{{ certs_gen_tool_version }}/wazuh-certs-tool.sh"
certs_gen_tool_url: "https://packages-dev.wazuh.com/{{ certs_gen_tool_version }}/wazuh-certs-tool.sh"
2 changes: 1 addition & 1 deletion roles/wazuh/vars/repo_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ wazuh_macos_arm_package_url: "https://packages-dev.wazuh.com/staging/macos/{{ wa
certs_gen_tool_version: 4.8

# Url of certificates generator tool
certs_gen_tool_url: "https://packages-dev.wazuh.com/{{ certs_gen_tool_version }}/wazuh-certs-tool.sh"
certs_gen_tool_url: "https://packages-dev.wazuh.com/{{ certs_gen_tool_version }}/wazuh-certs-tool.sh"
1 change: 1 addition & 0 deletions roles/wazuh/wazuh-indexer/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ domain_name: wazuh.com

indexer_sec_plugin_conf_path: /etc/wazuh-indexer/opensearch-security
indexer_sec_plugin_tools_path: /usr/share/wazuh-indexer/plugins/opensearch-security/tools
indexer_bin_path: /usr/share/wazuh-indexer/bin
indexer_conf_path: /etc/wazuh-indexer
indexer_index_path: /var/lib/wazuh-indexer/

Expand Down
18 changes: 13 additions & 5 deletions roles/wazuh/wazuh-indexer/tasks/security_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,31 @@
{{ indexer_sec_plugin_tools_path }}/hash.sh -p '{{ indexer_admin_password }}'
register: indexer_admin_password_hashed
no_log: '{{ indexer_nolog_sensible | bool }}'

- name: Set the Admin user password
replace:
path: "{{ indexer_sec_plugin_conf_path }}/internal_users.yml"
regexp: '(?<=admin:\n hash: )(.*)(?=)'
replace: "{{ indexer_password_hash | quote }}"
vars:
indexer_password_hash: "{{ indexer_admin_password_hashed.stdout_lines | last }}"

# this can also be achieved with password_hash, but it requires dependencies on the controller
- name: Hash the kibanaserver role/user pasword
shell: |
export JAVA_HOME=/usr/share/wazuh-indexer/jdk
{{ indexer_sec_plugin_tools_path }}/hash.sh -p '{{ dashboard_password }}'
register: indexer_kibanaserver_password_hashed
no_log: '{{ indexer_nolog_sensible | bool }}'

- name: Set the kibanaserver user password
replace:
path: "{{ indexer_sec_plugin_conf_path }}/internal_users.yml"
regexp: '(?<=kibanaserver:\n hash: )(.*)(?=)'
replace: "{{ indexer_password_hash | quote }}"
vars:
indexer_password_hash: "{{ indexer_kibanaserver_password_hashed.stdout_lines | last }}"

- name: Initialize the Opensearch security index in Wazuh indexer
command: >
sudo -u wazuh-indexer OPENSEARCH_PATH_CONF={{ indexer_conf_path }}
Expand All @@ -93,8 +93,16 @@
delay: 5
register: result
until: result.rc == 0
run_once: true

- name: Initialize ISM script
command: >
{{ indexer_bin_path }}/indexer-ism-init.sh
-p {{ indexer_admin_password }}
-i {{ target_address }}
become: yes
become_user: root

run_once: true

- name: Create custom user
uri:
Expand Down
Loading