Add logstash

This commit is contained in:
Josh Brower
2023-01-27 07:49:21 -05:00
parent 81ee333b07
commit 29aa6dceed
9 changed files with 39 additions and 2 deletions

View File

@@ -119,6 +119,25 @@ function add_elastic_to_minion() {
" " >> $PILLARFILE
}
# Add Elastic Fleet Server settings to the minion file
function add_fleet_to_minion() {
# Create ES Token for Fleet server (Curl to Kibana API)
# TODO: Add error handling
ESTOKEN=$(curl -K /opt/so/conf/elasticsearch/curl.config -L -X POST "localhost:5601/api/fleet/service_tokens" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' | jq -r .value)
# Create Logstash Certs
# Write out settings to minion file
printf '%s\n'\
"logstash_settings:"\
" lsheap: '500m'"\
"fleet-server:"\
" ES-Token: '$ESTOKEN'"\
" " >> $PILLARFILE
}
# Analyst Workstation
function add_analyst_to_minion() {
printf '%s\n'\
@@ -170,6 +189,10 @@ function createEVAL() {
add_sensor_to_minion
}
function createFLEET() {
add_fleet_to_minion
}
function createIDHNODE() {
echo "Nothing custom needed for IDH nodes"
}