mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
handle suricata network and port vars as string or list
This commit is contained in:
@@ -101,20 +101,20 @@
|
||||
|
||||
{# change address-groups vars from list to comma seperated string #}
|
||||
{% for k, v in SURICATAMERGED.config.vars['address-groups'].items() %}
|
||||
{% if v is string %}
|
||||
{% do SURICATAMERGED.config.vars['address-groups'].update({k: '[' ~ v ~ ']'}) %}
|
||||
{# if address-group value is a list #}
|
||||
{% if v is iterable and (v is not string and v is not mapping and v | length > 1) %}
|
||||
{% elif v is iterable and v is not mapping %}
|
||||
{% do SURICATAMERGED.config.vars['address-groups'].update({k: '[' ~ v | join(',') ~ ']'}) %}
|
||||
{% else %}
|
||||
{% do SURICATAMERGED.config.vars['address-groups'].update({k: v[0]}) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{# change port-groups vars from list to comma seperated string #}
|
||||
{% for k, v in SURICATAMERGED.config.vars['port-groups'].items() %}
|
||||
{% if v is string %}
|
||||
{% do SURICATAMERGED.config.vars['port-groups'].update({k: '[' ~ v ~ ']'}) %}
|
||||
{# if address-group value is a list #}
|
||||
{% if v is iterable and (v is not string and v is not mapping and v | length > 1) %}
|
||||
{% elif v is iterable and v is not mapping %}
|
||||
{% do SURICATAMERGED.config.vars['port-groups'].update({k: '[' ~ v | join(',') ~ ']'}) %}
|
||||
{% else %}
|
||||
{% do SURICATAMERGED.config.vars['port-groups'].update({k: v[0]}) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user