Skip to content

Commit

Permalink
Merge pull request #13054 from Security-Onion-Solutions/jertel/eaconfig
Browse files Browse the repository at this point in the history
fix elastalert settings
  • Loading branch information
jertel authored May 21, 2024
2 parents 8b011b8 + 8af3158 commit ca6e2b8
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions salt/elastalert/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,16 @@
{% set ELASTALERTMERGED = salt['pillar.get']('elastalert', ELASTALERTDEFAULTS.elastalert, merge=True) %}

{% if 'ntf' in salt['pillar.get']('features', []) %}
{% set params = ELASTALERTMERGED.alerter_parameters | load_yaml %}
{% if params != None %}
{% set params = ELASTALERTMERGED.get('alerter_parameters', '') | load_yaml %}
{% if params != None and params | length > 0 %}
{% do ELASTALERTMERGED.config.update(params) %}
{% 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'}) %}
{% endif %}

{% if ELASTALERTMERGED.smtp_user | 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 %}
{% if ELASTALERTMERGED.get('jira_user', '') | length > 0 or ELASTALERTMERGED.get('jira_key', '') | length > 0 %}
{% do ELASTALERTMERGED.config.update({'jira_account_file': '/opt/elastalert/predefined/jira_auth.yaml'}) %}
{% endif %}

Expand Down

0 comments on commit ca6e2b8

Please sign in to comment.