mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
generate elasticsearch.auth pillar if it doesnt exist
This commit is contained in:
@@ -46,6 +46,9 @@ base:
|
||||
- logstash.manager
|
||||
- logstash.search
|
||||
- elasticsearch.search
|
||||
{% if salt['file.exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
||||
- elasticsearch.auth
|
||||
{% endif %}
|
||||
- data.*
|
||||
- zeeklogs
|
||||
- secrets
|
||||
@@ -89,4 +92,4 @@ base:
|
||||
- secrets
|
||||
- elasticsearch.eval
|
||||
- global
|
||||
- minions.{{ grains.id }}
|
||||
- minions.{{ grains.id }}
|
||||
|
||||
9
salt/elasticsearch/auth.sls
Normal file
9
salt/elasticsearch/auth.sls
Normal file
@@ -0,0 +1,9 @@
|
||||
elastic_auth_pillar:
|
||||
file.managed:
|
||||
- name: /opt/so/saltstack/local/pillar/elasticsearch/auth.sls
|
||||
- contents: |
|
||||
elasticsearch:
|
||||
auth:
|
||||
enabled: False
|
||||
user: so_elastic
|
||||
pass: {{ salt['random.get_str'](20) }}
|
||||
1
salt/elasticsearch/files/curl.config
Normal file
1
salt/elasticsearch/files/curl.config
Normal file
@@ -0,0 +1 @@
|
||||
user = "salt['pillar.get']('elasticsearch:auth:user'):salt['pillar.get']('elasticsearch:auth:pass')"
|
||||
@@ -256,6 +256,14 @@ so-elasticsearch-templates:
|
||||
- template: jinja
|
||||
{% endif %}
|
||||
|
||||
elastic_curl_config:
|
||||
file.managed:
|
||||
- name: /opt/so/conf/elasticsearch/curl.config
|
||||
- mode: 600
|
||||
# since we are generating a random password, and we don't want that to happen everytime
|
||||
# a highstate runs, we only manage the file if it doesn't exist
|
||||
- unless: ls /opt/so/conf/elasticsearch/curl.config
|
||||
|
||||
{% endif %} {# if grains['role'] != 'so-helix' #}
|
||||
|
||||
{% else %}
|
||||
|
||||
Reference in New Issue
Block a user