Skip to content

Commit 0d10560

Browse files
committed
Update password generation method.
2 parents 65029a2 + 0f01703 commit 0d10560

File tree

3 files changed

+2
-55
lines changed

3 files changed

+2
-55
lines changed

etc/kayobe/ansible/scripts/pwgen.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

etc/kayobe/ansible/templates/wazuh-secrets.yml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ secrets_wazuh:
77
# Strengthen default wazuh api user pass
88
wazuh_api_users:
99
- username: "wazuh"
10-
password: "{{ secrets_wazuh.wazuh_api_users[0].password | default(wazuh_password) }}"
10+
password: "{{ secrets_wazuh.wazuh_api_users[0].password | default(lookup('community.general.random_string', min_lower=1, min_upper=1, min_special=1, min_numeric=1, length=30)) }}"
1111
# OpenSearch 'admin' user pass
1212
opendistro_admin_password: "{{ secrets_wazuh.opendistro_admin_password | default(lookup('password', '/dev/null'), true) }}"
1313
# OpenSearch 'kibanaserver' user pass

etc/kayobe/ansible/wazuh-secrets.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,6 @@
1414
path: "{{ wazuh_secrets_path | dirname }}"
1515
state: directory
1616

17-
- name: Generate a random password which meets the Wazuh password requirements
18-
no_log: True
19-
command:
20-
cmd: python3 scripts/pwgen.py
21-
register: random_password
22-
23-
- name: Store the valid password
24-
no_log: True
25-
set_fact:
26-
wazuh_password: "{{ random_password.stdout }}"
27-
2817
- name: Template new secrets
2918
no_log: True
3019
template:
@@ -37,5 +26,4 @@
3726
dest: "{{ wazuh_secrets_path }}"
3827
decrypt: false
3928
vars:
40-
ansible_vault_password: "{{ lookup('ansible.builtin.env', 'KAYOBE_VAULT_PASSWORD') }}"
41-
29+
ansible_vault_password: "{{ lookup('ansible.builtin.env', 'KAYOBE_VAULT_PASSWORD') }}"

0 commit comments

Comments
 (0)