Skip to content

Commit c3eab15

Browse files
Make logstash_writer user password hashing idempotent (#249)
Using randomly created hashes for our hash algorithm will break idempotency. Besides, it will lead to the `logstash_writer` user template being recreated with every run. I'm not sure if changing the contents every time can't have any more side effects we can circumvent by just using a fixed hash. fixes #247 fixes #251 fixes #244 --------- Co-authored-by: Afeef Ghannam <afeef.ghannam@netways.de> Co-authored-by: Afeef Ghannam <39904920+afeefghannam89@users.noreply.github.com>
1 parent a65d969 commit c3eab15

File tree

30 files changed

+108
-70
lines changed

30 files changed

+108
-70
lines changed

.github/workflows/test_full_stack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
strategy:
3333
fail-fast: false
34-
max-parallel: 4
34+
max-parallel: 2
3535
matrix:
3636
distro:
3737
- rockylinux8

.github/workflows/test_roles_pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ jobs:
4747

4848
strategy:
4949
fail-fast: false
50-
max-parallel: 4
50+
max-parallel: 2
5151
matrix:
5252
distro:
53-
- ubuntu2204
5453
- rockylinux8
54+
- ubuntu2204
5555
scenario:
5656
- elasticstack_default
5757
release:

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ Make sure all hosts that should be configured are part of your playbook. (See be
6969

7070
You will want to have reliable DNS resolution or enter all hosts of the stack into your systems hosts files.
7171

72+
The variable `elasticstack_no_log` can be set to `false` if you want to see the output of all tasks. It defaults to `true` because some tasks could reveal passwords in production.
73+
7274
### Versioning
7375

7476
*elasticstack_version*: Version number of tools to install. Only set if you don't want the latest. (default: none).

docs/role-logstash.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ Aside from `logstash.yml` we can manage Logstashs pipelines.
6767
* *logstash_security*: Enable X-Security (No default set, but will be activated when in full stack mode)
6868
* *logstash_user*: Name of the user to connect to Elasticsearch (Default: `logstash_writer`)
6969
* *logstash_password_hash*: Generate and use a hash from your `logstash_password` (default: `true`)
70+
* *logstash_password_hash_algorithm*: Password hashing algorithms. Value must be same as `xpack.security.authc.password_hashing.algorithm` (default: `bcrypt`)
71+
* *logstash_password_salt_length*: base64 encoded Salt character lenght. This value must be integer and must be compatible to the selected password hashing algorithms (default: `22`)
72+
**logstash_password_hash_salt_seed*: A seed to generate random but idempotent salt on the elasticstack ca host. The salt will be used to create idempotent logstash hashed user password (default: `SeedChangeMe`)
7073
* *logstash_password*: Password of Elasticsearch user. It must be at least 6 characters long (default: `password`)
7174
* *logstash_user_indices*: Indices the user has access to (default: `'"ecs-logstash*", "logstash*", "logs*"'`)
7275
* *logstash_reset_writer_role*: Reset user and role with every run: (default: `true`)

molecule/beats_default/converge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
elasticsearch_jna_workaround: true
1313
elasticsearch_disable_systemcallfilterchecks: true
1414
elasticstack_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
15+
elasticstack_no_log: false
1516
tasks:
1617
- name: Include Elastics repos role
1718
ansible.builtin.include_role:

molecule/beats_peculiar/converge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
elasticsearch_jna_workaround: true
2222
elasticsearch_disable_systemcallfilterchecks: true
2323
elasticstack_full_stack: false
24+
elasticstack_no_log: false
2425
beats_filebeat_mysql_slowlog_input: true
2526
beats_auditbeat: true
2627
beats_auditbeat_output: logstash

molecule/elasticsearch_cluster-oss/converge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
elasticsearch_disable_systemcallfilterchecks: true
1212
elasticstack_release: 7
1313
elasticsearch_heap: "1"
14+
elasticstack_no_log: false
1415
tasks:
1516
- name: Include Elastics repos role
1617
ansible.builtin.include_role:

molecule/elasticsearch_no-security/converge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
elasticsearch_disable_systemcallfilterchecks: true
1313
elasticsearch_heap: "1"
1414
elasticstack_release: 7
15+
elasticstack_no_log: false
1516
tasks:
1617
- name: Include Elastics repos role
1718
ansible.builtin.include_role:

molecule/elasticsearch_roles_calculation/converge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- data
1515
elasticsearch_heap: 1
1616
elasticsearch_check_calculation: true
17+
elasticstack_no_log: false
1718
tasks:
1819
- name: Include Elastics repos role
1920
ansible.builtin.include_role:

molecule/elasticstack_default/converge.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
elasticsearch_jna_workaround: true
1414
elasticsearch_disable_systemcallfilterchecks: true
1515
elasticstack_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
16-
elasticsearch_heap: "2"
16+
elasticsearch_heap: "1"
1717
elasticstack_full_stack: true
18+
elasticstack_no_log: false
1819
logstash_pipeline_unsafe_shutdown: true
19-
logstash_password_hash: false
2020
beats_filebeat_syslog_udp: true
2121
beats_filebeat_syslog_tcp: true
2222
beats_filebeat_modules:

0 commit comments

Comments
 (0)