mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
rearrange kafka pillar, declutters SOC ui
Signed-off-by: reyesj2 <94730068+reyesj2@users.noreply.github.com>
This commit is contained in:
@@ -6,8 +6,8 @@
|
|||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
|
|
||||||
{% set KAFKA_NODES_PILLAR = salt['pillar.get']('kafka:nodes') %}
|
{% set KAFKA_NODES_PILLAR = salt['pillar.get']('kafka:nodes') %}
|
||||||
{% set KAFKA_PASSWORD = salt['pillar.get']('kafka:password') %}
|
{% set KAFKA_PASSWORD = salt['pillar.get']('kafka:config:password') %}
|
||||||
{% set KAFKA_TRUSTPASS = salt['pillar.get']('kafka:trustpass') %}
|
{% set KAFKA_TRUSTPASS = salt['pillar.get']('kafka:config:trustpass') %}
|
||||||
|
|
||||||
{# Create list of KRaft controllers #}
|
{# Create list of KRaft controllers #}
|
||||||
{% set controllers = [] %}
|
{% set controllers = [] %}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% if sls.split('.')[0] in allowed_states %}
|
{% if sls.split('.')[0] in allowed_states %}
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% set kafka_password = salt['pillar.get']('kafka:password') %}
|
{% set kafka_password = salt['pillar.get']('kafka:config:password') %}
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- ca.dirs
|
- ca.dirs
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
# Elastic License 2.0.
|
# Elastic License 2.0.
|
||||||
{% set TRUSTPASS = salt['pillar.get']('kafka:trustpass') %}
|
{% set TRUSTPASS = salt['pillar.get']('kafka:config:trustpass') %}
|
||||||
|
|
||||||
if [ ! -f /opt/so/saltstack/local/salt/kafka/files/kafka-truststore ]; then
|
if [ ! -f /opt/so/saltstack/local/salt/kafka/files/kafka-truststore ]; then
|
||||||
docker run -v /etc/pki/ca.crt:/etc/pki/ca.crt --name so-kafkatrust --user root --entrypoint /opt/java/openjdk/bin/keytool {{ GLOBALS.registry_host }}:5000/{{ GLOBALS.image_repo }}/so-kafka:{{ GLOBALS.so_version }} -import -file /etc/pki/ca.crt -alias SOS -keystore /etc/pki/kafka-truststore -storepass {{ TRUSTPASS }} -storetype jks -noprompt
|
docker run -v /etc/pki/ca.crt:/etc/pki/ca.crt --name so-kafkatrust --user root --entrypoint /opt/java/openjdk/bin/keytool {{ GLOBALS.registry_host }}:5000/{{ GLOBALS.image_repo }}/so-kafka:{{ GLOBALS.so_version }} -import -file /etc/pki/ca.crt -alias SOS -keystore /etc/pki/kafka-truststore -storepass {{ TRUSTPASS }} -storetype jks -noprompt
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{%- set kafka_password = salt['pillar.get']('kafka:password') %}
|
{%- set kafka_password = salt['pillar.get']('kafka:config:password') %}
|
||||||
{%- set kafka_trustpass = salt['pillar.get']('kafka:trustpass') %}
|
{%- set kafka_trustpass = salt['pillar.get']('kafka:config:trustpass') %}
|
||||||
{%- set kafka_brokers = salt['pillar.get']('kafka:nodes', {}) %}
|
{%- set kafka_brokers = salt['pillar.get']('kafka:nodes', {}) %}
|
||||||
{%- set brokers = [] %}
|
{%- set brokers = [] %}
|
||||||
|
|
||||||
|
|||||||
@@ -674,6 +674,12 @@ up_to_2.4.80() {
|
|||||||
|
|
||||||
up_to_2.4.90() {
|
up_to_2.4.90() {
|
||||||
kafkatrust=$(get_random_value)
|
kafkatrust=$(get_random_value)
|
||||||
|
# rearranging the kafka pillar to reduce clutter in SOC UI
|
||||||
|
kafkasavedpass=$(so-yaml.py get /opt/so/saltstack/local/pillar/kafka/soc_kafka.sls kafka.password)
|
||||||
|
kafkatrimpass=$(echo $kafkasavedpass | awk '{print $1}')
|
||||||
|
so-yaml.py remove /opt/so/saltstack/local/pillar/kafka/soc_kafka.sls kafka.password
|
||||||
|
echo ' config:' >> /opt/so/saltstack/local/pillar/kafka/soc_kafka.sls
|
||||||
|
echo ' password: '$kafkatrimpass >> /opt/so/saltstack/local/pillar/kafka/soc_kafka.sls
|
||||||
echo ' trustpass: '$kafkatrust >> /opt/so/saltstack/local/pillar/kafka/soc_kafka.sls
|
echo ' trustpass: '$kafkatrust >> /opt/so/saltstack/local/pillar/kafka/soc_kafka.sls
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1187,6 +1187,7 @@ kafka_pillar() {
|
|||||||
printf '%s\n'\
|
printf '%s\n'\
|
||||||
"kafka:"\
|
"kafka:"\
|
||||||
" cluster_id: $KAFKACLUSTERID"\
|
" cluster_id: $KAFKACLUSTERID"\
|
||||||
|
" config:"\
|
||||||
" password: $KAFKAPASS"\
|
" password: $KAFKAPASS"\
|
||||||
" trustpass: $KAFKATRUST" > $kafka_pillar_file
|
" trustpass: $KAFKATRUST" > $kafka_pillar_file
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user