mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Merge remote-tracking branch 'remotes/origin/dev' into issue/140
This commit is contained in:
24
salt/common/tools/sbin/so-kibana-config-export
Normal file → Executable file
24
salt/common/tools/sbin/so-kibana-config-export
Normal file → Executable file
@@ -1,6 +1,22 @@
|
|||||||
|
{%- set MASTER = salt['pillar.get']('static:masterip', '') %}
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
KIBANA_HOST=10.66.166.141
|
#
|
||||||
|
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
KIBANA_HOST={{ MASTER }}
|
||||||
KSO_PORT=5601
|
KSO_PORT=5601
|
||||||
OUTFILE="saved_objects.json"
|
OUTFILE="saved_objects.ndjson"
|
||||||
curl -s -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -XPOST $KIBANA_HOST:$KSO_PORT/api/saved_objects/_export -d '{ "type": "index-pattern", "type": "config", "type": "dashboard", "type": "query", "type": "search", "type": "url", "type": "visualization" }' -o $OUTFILE
|
curl -s -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -XPOST $KIBANA_HOST:$KSO_PORT/api/saved_objects/_export -d '{ "type": [ "index-pattern", "config", "visualization", "dashboard", "search" ], "excludeExportDetails": false }' > $OUTFILE
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
{ "rename": { "field": "message2.domain", "target_field": "host.domain", "ignore_missing": true } },
|
{ "rename": { "field": "message2.domain", "target_field": "host.domain", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "message2.host_name", "target_field": "host.hostname", "ignore_missing": true } },
|
{ "rename": { "field": "message2.host_name", "target_field": "host.hostname", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "message2.duration", "target_field": "event.duration", "ignore_missing": true } },
|
{ "rename": { "field": "message2.duration", "target_field": "event.duration", "ignore_missing": true } },
|
||||||
{ "rename": { "field": "message2.msg_types", "target_field": "message_types", "ignore_missing": true } },
|
{ "rename": { "field": "message2.msg_types", "target_field": "dhcp.message_types", "ignore_missing": true } },
|
||||||
{ "pipeline": { "name": "zeek.common" } }
|
{ "pipeline": { "name": "zeek.common" } }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"description" : "zeek.dns.tld",
|
"description" : "zeek.dns.tld",
|
||||||
"processors" : [
|
"processors" : [
|
||||||
{ "script": { "lang": "painless", "source": "ctx.top_level_domain = ctx.dns.query.name.substring(ctx.dns.query.name.lastIndexOf('.') + 1)", "ignore_failure": true } },
|
{ "script": { "lang": "painless", "source": "ctx.dns.top_level_domain = ctx.dns.query.name.substring(ctx.dns.query.name.lastIndexOf('.') + 1)", "ignore_failure": true } },
|
||||||
{ "script": { "lang": "painless", "source": "ctx.query_without_tld = ctx.dns.query.name.substring(0, (ctx.dns.query.name.lastIndexOf('.')))", "ignore_failure": true } },
|
{ "script": { "lang": "painless", "source": "ctx.dns.query_without_tld = ctx.dns.query.name.substring(0, (ctx.dns.query.name.lastIndexOf('.')))", "ignore_failure": true } },
|
||||||
{ "script": { "lang": "painless", "source": "ctx.parent_domain = ctx.query_without_tld.substring(ctx.query_without_tld.lastIndexOf('.') + 1)", "ignore_failure": true } },
|
{ "script": { "lang": "painless", "source": "ctx.dns.parent_domain = ctx.query_without_tld.substring(ctx.query_without_tld.lastIndexOf('.') + 1)", "ignore_failure": true } },
|
||||||
{ "script": { "lang": "painless", "source": "ctx.subdomain = ctx.query_without_tld.substring(0, (ctx.query_without_tld.lastIndexOf('.')))", "ignore_failure": true } },
|
{ "script": { "lang": "painless", "source": "ctx.dns.subdomain = ctx.query_without_tld.substring(0, (ctx.query_without_tld.lastIndexOf('.')))", "ignore_failure": true } },
|
||||||
{ "script": { "lang": "painless", "source": "ctx.highest_registered_domain = ctx.parent_domain + '.' + ctx.top_level_domain", "ignore_failure": true } },
|
{ "script": { "lang": "painless", "source": "ctx.dns.highest_registered_domain = ctx.parent_domain + '.' + ctx.top_level_domain", "ignore_failure": true } },
|
||||||
{ "script": { "lang": "painless", "source": "ctx.subdomain_length = ctx.subdomain.length()", "ignore_failure": true } },
|
{ "script": { "lang": "painless", "source": "ctx.dns.subdomain_length = ctx.subdomain.length()", "ignore_failure": true } },
|
||||||
{ "script": { "lang": "painless", "source": "ctx.parent_domain_length = ctx.parent_domain.length()", "ignore_failure": true } },
|
{ "script": { "lang": "painless", "source": "ctx.dns.parent_domain_length = ctx.parent_domain.length()", "ignore_failure": true } },
|
||||||
{ "remove": { "field": "query_without_tld", "ignore_failure": true } }
|
{ "remove": { "field": "query_without_tld", "ignore_failure": true } }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,24 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
{%- set MASTER = salt['pillar.get']('static:masterip', '') %}
|
# {%- set FLEET_NODE = salt['pillar.get']('static:fleet_node') %}
|
||||||
{%- set FLEET_NODE = salt['pillar.get']('static:fleet_node') %}
|
# {%- set FLEET = salt['pillar.get']('static:fleet_ip', '') %}
|
||||||
{%- set FLEET = salt['pillar.get']('static:fleet_ip', '') %}
|
# {%- set MASTER = salt['pillar.get']('kratos:redirect', '') %}
|
||||||
{%- set KRATOS = salt['pillar.get']('kratos:redirect', '') %}
|
|
||||||
|
|
||||||
KIBANA_VERSION="7.6.1"
|
KIBANA_VERSION="7.6.1"
|
||||||
|
|
||||||
# Copy template file
|
# Copy template file
|
||||||
cp /opt/so/conf/kibana/saved_objects.ndjson.template /opt/so/conf/kibana/saved_objects.ndjson
|
cp /opt/so/conf/kibana/saved_objects.ndjson.template /opt/so/conf/kibana/saved_objects.ndjson
|
||||||
|
|
||||||
|
# {% if FLEET_NODE %}
|
||||||
|
# Fleet IP
|
||||||
|
sed -i "s/FLEETPLACEHOLDER/{{ FLEET }}/g" /opt/so/conf/kibana/saved_objects.ndjson
|
||||||
|
# {% endif %}
|
||||||
|
|
||||||
|
# Kratos redirect
|
||||||
|
#sed -i "s/PCAPPLACEHOLDER/{{ KRATOS }}/g" /opt/so/conf/kibana/saved_objects.ndjson
|
||||||
|
|
||||||
# SOCtopus and Master
|
# SOCtopus and Master
|
||||||
sed -i "s/PLACEHOLDER/{{ MASTER }}/g" /opt/so/conf/kibana/saved_objects.ndjson
|
sed -i "s/PLACEHOLDER/{{ MASTER }}/g" /opt/so/conf/kibana/saved_objects.ndjson
|
||||||
|
|
||||||
{% if FLEET_NODE %}
|
|
||||||
# Fleet IP
|
|
||||||
sed -i "s/FLEETPLACEHOLDER/{{ FLEET }}/g" /opt/so/conf/kibana/saved_objects.ndjson
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
# Kratos redirect
|
|
||||||
sed -i "s/PCAPPLACEHOLDER/{{ KRATOS }}/g" /opt/so/conf/kibana/saved_objects.ndjson
|
|
||||||
|
|
||||||
# Load saved objects
|
# Load saved objects
|
||||||
curl -X POST "localhost:5601/api/saved_objects/_import" -H "kbn-xsrf: true" --form file=@/opt/so/conf/kibana/saved_objects.ndjson > /dev/null 2>&1
|
curl -X POST "localhost:5601/api/saved_objects/_import" -H "kbn-xsrf: true" --form file=@/opt/so/conf/kibana/saved_objects.ndjson > /dev/null 2>&1
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@ input {
|
|||||||
ssl_certificate_authorities => ["/usr/share/filebeat/ca.crt"]
|
ssl_certificate_authorities => ["/usr/share/filebeat/ca.crt"]
|
||||||
ssl_certificate => "/usr/share/logstash/filebeat.crt"
|
ssl_certificate => "/usr/share/logstash/filebeat.crt"
|
||||||
ssl_key => "/usr/share/logstash/filebeat.key"
|
ssl_key => "/usr/share/logstash/filebeat.key"
|
||||||
tags => [ "beat" ]
|
#tags => [ "beat" ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
filter {
|
filter {
|
||||||
|
|||||||
Reference in New Issue
Block a user