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 %}
|
||||
|
||||
{% set KAFKA_NODES_PILLAR = salt['pillar.get']('kafka:nodes') %}
|
||||
{% set KAFKA_PASSWORD = salt['pillar.get']('kafka:password') %}
|
||||
{% set KAFKA_TRUSTPASS = salt['pillar.get']('kafka:trustpass') %}
|
||||
{% set KAFKA_PASSWORD = salt['pillar.get']('kafka:config:password') %}
|
||||
{% set KAFKA_TRUSTPASS = salt['pillar.get']('kafka:config:trustpass') %}
|
||||
|
||||
{# Create list of KRaft controllers #}
|
||||
{% set controllers = [] %}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||
{% if sls.split('.')[0] in allowed_states %}
|
||||
{% 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:
|
||||
- ca.dirs
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# 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
|
||||
# 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
|
||||
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_trustpass = salt['pillar.get']('kafka:trustpass') %}
|
||||
{%- set kafka_password = salt['pillar.get']('kafka:config:password') %}
|
||||
{%- set kafka_trustpass = salt['pillar.get']('kafka:config:trustpass') %}
|
||||
{%- set kafka_brokers = salt['pillar.get']('kafka:nodes', {}) %}
|
||||
{%- set brokers = [] %}
|
||||
|
||||
|
||||
@@ -674,7 +674,13 @@ up_to_2.4.80() {
|
||||
|
||||
up_to_2.4.90() {
|
||||
kafkatrust=$(get_random_value)
|
||||
echo ' trustpass: '$kafkatrust >> /opt/so/saltstack/local/pillar/kafka/soc_kafka.sls
|
||||
# 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
|
||||
|
||||
|
||||
INSTALLEDVERSION=2.4.90
|
||||
|
||||
@@ -1187,8 +1187,9 @@ kafka_pillar() {
|
||||
printf '%s\n'\
|
||||
"kafka:"\
|
||||
" cluster_id: $KAFKACLUSTERID"\
|
||||
" password: $KAFKAPASS"\
|
||||
" trustpass: $KAFKATRUST" > $kafka_pillar_file
|
||||
" config:"\
|
||||
" password: $KAFKAPASS"\
|
||||
" trustpass: $KAFKATRUST" > $kafka_pillar_file
|
||||
}
|
||||
|
||||
logrotate_pillar() {
|
||||
|
||||
Reference in New Issue
Block a user