mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Note to remove so-kafka-clusterid. Update soup and setup to generate needed kafka pillar values
Signed-off-by: reyesj2 <94730068+reyesj2@users.noreply.github.com>
This commit is contained in:
@@ -5,6 +5,11 @@
|
||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||
# Elastic License 2.0.
|
||||
|
||||
|
||||
|
||||
### THIS SCRIPT AND SALT STATE REFERENCES TO THIS SCRIPT TO BE REMOVED ONCE INITIAL TESTING IS DONE - THESE VALUES WILL GENERATED IN SETUP AND SOUP
|
||||
|
||||
|
||||
local_salt_dir=/opt/so/saltstack/local
|
||||
|
||||
if [[ -f /usr/sbin/so-common ]]; then
|
||||
|
||||
@@ -438,8 +438,25 @@ post_to_2.4.60() {
|
||||
}
|
||||
|
||||
post_to_2.4.70() {
|
||||
# Global pipeline changes to REDIS or KAFKA
|
||||
echo "Removing global.pipeline pillar configuration"
|
||||
sed -i '/pipeline:/d' /opt/so/saltstack/local/pillar/global/soc_global.sls
|
||||
|
||||
# Kafka configuration
|
||||
mkdir -p /opt/so/saltstack/local/pillar/kafka
|
||||
touch /opt/so/saltstack/local/pillar/kafka/soc_kafka.sls
|
||||
touch /opt/so/saltstack/local/pillar/kafka/adv_kafka.sls
|
||||
echo 'kafka: ' > /opt/so/saltstack/local/pillar/kafka/soc_kafka.sls
|
||||
|
||||
if ! grep -q "^ cluster_id:" $local_salt_dir/pillar/kafka/soc_kafka.sls; then
|
||||
kafka_cluster_id=$(get_random_value 22)
|
||||
echo ' cluster_id: '$kafka_cluster_id >> $local_salt_dir/pillar/kafka/soc_kafka.sls
|
||||
|
||||
if ! grep -q "^ certpass:" $local_salt_dir/pillar/kafka/soc_kafka.sls; then
|
||||
kafkapass=$(get_random_value)
|
||||
echo ' certpass: '$kafkapass >> $local_salt_dir/pillar/kafka/soc_kafka.sls
|
||||
fi
|
||||
|
||||
POSTVERSION=2.4.70
|
||||
}
|
||||
|
||||
|
||||
@@ -803,6 +803,7 @@ create_manager_pillars() {
|
||||
patch_pillar
|
||||
nginx_pillar
|
||||
kibana_pillar
|
||||
kafka_pillar
|
||||
}
|
||||
|
||||
create_repo() {
|
||||
@@ -1191,6 +1192,18 @@ kibana_pillar() {
|
||||
logCmd "touch $kibana_pillar_file"
|
||||
}
|
||||
|
||||
kafka_pillar() {
|
||||
KAFKACLUSTERID=$(get_random_value 22)
|
||||
KAFKAPASS=$(get_random_value)
|
||||
logCmd "mkdir -p $local_salt_dir/pillar/kakfa"
|
||||
logCmd "touch $adv_kafka_pillar_file"
|
||||
logCmd "touch $kafka_pillar_file"
|
||||
printf '%s\n'\
|
||||
"kafka:"\
|
||||
" cluster_id: $KAFKACLUSTERID"\
|
||||
" certpass: $KAFKAPASS" > $kafka_pillar_file
|
||||
}
|
||||
|
||||
logrotate_pillar() {
|
||||
logCmd "mkdir -p $local_salt_dir/pillar/logrotate"
|
||||
logCmd "touch $adv_logrotate_pillar_file"
|
||||
|
||||
@@ -178,6 +178,12 @@ export redis_pillar_file
|
||||
adv_redis_pillar_file="$local_salt_dir/pillar/redis/adv_redis.sls"
|
||||
export adv_redis_pillar_file
|
||||
|
||||
kafka_pillar_file="local_salt_dir/pillar/kafka/soc_kafka.sls"
|
||||
export kafka_pillar_file
|
||||
|
||||
adv_kafka_pillar_file="$local_salt_dir/pillar/kafka/adv_kafka.sls"
|
||||
export kafka_pillar_file
|
||||
|
||||
idh_pillar_file="$local_salt_dir/pillar/idh/soc_idh.sls"
|
||||
export idh_pillar_file
|
||||
|
||||
|
||||
Reference in New Issue
Block a user