mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Add logstash
This commit is contained in:
6
pillar/logstash/fleet.sls
Normal file
6
pillar/logstash/fleet.sls
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
logstash:
|
||||||
|
pipelines:
|
||||||
|
fleet:
|
||||||
|
config:
|
||||||
|
- so/0012_input_elastic_agent.conf
|
||||||
|
- so/9805_output_elastic_agent.conf.jinja
|
||||||
@@ -185,6 +185,8 @@ base:
|
|||||||
- minions.adv_{{ grains.id }}
|
- minions.adv_{{ grains.id }}
|
||||||
|
|
||||||
'*_fleet':
|
'*_fleet':
|
||||||
|
- soc_global
|
||||||
|
- adv_global
|
||||||
- backup.soc_backup
|
- backup.soc_backup
|
||||||
- backup.adv_backup
|
- backup.adv_backup
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
|
|||||||
@@ -201,6 +201,7 @@
|
|||||||
'ssl',
|
'ssl',
|
||||||
'telegraf',
|
'telegraf',
|
||||||
'firewall',
|
'firewall',
|
||||||
|
'logstash',
|
||||||
'healthcheck',
|
'healthcheck',
|
||||||
'schedule',
|
'schedule',
|
||||||
'elastic-fleet',
|
'elastic-fleet',
|
||||||
|
|||||||
@@ -119,6 +119,25 @@ function add_elastic_to_minion() {
|
|||||||
" " >> $PILLARFILE
|
" " >> $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
|
# Analyst Workstation
|
||||||
function add_analyst_to_minion() {
|
function add_analyst_to_minion() {
|
||||||
printf '%s\n'\
|
printf '%s\n'\
|
||||||
@@ -170,6 +189,10 @@ function createEVAL() {
|
|||||||
add_sensor_to_minion
|
add_sensor_to_minion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createFLEET() {
|
||||||
|
add_fleet_to_minion
|
||||||
|
}
|
||||||
|
|
||||||
function createIDHNODE() {
|
function createIDHNODE() {
|
||||||
echo "Nothing custom needed for IDH nodes"
|
echo "Nothing custom needed for IDH nodes"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -255,6 +255,9 @@ role:
|
|||||||
- {{ portgroups.elastic_agent_data }}
|
- {{ portgroups.elastic_agent_data }}
|
||||||
- {{ portgroups.endgame }}
|
- {{ portgroups.endgame }}
|
||||||
- {{ portgroups.strelka_frontend }}
|
- {{ portgroups.strelka_frontend }}
|
||||||
|
fleet:
|
||||||
|
portgroups:
|
||||||
|
- {{ portgroups.elasticsearch_rest }}
|
||||||
sensors:
|
sensors:
|
||||||
portgroups:
|
portgroups:
|
||||||
- {{ portgroups.docker_registry }}
|
- {{ portgroups.docker_registry }}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
include:
|
include:
|
||||||
- ssl
|
- ssl
|
||||||
{% if GLOBALS.role not in ['so-receiver'] %}
|
{% if GLOBALS.role not in ['so-receiver','so-fleet'] %}
|
||||||
- elasticsearch
|
- elasticsearch
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ rediskeyperms:
|
|||||||
- group: 939
|
- group: 939
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if grains['role'] in ['so-manager', 'so-eval', 'so-managersearch', 'so-standalone', 'so-import', 'so-heavynode'] %}
|
{% if grains['role'] in ['so-manager', 'so-eval', 'so-managersearch', 'so-standalone', 'so-import', 'so-heavynode', 'so-fleet'] %}
|
||||||
etc_elasticfleet_key:
|
etc_elasticfleet_key:
|
||||||
x509.private_key_managed:
|
x509.private_key_managed:
|
||||||
- name: /etc/pki/elasticfleet.key
|
- name: /etc/pki/elasticfleet.key
|
||||||
|
|||||||
@@ -382,6 +382,7 @@ base:
|
|||||||
- sensoroni
|
- sensoroni
|
||||||
- telegraf
|
- telegraf
|
||||||
- firewall
|
- firewall
|
||||||
|
- logstash
|
||||||
- elastic-fleet
|
- elastic-fleet
|
||||||
- schedule
|
- schedule
|
||||||
- docker_clean
|
- docker_clean
|
||||||
|
|||||||
1
salt/vars/fleet.map.jinja
Normal file
1
salt/vars/fleet.map.jinja
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{% set ROLE_GLOBALS = {} %}
|
||||||
Reference in New Issue
Block a user