mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Merge pull request #665 from Security-Onion-Solutions/issue/227
Issue/227
This commit is contained in:
1
pillar/data/mastersearchtab.sls
Normal file
1
pillar/data/mastersearchtab.sls
Normal file
@@ -0,0 +1 @@
|
|||||||
|
mastersearchtab:
|
||||||
@@ -1226,7 +1226,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"params": [
|
"params": [
|
||||||
" / 5"
|
" / {{ CPUS }}"
|
||||||
],
|
],
|
||||||
"type": "math"
|
"type": "math"
|
||||||
}
|
}
|
||||||
@@ -1365,7 +1365,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"params": [
|
"params": [
|
||||||
" / 8"
|
" / {{ CPUS }}"
|
||||||
],
|
],
|
||||||
"type": "math"
|
"type": "math"
|
||||||
}
|
}
|
||||||
@@ -1504,7 +1504,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"params": [
|
"params": [
|
||||||
" / 8"
|
" / {{ CPUS }}"
|
||||||
],
|
],
|
||||||
"type": "math"
|
"type": "math"
|
||||||
}
|
}
|
||||||
@@ -1643,7 +1643,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"params": [
|
"params": [
|
||||||
" / 8"
|
" / {{ CPUS }}"
|
||||||
],
|
],
|
||||||
"type": "math"
|
"type": "math"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -290,7 +290,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"params": [
|
"params": [
|
||||||
" / 16"
|
" / {{ CPUS }}"
|
||||||
],
|
],
|
||||||
"type": "math"
|
"type": "math"
|
||||||
}
|
}
|
||||||
@@ -430,7 +430,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"params": [
|
"params": [
|
||||||
" / 16"
|
" / {{ CPUS }}"
|
||||||
],
|
],
|
||||||
"type": "math"
|
"type": "math"
|
||||||
}
|
}
|
||||||
@@ -1046,7 +1046,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"params": [
|
"params": [
|
||||||
" / 16"
|
" / {{ CPUS }}"
|
||||||
],
|
],
|
||||||
"type": "math"
|
"type": "math"
|
||||||
}
|
}
|
||||||
@@ -1186,7 +1186,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"params": [
|
"params": [
|
||||||
" / 16"
|
" / {{ CPUS }}"
|
||||||
],
|
],
|
||||||
"type": "math"
|
"type": "math"
|
||||||
}
|
}
|
||||||
@@ -1326,7 +1326,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"params": [
|
"params": [
|
||||||
" / 16"
|
" / {{ CPUS }}"
|
||||||
],
|
],
|
||||||
"type": "math"
|
"type": "math"
|
||||||
}
|
}
|
||||||
|
|||||||
4915
salt/grafana/dashboards/mastersearch/mastersearch.json
Normal file
4915
salt/grafana/dashboards/mastersearch/mastersearch.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -298,7 +298,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"params": [
|
"params": [
|
||||||
" / 16"
|
" / {{ CPUS }}"
|
||||||
],
|
],
|
||||||
"type": "math"
|
"type": "math"
|
||||||
}
|
}
|
||||||
@@ -438,7 +438,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"params": [
|
"params": [
|
||||||
" / 16"
|
" / {{ CPUS }}"
|
||||||
],
|
],
|
||||||
"type": "math"
|
"type": "math"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1326,7 +1326,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"params": [
|
"params": [
|
||||||
" / 8"
|
" / {{ CPUS }}"
|
||||||
],
|
],
|
||||||
"type": "math"
|
"type": "math"
|
||||||
}
|
}
|
||||||
@@ -1465,7 +1465,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"params": [
|
"params": [
|
||||||
" / 8"
|
" / {{ CPUS }}"
|
||||||
],
|
],
|
||||||
"type": "math"
|
"type": "math"
|
||||||
}
|
}
|
||||||
@@ -1604,7 +1604,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"params": [
|
"params": [
|
||||||
" / 8"
|
" / {{ CPUS }}"
|
||||||
],
|
],
|
||||||
"type": "math"
|
"type": "math"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,13 @@ providers:
|
|||||||
editable: true
|
editable: true
|
||||||
options:
|
options:
|
||||||
path: /etc/grafana/grafana_dashboards/master
|
path: /etc/grafana/grafana_dashboards/master
|
||||||
|
- name: 'Master Search'
|
||||||
|
folder: 'Master Search'
|
||||||
|
type: file
|
||||||
|
disableDeletion: false
|
||||||
|
editable: true
|
||||||
|
options:
|
||||||
|
path: /etc/grafana/grafana_dashboards/mastersearch
|
||||||
- name: 'Sensor Nodes'
|
- name: 'Sensor Nodes'
|
||||||
folder: 'Sensor Nodes'
|
folder: 'Sensor Nodes'
|
||||||
type: file
|
type: file
|
||||||
|
|||||||
@@ -33,6 +33,13 @@ grafanadashmdir:
|
|||||||
- group: 939
|
- group: 939
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
|
|
||||||
|
grafanadashmsdir:
|
||||||
|
file.directory:
|
||||||
|
- name: /opt/so/conf/grafana/grafana_dashboards/mastersearch
|
||||||
|
- user: 939
|
||||||
|
- group: 939
|
||||||
|
- makedirs: True
|
||||||
|
|
||||||
grafanadashevaldir:
|
grafanadashevaldir:
|
||||||
file.directory:
|
file.directory:
|
||||||
- name: /opt/so/conf/grafana/grafana_dashboards/eval
|
- name: /opt/so/conf/grafana/grafana_dashboards/eval
|
||||||
@@ -85,6 +92,29 @@ dashboard-master:
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if salt['pillar.get']('mastersearchtab', False) %}
|
||||||
|
{% for SN, SNDATA in salt['pillar.get']('mastersearchtab', {}).items() %}
|
||||||
|
{% set NODETYPE = SN.split('_')|last %}
|
||||||
|
{% set SN = SN | regex_replace('_' ~ NODETYPE, '') %}
|
||||||
|
dashboard-master:
|
||||||
|
file.managed:
|
||||||
|
- name: /opt/so/conf/grafana/grafana_dashboards/mastersearch/{{ SN }}-MasterSearch.json
|
||||||
|
- user: 939
|
||||||
|
- group: 939
|
||||||
|
- template: jinja
|
||||||
|
- source: salt://grafana/dashboards/mastersearch/mastersearch.json
|
||||||
|
- defaults:
|
||||||
|
SERVERNAME: {{ SN }}
|
||||||
|
MANINT: {{ SNDATA.manint }}
|
||||||
|
MONINT: {{ SNDATA.manint }}
|
||||||
|
CPUS: {{ SNDATA.totalcpus }}
|
||||||
|
UID: {{ SNDATA.guid }}
|
||||||
|
ROOTFS: {{ SNDATA.rootfs }}
|
||||||
|
NSMFS: {{ SNDATA.nsmfs }}
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if salt['pillar.get']('sensorstab', False) %}
|
{% if salt['pillar.get']('sensorstab', False) %}
|
||||||
{% for SN, SNDATA in salt['pillar.get']('sensorstab', {}).items() %}
|
{% for SN, SNDATA in salt['pillar.get']('sensorstab', {}).items() %}
|
||||||
{% set NODETYPE = SN.split('_')|last %}
|
{% set NODETYPE = SN.split('_')|last %}
|
||||||
|
|||||||
@@ -616,15 +616,14 @@
|
|||||||
|
|
||||||
|
|
||||||
# # Read stats from one or more Elasticsearch servers or clusters
|
# # Read stats from one or more Elasticsearch servers or clusters
|
||||||
{% if grains['role'] == 'so-master' or grains['role'] == 'so-eval' %}
|
{% if grains['role'] in ['so-master', 'so-eval', 'so-mastersearch'] %}
|
||||||
[[inputs.elasticsearch]]
|
[[inputs.elasticsearch]]
|
||||||
|
|
||||||
# ## specify a list of one or more Elasticsearch servers
|
# ## specify a list of one or more Elasticsearch servers
|
||||||
# # you can add username and password to your url to use basic authentication:
|
# # you can add username and password to your url to use basic authentication:
|
||||||
# # servers = ["http://user:pass@localhost:9200"]
|
# # servers = ["http://user:pass@localhost:9200"]
|
||||||
servers = ["http://{{ MASTER }}:9200"]
|
servers = ["http://{{ MASTER }}:9200"]
|
||||||
{% endif %}
|
{% elif grains['role'] in ['so-searchnode', 'so-hotnode', 'so-warmnode', 'so-heavynode'] %}
|
||||||
{% if grains['role'] == 'so-node' %}
|
|
||||||
[[inputs.elasticsearch]]
|
[[inputs.elasticsearch]]
|
||||||
servers = ["http://{{ NODEIP }}:9200"]
|
servers = ["http://{{ NODEIP }}:9200"]
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -667,14 +666,14 @@
|
|||||||
# # Read metrics from one or more commands that can output to stdout
|
# # Read metrics from one or more commands that can output to stdout
|
||||||
|
|
||||||
# ## Commands array
|
# ## Commands array
|
||||||
{% if grains['role'] == 'so-master' %}
|
{% if grains['role'] in ['so-master', 'so-mastersearch'] %}
|
||||||
[[inputs.exec]]
|
[[inputs.exec]]
|
||||||
commands = [
|
commands = [
|
||||||
"/scripts/redis.sh",
|
"/scripts/redis.sh",
|
||||||
"/scripts/influxdbsize.sh"
|
"/scripts/influxdbsize.sh"
|
||||||
]
|
]
|
||||||
data_format = "influx"
|
data_format = "influx"
|
||||||
{% elif grains['role'] == 'so-sensor' %}
|
{% elif grains['role'] in ['so-sensor', 'so-heavynode'] %}
|
||||||
[[inputs.exec]]
|
[[inputs.exec]]
|
||||||
commands = [
|
commands = [
|
||||||
"/scripts/stenoloss.sh",
|
"/scripts/stenoloss.sh",
|
||||||
|
|||||||
@@ -38,3 +38,9 @@ echo "Applying cross cluster search config..."
|
|||||||
curl -XPUT http://{{ ES }}:9200/_cluster/settings -H'Content-Type: application/json' -d '{"persistent": {"search": {"remote": {"{{ SN }}": {"skip_unavailable": "true", "seeds": ["{{ SNDATA.ip }}:9300"]}}}}}'
|
curl -XPUT http://{{ ES }}:9200/_cluster/settings -H'Content-Type: application/json' -d '{"persistent": {"search": {"remote": {"{{ SN }}": {"skip_unavailable": "true", "seeds": ["{{ SNDATA.ip }}:9300"]}}}}}'
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- if salt['pillar.get']('mastersearchtab', {}) %}
|
||||||
|
{%- for SN, SNDATA in salt['pillar.get']('mastersearchtab', {}).items() %}
|
||||||
|
curl -XPUT http://{{ ES }}:9200/_cluster/settings -H'Content-Type: application/json' -d '{"persistent": {"search": {"remote": {"{{ SN }}": {"skip_unavailable": "true", "seeds": ["{{ SNDATA.ip }}:9300"]}}}}}'
|
||||||
|
{%- endfor %}
|
||||||
|
{%- endif %}
|
||||||
|
|||||||
@@ -1325,7 +1325,7 @@ set_initial_firewall_policy() {
|
|||||||
/opt/so/saltstack/pillar/data/addtotab.sh evaltab "$MINION_ID" "$MAINIP" "$num_cpu_cores" "$random_uid" "$MNIC" "$filesystem_root" "$filesystem_nsm" bond0
|
/opt/so/saltstack/pillar/data/addtotab.sh evaltab "$MINION_ID" "$MAINIP" "$num_cpu_cores" "$random_uid" "$MNIC" "$filesystem_root" "$filesystem_nsm" bond0
|
||||||
;;
|
;;
|
||||||
'MASTERSEARCH')
|
'MASTERSEARCH')
|
||||||
/opt/so/saltstack/pillar/data/addtotab.sh nodestab "$MINION_ID" "$MAINIP" "$num_cpu_cores" "$random_uid" "$MNIC" "$filesystem_root" "$filesystem_nsm"
|
/opt/so/saltstack/pillar/data/addtotab.sh mastersearchtab "$MINION_ID" "$MAINIP" "$num_cpu_cores" "$random_uid" "$MNIC" "$filesystem_root" "$filesystem_nsm"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user