diff --git a/salt/kafka/config.sls b/salt/kafka/config.sls index 165daf7eb..1c3d8c26b 100644 --- a/salt/kafka/config.sls +++ b/salt/kafka/config.sls @@ -20,14 +20,13 @@ kafka: - uid: 960 - gid: 960 -{# Future tools to query kafka directly / show consumer groups kafka_sbin_tools: file.recurse: - name: /usr/sbin - source: salt://kafka/tools/sbin - user: 960 - group: 960 - - file_mode: 755 #} + - file_mode: 755 kafka_sbin_jinja_tools: file.recurse: @@ -69,7 +68,7 @@ kafka_kraft_{{sc}}_properties: reset_quorum_on_changes: cmd.run: - name: rm -f /nsm/kafka/data/__cluster_metadata-0/quorum-state - - watch: + - onchanges: - file: /opt/so/conf/kafka/server.properties {% else %} diff --git a/salt/kafka/nodes.map.jinja b/salt/kafka/nodes.map.jinja index c0b98de14..3a73b038f 100644 --- a/salt/kafka/nodes.map.jinja +++ b/salt/kafka/nodes.map.jinja @@ -16,7 +16,7 @@ tgt_type='compound') %} {% set STORED_KAFKANODES = salt['pillar.get']('kafka:nodes', default=None) %} -{% set KAFKA_CONTROLLERS_PILLAR = salt['pillar.get']('kafka:kafka_controllers', default=None) %} +{% set KAFKA_CONTROLLERS_PILLAR = salt['pillar.get']('kafka:controllers', default=None) %} {% set existing_ids = [] %} diff --git a/salt/kafka/reset_kafka.sls b/salt/kafka/reset.sls similarity index 100% rename from salt/kafka/reset_kafka.sls rename to salt/kafka/reset.sls diff --git a/salt/kafka/soc_kafka.yaml b/salt/kafka/soc_kafka.yaml index 59816cef3..1172fc5b9 100644 --- a/salt/kafka/soc_kafka.yaml +++ b/salt/kafka/soc_kafka.yaml @@ -17,7 +17,7 @@ kafka: forcedType: "string" helpLink: kafka.html reset: - description: Disable and reset the Kafka cluster. This will remove all Kafka data including logs that may have not yet been ingested into Elasticsearch and reverts the grid to using REDIS as the global pipeline. This is useful when testing different Kafka configurations such as rearranging Kafka brokers / controllers allowing you to reset the cluster rather than manually fixing any issues arising from attempting to reassign a Kafka broker into a controller. Enter 'YES_reset' and submit to disable and reset Kafka. Make any configuration changes required and re-enable Kafka when ready. This action CANNOT be reversed. + description: Disable and reset the Kafka cluster. This will remove all Kafka data including logs that may have not yet been ingested into Elasticsearch and reverts the grid to using REDIS as the global pipeline. This is useful when testing different Kafka configurations such as rearranging Kafka brokers / controllers allowing you to reset the cluster rather than manually fixing any issues arising from attempting to reassign a Kafka broker into a controller. Enter 'YES_RESET_KAFKA' and submit to disable and reset Kafka. Make any configuration changes required and re-enable Kafka when ready. This action CANNOT be reversed. advanced: True helpLink: kafka.html config: diff --git a/salt/kafka/tools/sbin/so-kafka-cli b/salt/kafka/tools/sbin/so-kafka-cli new file mode 100644 index 000000000..41993f67f --- /dev/null +++ b/salt/kafka/tools/sbin/so-kafka-cli @@ -0,0 +1,47 @@ +#! /bin/bash +# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one +# 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. + +if [ -z "$NOROOT" ]; then + # Check for prerequisites + if [ "$(id -u)" -ne 0 ]; then + echo "This script must be run using sudo!" + exit 1 + fi +fi + +function usage() { + echo -e "\nUsage: $0