Merge pull request #511 from Security-Onion-Solutions/fix/kibana_load

update Kibana config
This commit is contained in:
weslambert
2020-04-02 21:00:45 -04:00
committed by GitHub
3 changed files with 594 additions and 588 deletions

View File

@@ -1,12 +1,12 @@
{%- set MASTER = salt['pillar.get']('static:masterip', '') %}
#!/bin/bash
KIBANA_VERSION="7.6.1"
MAX_WAIT=60
# Check to see if Kibana is available
wait_step=0
until curl -s -XGET http://localhost:5601 > /dev/null ; do
until curl "{{ MASTER }}:5601/nonexistenturl" 2>&1 |grep -q "Not Found" ; do
wait_step=$(( ${wait_step} + 1 ))
echo "Waiting on Kibana...Attempt #$wait_step"
echo "Waiting on Kibana ({{ MASTER }}:5601)...Attempt #$wait_step"
if [ ${wait_step} -gt ${MAX_WAIT} ]; then
echo "ERROR: Kibana not available for more than ${MAX_WAIT} seconds."
exit 5
@@ -30,5 +30,10 @@ curl -X PUT "localhost:5601/api/saved_objects/config/$KIBANA_VERSION" -H 'kbn-xs
}
}'
# Sub our IP for placholders
for i in FLEETPLACEHOLDER PCAPPLACEHOLDER SOCTOPUSPLACEHOLDER; do
sed -i "s/$i/{{ MASTER }}/" /opt/so/saltstack/salt/kibana/saved_objects.ndjson
done
# Load saved objects
curl -X POST "localhost:5601/api/saved_objects/_import" -H "kbn-xsrf: true" --form file=@/opt/so/saltstack/salt/kibana/saved_objects.ndjson

View File

@@ -84,6 +84,7 @@ so-kibana-config-load:
- shell: /bin/bash
- runas: socore
- source: salt://kibana/bin/so-kibana-config-load
- template: jinja
# Keep the setting correct
#KibanaHappy:

File diff suppressed because one or more lines are too long