mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-04-25 05:57:49 +02:00
23 lines
984 B
Bash
23 lines
984 B
Bash
#!/bin/bash
|
|
# {%- set FLEET_MANAGER = salt['pillar.get']('global:fleet_manager', False) -%}
|
|
# {%- set FLEET_NODE = salt['pillar.get']('global:fleet_node', False) -%}
|
|
# {%- set MANAGER = salt['pillar.get']('global:url_base', '') %}
|
|
|
|
# Copy template file
|
|
cp /opt/so/conf/kibana/saved_objects.ndjson.template /opt/so/conf/kibana/saved_objects.ndjson
|
|
|
|
# {% if FLEET_NODE or FLEET_MANAGER %}
|
|
# Fleet IP
|
|
#sed -i "s/FLEETPLACEHOLDER/{{ MANAGER }}/g" /opt/so/conf/kibana/saved_objects.ndjson
|
|
# {% endif %}
|
|
|
|
# SOCtopus and Manager
|
|
sed -i "s/PLACEHOLDER/{{ MANAGER }}/g" /opt/so/conf/kibana/saved_objects.ndjson
|
|
|
|
## This hackery will be removed if using Elastic Auth ##
|
|
|
|
# Let's snag a cookie from Kibana
|
|
THECOOKIE=$(curl -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
|
|
# Load saved objects
|
|
curl -b "sid=$THECOOKIE" -L -X POST "localhost:5601/api/saved_objects/_import?overwrite=true" -H "kbn-xsrf: true" --form file=@/opt/so/conf/kibana/saved_objects.ndjson > /dev/null 2>&1
|