Merge pull request #13054 from Security-Onion-Solutions/jertel/eaconfig

fix elastalert settings
This commit is contained in:
Jason Ertel
2024-05-21 18:38:03 -04:00
committed by GitHub

View File

@@ -15,20 +15,16 @@
{% set ELASTALERTMERGED = salt['pillar.get']('elastalert', ELASTALERTDEFAULTS.elastalert, merge=True) %} {% set ELASTALERTMERGED = salt['pillar.get']('elastalert', ELASTALERTDEFAULTS.elastalert, merge=True) %}
{% if 'ntf' in salt['pillar.get']('features', []) %} {% if 'ntf' in salt['pillar.get']('features', []) %}
{% set params = ELASTALERTMERGED.alerter_parameters | load_yaml %} {% set params = ELASTALERTMERGED.get('alerter_parameters', '') | load_yaml %}
{% if params != None %} {% if params != None and params | length > 0 %}
{% do ELASTALERTMERGED.config.update(params) %} {% do ELASTALERTMERGED.config.update(params) %}
{% endif %} {% endif %}
{% if ELASTALERTMERGED.smtp_user | length > 0 %} {% if ELASTALERTMERGED.get('smtp_user', '') | length > 0 %}
{% do ELASTALERTMERGED.config.update({'smtp_auth_file': '/opt/elastalert/predefined/smtp_auth.yaml'}) %} {% do ELASTALERTMERGED.config.update({'smtp_auth_file': '/opt/elastalert/predefined/smtp_auth.yaml'}) %}
{% endif %} {% endif %}
{% if ELASTALERTMERGED.smtp_user | length > 0 %} {% if ELASTALERTMERGED.get('jira_user', '') | length > 0 or ELASTALERTMERGED.get('jira_key', '') | length > 0 %}
{% do ELASTALERTMERGED.config.update({'smtp_auth_file': '/opt/elastalert/predefined/smtp_auth.yaml'}) %}
{% endif %}
{% if ELASTALERTMERGED.jira_user | length > 0 or ELASTALERTMERGED.jira_key | length > 0 %}
{% do ELASTALERTMERGED.config.update({'jira_account_file': '/opt/elastalert/predefined/jira_auth.yaml'}) %} {% do ELASTALERTMERGED.config.update({'jira_account_file': '/opt/elastalert/predefined/jira_auth.yaml'}) %}
{% endif %} {% endif %}