mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
skip user entries that don't have password configured
This commit is contained in:
@@ -1,7 +1,16 @@
|
|||||||
{% set KAFKA_EXTERNAL_USERS = salt['pillar.get']('kafka:config:external_access:remote_users') %}
|
{% set KAFKA_EXTERNAL_USERS = salt['pillar.get']('kafka:config:external_access:remote_users') -%}
|
||||||
|
|
||||||
|
{%- set valid_users = [] -%}
|
||||||
|
|
||||||
|
{%- for item, user in KAFKA_EXTERNAL_USERS.items() -%}
|
||||||
|
{% if 'password' in user and user.password is not none and user.password != "" -%}
|
||||||
|
{% do valid_users.append('user_' ~ user.username ~ '="' ~ user.password ~ '"') -%}
|
||||||
|
{% endif -%}
|
||||||
|
{%- endfor -%}
|
||||||
|
|
||||||
KafkaServer {
|
KafkaServer {
|
||||||
org.apache.kafka.common.security.plain.PlainLoginModule required
|
org.apache.kafka.common.security.plain.PlainLoginModule required
|
||||||
{% for item, user in KAFKA_EXTERNAL_USERS.items() -%}
|
{% for user_entry in valid_users -%}
|
||||||
user_{{ user.username }}="{{ user.password }}"{{ ";" if loop.last else " \\" }}
|
{{ user_entry }}{{ ";" if loop.last }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user