mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Merge pull request #10233 from Security-Onion-Solutions/mkrfixes
Several Fixes
This commit is contained in:
@@ -1,6 +0,0 @@
|
|||||||
logstash:
|
|
||||||
pipelines:
|
|
||||||
fleet:
|
|
||||||
config:
|
|
||||||
- so/0012_input_elastic_agent.conf
|
|
||||||
- so/9806_output_lumberjack_fleet.conf.jinja
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
logstash:
|
|
||||||
pipelines:
|
|
||||||
helix:
|
|
||||||
config:
|
|
||||||
- so/0010_input_hhbeats.conf
|
|
||||||
- so/1033_preprocess_snort.conf
|
|
||||||
- so/1100_preprocess_bro_conn.conf
|
|
||||||
- so/1101_preprocess_bro_dhcp.conf
|
|
||||||
- so/1102_preprocess_bro_dns.conf
|
|
||||||
- so/1103_preprocess_bro_dpd.conf
|
|
||||||
- so/1104_preprocess_bro_files.conf
|
|
||||||
- so/1105_preprocess_bro_ftp.conf
|
|
||||||
- so/1106_preprocess_bro_http.conf
|
|
||||||
- so/1107_preprocess_bro_irc.conf
|
|
||||||
- so/1108_preprocess_bro_kerberos.conf
|
|
||||||
- so/1109_preprocess_bro_notice.conf
|
|
||||||
- so/1110_preprocess_bro_rdp.conf
|
|
||||||
- so/1111_preprocess_bro_signatures.conf
|
|
||||||
- so/1112_preprocess_bro_smtp.conf
|
|
||||||
- so/1113_preprocess_bro_snmp.conf
|
|
||||||
- so/1114_preprocess_bro_software.conf
|
|
||||||
- so/1115_preprocess_bro_ssh.conf
|
|
||||||
- so/1116_preprocess_bro_ssl.conf
|
|
||||||
- so/1117_preprocess_bro_syslog.conf
|
|
||||||
- so/1118_preprocess_bro_tunnel.conf
|
|
||||||
- so/1119_preprocess_bro_weird.conf
|
|
||||||
- so/1121_preprocess_bro_mysql.conf
|
|
||||||
- so/1122_preprocess_bro_socks.conf
|
|
||||||
- so/1123_preprocess_bro_x509.conf
|
|
||||||
- so/1124_preprocess_bro_intel.conf
|
|
||||||
- so/1125_preprocess_bro_modbus.conf
|
|
||||||
- so/1126_preprocess_bro_sip.conf
|
|
||||||
- so/1127_preprocess_bro_radius.conf
|
|
||||||
- so/1128_preprocess_bro_pe.conf
|
|
||||||
- so/1129_preprocess_bro_rfb.conf
|
|
||||||
- so/1130_preprocess_bro_dnp3.conf
|
|
||||||
- so/1131_preprocess_bro_smb_files.conf
|
|
||||||
- so/1132_preprocess_bro_smb_mapping.conf
|
|
||||||
- so/1133_preprocess_bro_ntlm.conf
|
|
||||||
- so/1134_preprocess_bro_dce_rpc.conf
|
|
||||||
- so/8001_postprocess_common_ip_augmentation.conf
|
|
||||||
- so/9997_output_helix.conf.jinja
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
logstash:
|
|
||||||
pipelines:
|
|
||||||
manager:
|
|
||||||
config:
|
|
||||||
- so/0011_input_endgame.conf
|
|
||||||
- so/0012_input_elastic_agent.conf
|
|
||||||
- so/0013_input_lumberjack_fleet.conf
|
|
||||||
- so/9999_output_redis.conf.jinja
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
logstash:
|
|
||||||
pipelines:
|
|
||||||
receiver:
|
|
||||||
config:
|
|
||||||
- so/0011_input_endgame.conf
|
|
||||||
- so/0012_input_elastic_agent.conf
|
|
||||||
- so/9999_output_redis.conf.jinja
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
logstash:
|
|
||||||
pipelines:
|
|
||||||
search:
|
|
||||||
config:
|
|
||||||
- so/0900_input_redis.conf.jinja
|
|
||||||
- so/9805_output_elastic_agent.conf.jinja
|
|
||||||
- so/9900_output_endgame.conf.jinja
|
|
||||||
176
pillar/top.sls
176
pillar/top.sls
@@ -1,47 +1,26 @@
|
|||||||
base:
|
base:
|
||||||
'*':
|
'*':
|
||||||
- patch.needs_restarting
|
- global.soc_global
|
||||||
- ntp.soc_ntp
|
- global.adv_global
|
||||||
- ntp.adv_ntp
|
|
||||||
- logrotate
|
|
||||||
- docker.soc_docker
|
- docker.soc_docker
|
||||||
- docker.adv_docker
|
- docker.adv_docker
|
||||||
- firewall.soc_firewall
|
- firewall.soc_firewall
|
||||||
- firewall.adv_firewall
|
- firewall.adv_firewall
|
||||||
|
- influxdb.token
|
||||||
|
- logrotate.soc_logrotate
|
||||||
|
- logrotate.adv_logrotate
|
||||||
|
- nginx.soc_nginx
|
||||||
|
- nginx.adv_nginx
|
||||||
|
- node_data.ips
|
||||||
|
- ntp.soc_ntp
|
||||||
|
- ntp.adv_ntp
|
||||||
|
- patch.needs_restarting
|
||||||
|
- patch.soc_patch
|
||||||
|
- patch.adv_patch
|
||||||
- sensoroni.soc_sensoroni
|
- sensoroni.soc_sensoroni
|
||||||
- sensoroni.adv_sensoroni
|
- sensoroni.adv_sensoroni
|
||||||
- telegraf.soc_telegraf
|
- telegraf.soc_telegraf
|
||||||
- telegraf.adv_telegraf
|
- telegraf.adv_telegraf
|
||||||
- influxdb.token
|
|
||||||
- node_data.ips
|
|
||||||
|
|
||||||
'* and not *_eval and not *_import':
|
|
||||||
- logstash.nodes
|
|
||||||
|
|
||||||
'*_eval or *_heavynode or *_sensor or *_standalone or *_import':
|
|
||||||
- match: compound
|
|
||||||
- zeek.soc_zeek
|
|
||||||
- zeek.adv_zeek
|
|
||||||
- bpf.soc_bpf
|
|
||||||
- bpf.adv_bpf
|
|
||||||
|
|
||||||
'*_managersearch or *_heavynode':
|
|
||||||
- match: compound
|
|
||||||
- logstash
|
|
||||||
- logstash.manager
|
|
||||||
- logstash.search
|
|
||||||
- logstash.soc_logstash
|
|
||||||
- logstash.adv_logstash
|
|
||||||
- elasticsearch.index_templates
|
|
||||||
- elasticsearch.soc_elasticsearch
|
|
||||||
- elasticsearch.adv_elasticsearch
|
|
||||||
|
|
||||||
'*_manager':
|
|
||||||
- logstash
|
|
||||||
- logstash.manager
|
|
||||||
- logstash.soc_logstash
|
|
||||||
- logstash.adv_logstash
|
|
||||||
- elasticsearch.index_templates
|
|
||||||
|
|
||||||
'*_manager or *_managersearch':
|
'*_manager or *_managersearch':
|
||||||
- match: compound
|
- match: compound
|
||||||
@@ -52,14 +31,19 @@ base:
|
|||||||
- kibana.secrets
|
- kibana.secrets
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- secrets
|
- secrets
|
||||||
- global.soc_global
|
|
||||||
- global.adv_global
|
|
||||||
- manager.soc_manager
|
- manager.soc_manager
|
||||||
- manager.adv_manager
|
- manager.adv_manager
|
||||||
- idstools.soc_idstools
|
- idstools.soc_idstools
|
||||||
- idstools.adv_idstools
|
- idstools.adv_idstools
|
||||||
|
- logstash.nodes
|
||||||
|
- logstash.soc_logstash
|
||||||
|
- logstash.adv_logstash
|
||||||
- soc.soc_soc
|
- soc.soc_soc
|
||||||
- soc.adv_soc
|
- soc.adv_soc
|
||||||
|
- soctopus.soc_soctopus
|
||||||
|
- soctopus.adv_soctopus
|
||||||
|
- kibana.soc_kibana
|
||||||
|
- kibana.adv_kibana
|
||||||
- kratos.soc_kratos
|
- kratos.soc_kratos
|
||||||
- kratos.adv_kratos
|
- kratos.adv_kratos
|
||||||
- redis.soc_redis
|
- redis.soc_redis
|
||||||
@@ -68,15 +52,29 @@ base:
|
|||||||
- influxdb.adv_influxdb
|
- influxdb.adv_influxdb
|
||||||
- elasticsearch.soc_elasticsearch
|
- elasticsearch.soc_elasticsearch
|
||||||
- elasticsearch.adv_elasticsearch
|
- elasticsearch.adv_elasticsearch
|
||||||
|
- elastalert.soc_elastalert
|
||||||
|
- elastalert.adv_elastalert
|
||||||
- backup.soc_backup
|
- backup.soc_backup
|
||||||
- backup.adv_backup
|
- backup.adv_backup
|
||||||
|
- curator.soc_curator
|
||||||
|
- curator.adv_curator
|
||||||
|
- soctopus.soc_soctopus
|
||||||
|
- soctopus.adv_soctopus
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
- minions.adv_{{ grains.id }}
|
||||||
|
|
||||||
'*_sensor':
|
'*_sensor':
|
||||||
- healthcheck.sensor
|
- healthcheck.sensor
|
||||||
- global.soc_global
|
- strelka.soc_strelka
|
||||||
- global.adv_global
|
- strelka.adv_strelka
|
||||||
|
- zeek.soc_zeek
|
||||||
|
- zeek.adv_zeek
|
||||||
|
- bpf.soc_bpf
|
||||||
|
- bpf.adv_bpf
|
||||||
|
- pcap.soc_pcap
|
||||||
|
- pcap.adv_pcap
|
||||||
|
- suricata.soc_suricata
|
||||||
|
- suricata.adv_suricata
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
- minions.adv_{{ grains.id }}
|
||||||
|
|
||||||
@@ -90,16 +88,23 @@ base:
|
|||||||
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/kibana/secrets.sls') %}
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/kibana/secrets.sls') %}
|
||||||
- kibana.secrets
|
- kibana.secrets
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- global.soc_global
|
|
||||||
- global.adv_global
|
|
||||||
- kratos.soc_kratos
|
- kratos.soc_kratos
|
||||||
- elasticsearch.soc_elasticsearch
|
- elasticsearch.soc_elasticsearch
|
||||||
- elasticsearch.adv_elasticsearch
|
- elasticsearch.adv_elasticsearch
|
||||||
|
- elastalert.soc_elastalert
|
||||||
|
- elastalert.adv_elastalert
|
||||||
- manager.soc_manager
|
- manager.soc_manager
|
||||||
- manager.adv_manager
|
- manager.adv_manager
|
||||||
- idstools.soc_idstools
|
- idstools.soc_idstools
|
||||||
- idstools.adv_idstools
|
- idstools.adv_idstools
|
||||||
- soc.soc_soc
|
- soc.soc_soc
|
||||||
|
- soc.adv_soc
|
||||||
|
- soctopus.soc_soctopus
|
||||||
|
- soctopus.adv_soctopus
|
||||||
|
- strelka.soc_strelka
|
||||||
|
- strelka.adv_strelka
|
||||||
|
- curator.soc_curator
|
||||||
|
- curator.adv_curator
|
||||||
- kratos.soc_kratos
|
- kratos.soc_kratos
|
||||||
- kratos.adv_kratos
|
- kratos.adv_kratos
|
||||||
- redis.soc_redis
|
- redis.soc_redis
|
||||||
@@ -108,13 +113,19 @@ base:
|
|||||||
- influxdb.adv_influxdb
|
- influxdb.adv_influxdb
|
||||||
- backup.soc_backup
|
- backup.soc_backup
|
||||||
- backup.adv_backup
|
- backup.adv_backup
|
||||||
|
- zeek.soc_zeek
|
||||||
|
- zeek.adv_zeek
|
||||||
|
- bpf.soc_bpf
|
||||||
|
- bpf.adv_bpf
|
||||||
|
- pcap.soc_pcap
|
||||||
|
- pcap.adv_pcap
|
||||||
|
- suricata.soc_suricata
|
||||||
|
- suricata.adv_suricata
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
- minions.adv_{{ grains.id }}
|
||||||
|
|
||||||
'*_standalone':
|
'*_standalone':
|
||||||
- logstash
|
- logstash.nodes
|
||||||
- logstash.manager
|
|
||||||
- logstash.search
|
|
||||||
- logstash.soc_logstash
|
- logstash.soc_logstash
|
||||||
- logstash.adv_logstash
|
- logstash.adv_logstash
|
||||||
- elasticsearch.index_templates
|
- elasticsearch.index_templates
|
||||||
@@ -126,8 +137,6 @@ base:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
- secrets
|
- secrets
|
||||||
- healthcheck.standalone
|
- healthcheck.standalone
|
||||||
- global.soc_global
|
|
||||||
- global.adv_global
|
|
||||||
- idstools.soc_idstools
|
- idstools.soc_idstools
|
||||||
- idstools.adv_idstools
|
- idstools.adv_idstools
|
||||||
- kratos.soc_kratos
|
- kratos.soc_kratos
|
||||||
@@ -138,50 +147,77 @@ base:
|
|||||||
- influxdb.adv_influxdb
|
- influxdb.adv_influxdb
|
||||||
- elasticsearch.soc_elasticsearch
|
- elasticsearch.soc_elasticsearch
|
||||||
- elasticsearch.adv_elasticsearch
|
- elasticsearch.adv_elasticsearch
|
||||||
|
- elastalert.soc_elastalert
|
||||||
|
- elastalert.adv_elastalert
|
||||||
- manager.soc_manager
|
- manager.soc_manager
|
||||||
- manager.adv_manager
|
- manager.adv_manager
|
||||||
- soc.soc_soc
|
- soc.soc_soc
|
||||||
|
- soc.adv_soc
|
||||||
|
- soctopus.soc_soctopus
|
||||||
|
- soctopus.adv_soctopus
|
||||||
|
- strelka.soc_strelka
|
||||||
|
- strelka.adv_strelka
|
||||||
|
- curator.soc_curator
|
||||||
|
- curator.adv_curator
|
||||||
- backup.soc_backup
|
- backup.soc_backup
|
||||||
- backup.adv_backup
|
- backup.adv_backup
|
||||||
|
- zeek.soc_zeek
|
||||||
|
- zeek.adv_zeek
|
||||||
|
- bpf.soc_bpf
|
||||||
|
- bpf.adv_bpf
|
||||||
|
- pcap.soc_pcap
|
||||||
|
- pcap.adv_pcap
|
||||||
|
- suricata.soc_suricata
|
||||||
|
- suricata.adv_suricata
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
- minions.adv_{{ grains.id }}
|
||||||
|
|
||||||
'*_heavynode':
|
'*_heavynode':
|
||||||
- elasticsearch.auth
|
- elasticsearch.auth
|
||||||
- global.soc_global
|
- logstash.nodes
|
||||||
- global.adv_global
|
- logstash.soc_logstash
|
||||||
|
- logstash.adv_logstash
|
||||||
|
- elasticsearch.soc_elasticsearch
|
||||||
|
- elasticsearch.adv_elasticsearch
|
||||||
|
- curator.soc_curator
|
||||||
|
- curator.adv_curator
|
||||||
- redis.soc_redis
|
- redis.soc_redis
|
||||||
|
- redis.adv_redis
|
||||||
|
- zeek.soc_zeek
|
||||||
|
- zeek.adv_zeek
|
||||||
|
- bpf.soc_bpf
|
||||||
|
- bpf.adv_bpf
|
||||||
|
- pcap.soc_pcap
|
||||||
|
- pcap.adv_pcap
|
||||||
|
- suricata.soc_suricata
|
||||||
|
- suricata.adv_suricata
|
||||||
|
- strelka.soc_strelka
|
||||||
|
- strelka.adv_strelka
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
- minions.adv_{{ grains.id }}
|
||||||
|
|
||||||
'*_idh':
|
'*_idh':
|
||||||
- global.soc_global
|
|
||||||
- global.adv_global
|
|
||||||
- idh.soc_idh
|
- idh.soc_idh
|
||||||
- idh.adv_idh
|
- idh.adv_idh
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
- minions.adv_{{ grains.id }}
|
||||||
|
|
||||||
'*_searchnode':
|
'*_searchnode':
|
||||||
- logstash
|
- logstash.nodes
|
||||||
- logstash.search
|
|
||||||
- logstash.soc_logstash
|
- logstash.soc_logstash
|
||||||
- logstash.adv_logstash
|
- logstash.adv_logstash
|
||||||
- elasticsearch.index_templates
|
|
||||||
- elasticsearch.soc_elasticsearch
|
- elasticsearch.soc_elasticsearch
|
||||||
- elasticsearch.adv_elasticsearch
|
- elasticsearch.adv_elasticsearch
|
||||||
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
||||||
- elasticsearch.auth
|
- elasticsearch.auth
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- redis.soc_redis
|
- redis.soc_redis
|
||||||
- global.soc_global
|
- redis.adv_redis
|
||||||
- global.adv_global
|
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
- minions.adv_{{ grains.id }}
|
||||||
|
|
||||||
'*_receiver':
|
'*_receiver':
|
||||||
- logstash
|
- logstash.nodes
|
||||||
- logstash.receiver
|
|
||||||
- logstash.soc_logstash
|
- logstash.soc_logstash
|
||||||
- logstash.adv_logstash
|
- logstash.adv_logstash
|
||||||
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
{% if salt['file.file_exists']('/opt/so/saltstack/local/pillar/elasticsearch/auth.sls') %}
|
||||||
@@ -189,8 +225,6 @@ base:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
- redis.soc_redis
|
- redis.soc_redis
|
||||||
- redis.adv_redis
|
- redis.adv_redis
|
||||||
- global.soc_global
|
|
||||||
- global.adv_global
|
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
- minions.adv_{{ grains.id }}
|
||||||
|
|
||||||
@@ -206,11 +240,16 @@ base:
|
|||||||
- kratos.soc_kratos
|
- kratos.soc_kratos
|
||||||
- elasticsearch.soc_elasticsearch
|
- elasticsearch.soc_elasticsearch
|
||||||
- elasticsearch.adv_elasticsearch
|
- elasticsearch.adv_elasticsearch
|
||||||
|
- elastalert.soc_elastalert
|
||||||
|
- elastalert.adv_elastalert
|
||||||
- manager.soc_manager
|
- manager.soc_manager
|
||||||
- manager.adv_manager
|
- manager.adv_manager
|
||||||
- soc.soc_soc
|
- soc.soc_soc
|
||||||
- global.soc_global
|
- soc.adv_soc
|
||||||
- global.adv_global
|
- soctopus.soc_soctopus
|
||||||
|
- soctopus.adv_soctopus
|
||||||
|
- curator.soc_curator
|
||||||
|
- curator.adv_curator
|
||||||
- backup.soc_backup
|
- backup.soc_backup
|
||||||
- backup.adv_backup
|
- backup.adv_backup
|
||||||
- kratos.soc_kratos
|
- kratos.soc_kratos
|
||||||
@@ -219,21 +258,28 @@ base:
|
|||||||
- redis.adv_redis
|
- redis.adv_redis
|
||||||
- influxdb.soc_influxdb
|
- influxdb.soc_influxdb
|
||||||
- influxdb.adv_influxdb
|
- influxdb.adv_influxdb
|
||||||
|
- zeek.soc_zeek
|
||||||
|
- zeek.adv_zeek
|
||||||
|
- bpf.soc_bpf
|
||||||
|
- bpf.adv_bpf
|
||||||
|
- pcap.soc_pcap
|
||||||
|
- pcap.adv_pcap
|
||||||
|
- suricata.soc_suricata
|
||||||
|
- suricata.adv_suricata
|
||||||
|
- strelka.soc_strelka
|
||||||
|
- strelka.adv_strelka
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
- minions.adv_{{ grains.id }}
|
||||||
|
|
||||||
'*_fleet':
|
'*_fleet':
|
||||||
- global.soc_global
|
|
||||||
- global.adv_global
|
|
||||||
- backup.soc_backup
|
- backup.soc_backup
|
||||||
- backup.adv_backup
|
- backup.adv_backup
|
||||||
- logstash
|
- logstash.nodes
|
||||||
- logstash.fleet
|
|
||||||
- logstash.soc_logstash
|
- logstash.soc_logstash
|
||||||
- logstash.adv_logstash
|
- logstash.adv_logstash
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
- minions.adv_{{ grains.id }}
|
||||||
|
|
||||||
'*_workstation':
|
'*_desktop':
|
||||||
- minions.{{ grains.id }}
|
- minions.{{ grains.id }}
|
||||||
- minions.adv_{{ grains.id }}
|
- minions.adv_{{ grains.id }}
|
||||||
|
|||||||
@@ -49,13 +49,12 @@ so-status.conf:
|
|||||||
- name: /opt/so/conf/so-status/so-status.conf
|
- name: /opt/so/conf/so-status/so-status.conf
|
||||||
- unless: ls /opt/so/conf/so-status/so-status.conf
|
- unless: ls /opt/so/conf/so-status/so-status.conf
|
||||||
|
|
||||||
sosaltstackperms:
|
socore_opso_perms:
|
||||||
file.directory:
|
file.directory:
|
||||||
- name: /opt/so/saltstack
|
- name: /opt/so
|
||||||
- user: 939
|
- user: 939
|
||||||
- group: 939
|
- group: 939
|
||||||
- dir_mode: 770
|
|
||||||
|
|
||||||
so_log_perms:
|
so_log_perms:
|
||||||
file.directory:
|
file.directory:
|
||||||
- name: /opt/so/log
|
- name: /opt/so/log
|
||||||
@@ -112,21 +111,23 @@ elastic_curl_config:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
# Sync some Utilities
|
|
||||||
utilsyncscripts:
|
common_sbin:
|
||||||
file.recurse:
|
file.recurse:
|
||||||
- name: /usr/sbin
|
- name: /usr/sbin
|
||||||
- user: root
|
- source: salt://common/tools/sbin
|
||||||
- group: root
|
- user: 939
|
||||||
|
- group: 939
|
||||||
|
- file_mode: 755
|
||||||
|
|
||||||
|
common_sbin_jinja:
|
||||||
|
file.recurse:
|
||||||
|
- name: /usr/sbin
|
||||||
|
- source: salt://common/tools/sbin_jinja
|
||||||
|
- user: 939
|
||||||
|
- group: 939
|
||||||
- file_mode: 755
|
- file_mode: 755
|
||||||
- template: jinja
|
- template: jinja
|
||||||
- source: salt://common/tools/sbin
|
|
||||||
- exclude_pat:
|
|
||||||
- so-common
|
|
||||||
- so-firewall
|
|
||||||
- so-image-common
|
|
||||||
- soup
|
|
||||||
- so-status
|
|
||||||
|
|
||||||
so-status_script:
|
so-status_script:
|
||||||
file.managed:
|
file.managed:
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-eval','so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode', 'so-import']%}
|
|
||||||
/usr/sbin/so-restart elasticsearch $1
|
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-eval', 'so-manager', 'so-managersearch', 'so-standalone', 'so-import']%}
|
|
||||||
/usr/sbin/so-restart kibana $1
|
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
|
|
||||||
/usr/sbin/so-restart logstash $1
|
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
|
|
||||||
/usr/sbin/so-restart curator $1
|
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-eval','so-manager', 'so-managersearch', 'so-standalone']%}
|
|
||||||
/usr/sbin/so-restart elastalert $1
|
|
||||||
{%- endif %}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-eval','so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode', 'so-import']%}
|
|
||||||
/usr/sbin/so-start elasticsearch $1
|
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-eval', 'so-manager', 'so-managersearch', 'so-standalone', 'so-import']%}
|
|
||||||
/usr/sbin/so-start kibana $1
|
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
|
|
||||||
/usr/sbin/so-start logstash $1
|
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
|
|
||||||
/usr/sbin/so-start curator $1
|
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-eval','so-manager', 'so-managersearch', 'so-standalone']%}
|
|
||||||
/usr/sbin/so-start elastalert $1
|
|
||||||
{%- endif %}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-eval','so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode', 'so-import']%}
|
|
||||||
/usr/sbin/so-stop elasticsearch $1
|
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-eval', 'so-manager', 'so-managersearch', 'so-standalone', 'so-import']%}
|
|
||||||
/usr/sbin/so-stop kibana $1
|
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
|
|
||||||
/usr/sbin/so-stop logstash $1
|
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
|
|
||||||
/usr/sbin/so-stop curator $1
|
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
{%- if grains['role'] in ['so-eval','so-manager', 'so-managersearch', 'so-standalone']%}
|
|
||||||
/usr/sbin/so-stop elastalert $1
|
|
||||||
{%- endif %}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
|
|
||||||
IP={{ salt['grains.get']('ip_interfaces').get(salt['pillar.get']('sensor:mainint', salt['pillar.get']('manager:mainint', salt['pillar.get']('elasticsearch:mainint', salt['pillar.get']('host:mainint')))))[0] }}
|
|
||||||
ESPORT=9200
|
|
||||||
|
|
||||||
echo "Removing read only attributes for indices..."
|
|
||||||
echo
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -XPUT -H "Content-Type: application/json" -L https://$IP:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}' 2>&1 | if grep -q ack; then echo "Index settings updated..."; else echo "There was any issue updating the read-only attribute. Please ensure Elasticsearch is running.";fi;
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
local_salt_dir=/opt/so/saltstack/local
|
|
||||||
|
|
||||||
got_root() {
|
|
||||||
|
|
||||||
# Make sure you are root
|
|
||||||
if [ "$(id -u)" -ne 0 ]; then
|
|
||||||
echo "This script must be run using sudo!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
got_root
|
|
||||||
if [ ! -f $local_salt_dir/pillar/fireeye/init.sls ]; then
|
|
||||||
echo "This is nto configured for Helix Mode. Please re-install."
|
|
||||||
exit
|
|
||||||
else
|
|
||||||
echo "Enter your Helix API Key: "
|
|
||||||
read APIKEY
|
|
||||||
sed -i "s/^ api_key.*/ api_key: $APIKEY/g" $local_salt_dir/pillar/fireeye/init.sls
|
|
||||||
docker stop so-logstash
|
|
||||||
docker rm so-logstash
|
|
||||||
echo "Restarting Logstash for updated key"
|
|
||||||
salt-call state.apply logstash queue=True
|
|
||||||
fi
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
{% set MAININT = salt['pillar.get']('host:mainint') -%}
|
|
||||||
{% set NODEIP = salt['grains.get']('ip_interfaces').get(MAININT)[0] -%}
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
if [ "$1" == "" ]; then
|
|
||||||
for i in $(curl -s -L http://{{ NODEIP }}:9600/_node/stats | jq .pipelines | jq '. | to_entries | .[].key' | sed 's/\"//g'); do echo ${i^}:; curl -s localhost:9600/_node/stats | jq .pipelines.$i.events; done
|
|
||||||
else
|
|
||||||
curl -s -L http://{{ NODEIP }}:9600/_node/stats | jq .pipelines.$1.events
|
|
||||||
fi
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
docker exec -it so-redis redis-cli llen logstash:unparsed
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
/usr/sbin/so-start nodered $1
|
|
||||||
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
/usr/sbin/so-stop nodered $1
|
|
||||||
@@ -60,30 +60,21 @@ curconf:
|
|||||||
- template: jinja
|
- template: jinja
|
||||||
- show_changes: False
|
- show_changes: False
|
||||||
|
|
||||||
curclusterclose:
|
curator_sbin:
|
||||||
file.managed:
|
file.recurse:
|
||||||
- name: /usr/sbin/so-curator-cluster-close
|
- name: /usr/sbin
|
||||||
- source: salt://curator/files/bin/so-curator-cluster-close
|
- source: salt://curator/tools/sbin
|
||||||
- user: 934
|
- user: 934
|
||||||
- group: 939
|
- group: 939
|
||||||
- mode: 755
|
- file_mode: 755
|
||||||
- template: jinja
|
|
||||||
|
|
||||||
curclusterdelete:
|
curator_sbin_jinja:
|
||||||
file.managed:
|
file.recurse:
|
||||||
- name: /usr/sbin/so-curator-cluster-delete
|
- name: /usr/sbin
|
||||||
- source: salt://curator/files/bin/so-curator-cluster-delete
|
- source: salt://curator/tools/sbin_jinja
|
||||||
- user: 934
|
- user: 934
|
||||||
- group: 939
|
- group: 939
|
||||||
- mode: 755
|
- file_mode: 755
|
||||||
|
|
||||||
curclusterdeletedelete:
|
|
||||||
file.managed:
|
|
||||||
- name: /usr/sbin/so-curator-cluster-delete-delete
|
|
||||||
- source: salt://curator/files/bin/so-curator-cluster-delete-delete
|
|
||||||
- user: 934
|
|
||||||
- group: 939
|
|
||||||
- mode: 755
|
|
||||||
- template: jinja
|
- template: jinja
|
||||||
|
|
||||||
so-curator:
|
so-curator:
|
||||||
|
|||||||
0
salt/common/tools/sbin/so-curator-restart → salt/curator/tools/sbin/so-curator-restart
Executable file → Normal file
0
salt/common/tools/sbin/so-curator-restart → salt/curator/tools/sbin/so-curator-restart
Executable file → Normal file
0
salt/common/tools/sbin/so-curator-start → salt/curator/tools/sbin/so-curator-start
Executable file → Normal file
0
salt/common/tools/sbin/so-curator-start → salt/curator/tools/sbin/so-curator-start
Executable file → Normal file
0
salt/common/tools/sbin/so-curator-stop → salt/curator/tools/sbin/so-curator-stop
Executable file → Normal file
0
salt/common/tools/sbin/so-curator-stop → salt/curator/tools/sbin/so-curator-stop
Executable file → Normal file
@@ -26,10 +26,10 @@ dockerheldpackages:
|
|||||||
dockerheldpackages:
|
dockerheldpackages:
|
||||||
pkg.installed:
|
pkg.installed:
|
||||||
- pkgs:
|
- pkgs:
|
||||||
- containerd.io: 1.6.18-3.1.el9
|
- containerd.io: 1.6.20-3.1.el9
|
||||||
- docker-ce: 23.0.1-1.el9
|
- docker-ce: 23.0.5-1.el9
|
||||||
- docker-ce-cli: 23.0.1-1.el9
|
- docker-ce-cli: 23.0.5-1.el9
|
||||||
- docker-ce-rootless-extras: 23.0.1-1.el9
|
- docker-ce-rootless-extras: 23.0.5-1.el9
|
||||||
- hold: True
|
- hold: True
|
||||||
- update_holds: True
|
- update_holds: True
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -29,6 +29,23 @@ elastalogdir:
|
|||||||
- group: 933
|
- group: 933
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
|
|
||||||
|
elastalert_sbin:
|
||||||
|
file.recurse:
|
||||||
|
- name: /usr/sbin
|
||||||
|
- source: salt://elastalert/tools/sbin
|
||||||
|
- user: 933
|
||||||
|
- group: 939
|
||||||
|
- file_mode: 755
|
||||||
|
|
||||||
|
#elastalert_sbin_jinja:
|
||||||
|
# file.recurse:
|
||||||
|
# - name: /usr/sbin
|
||||||
|
# - source: salt://elastalert/tools/sbin_jinja
|
||||||
|
# - user: 933
|
||||||
|
# - group: 939
|
||||||
|
# - file_mode: 755
|
||||||
|
# - template: jinja
|
||||||
|
|
||||||
elastarules:
|
elastarules:
|
||||||
file.directory:
|
file.directory:
|
||||||
- name: /opt/so/rules/elastalert
|
- name: /opt/so/rules/elastalert
|
||||||
|
|||||||
@@ -25,6 +25,23 @@ elastic-agent:
|
|||||||
- home: /opt/so/conf/elastic-fleet
|
- home: /opt/so/conf/elastic-fleet
|
||||||
- createhome: False
|
- createhome: False
|
||||||
|
|
||||||
|
elasticfleet_sbin:
|
||||||
|
file.recurse:
|
||||||
|
- name: /usr/sbin
|
||||||
|
- source: salt://elasticfleet/tools/sbin
|
||||||
|
- user: 947
|
||||||
|
- group: 939
|
||||||
|
- file_mode: 755
|
||||||
|
|
||||||
|
elasticfleet_sbin_jinja:
|
||||||
|
file.recurse:
|
||||||
|
- name: /usr/sbin
|
||||||
|
- source: salt://elasticfleet/tools/sbin_jinja
|
||||||
|
- user: 947
|
||||||
|
- group: 939
|
||||||
|
- file_mode: 755
|
||||||
|
- template: jinja
|
||||||
|
|
||||||
eaconfdir:
|
eaconfdir:
|
||||||
file.directory:
|
file.directory:
|
||||||
- name: /opt/so/conf/elastic-fleet
|
- name: /opt/so/conf/elastic-fleet
|
||||||
|
|||||||
@@ -21,12 +21,33 @@ vm.max_map_count:
|
|||||||
sysctl.present:
|
sysctl.present:
|
||||||
- value: 262144
|
- value: 262144
|
||||||
|
|
||||||
|
# Add ES Group
|
||||||
|
elasticsearchgroup:
|
||||||
|
group.present:
|
||||||
|
- name: elasticsearch
|
||||||
|
- gid: 930
|
||||||
|
|
||||||
|
esconfdir:
|
||||||
|
file.directory:
|
||||||
|
- name: /opt/so/conf/elasticsearch
|
||||||
|
- user: 930
|
||||||
|
- group: 939
|
||||||
|
- makedirs: True
|
||||||
|
|
||||||
|
# Add ES user
|
||||||
|
elasticsearch:
|
||||||
|
user.present:
|
||||||
|
- uid: 930
|
||||||
|
- gid: 930
|
||||||
|
- home: /opt/so/conf/elasticsearch
|
||||||
|
- createhome: False
|
||||||
|
|
||||||
{% if GLOBALS.is_manager %}
|
{% if GLOBALS.is_manager %}
|
||||||
# We have to add the Manager CA to the CA list
|
# We have to add the Manager CA to the CA list
|
||||||
cascriptsync:
|
cascriptsync:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: /usr/sbin/so-catrust
|
- name: /usr/sbin/so-catrust
|
||||||
- source: salt://elasticsearch/tools/sbin/so-catrust
|
- source: salt://elasticsearch/tools/sbin_jinja/so-catrust
|
||||||
- user: 939
|
- user: 939
|
||||||
- group: 939
|
- group: 939
|
||||||
- mode: 750
|
- mode: 750
|
||||||
@@ -42,25 +63,34 @@ cascriptfun:
|
|||||||
- file: cascriptsync
|
- file: cascriptsync
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
# Sync some es scripts
|
elasticsearch_sbin:
|
||||||
es_sync_scripts:
|
|
||||||
file.recurse:
|
file.recurse:
|
||||||
- name: /usr/sbin
|
- name: /usr/sbin
|
||||||
- user: root
|
- source: salt://elasticsearch/tools/sbin
|
||||||
- group: root
|
- user: 930
|
||||||
|
- group: 939
|
||||||
|
- file_mode: 755
|
||||||
|
- exclude_pat:
|
||||||
|
- so-catrust
|
||||||
|
- so-elasticsearch-pipelines # exclude this because we need to watch it for changes, we sync it in another state
|
||||||
|
|
||||||
|
elasticsearch_sbin_jinja:
|
||||||
|
file.recurse:
|
||||||
|
- name: /usr/sbin
|
||||||
|
- source: salt://elasticsearch/tools/sbin_jinja
|
||||||
|
- user: 939
|
||||||
|
- group: 939
|
||||||
- file_mode: 755
|
- file_mode: 755
|
||||||
- template: jinja
|
- template: jinja
|
||||||
- source: salt://elasticsearch/tools/sbin
|
|
||||||
- exclude_pat:
|
- exclude_pat:
|
||||||
- so-elasticsearch-pipelines # exclude this because we need to watch it for changes, we sync it in another state
|
- so-elasticsearch-ilm-policy-load # exclude this because we need to watch it for changes, we sync it in another state
|
||||||
- so-elasticsearch-ilm-policy-load
|
|
||||||
- defaults:
|
- defaults:
|
||||||
GLOBALS: {{ GLOBALS }}
|
GLOBALS: {{ GLOBALS }}
|
||||||
|
|
||||||
so-elasticsearch-ilm-policy-load-script:
|
so-elasticsearch-ilm-policy-load-script:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: /usr/sbin/so-elasticsearch-ilm-policy-load
|
- name: /usr/sbin/so-elasticsearch-ilm-policy-load
|
||||||
- source: salt://elasticsearch/tools/sbin/so-elasticsearch-ilm-policy-load
|
- source: salt://elasticsearch/tools/sbin_jinja/so-elasticsearch-ilm-policy-load
|
||||||
- user: 930
|
- user: 930
|
||||||
- group: 939
|
- group: 939
|
||||||
- mode: 754
|
- mode: 754
|
||||||
@@ -96,29 +126,6 @@ capemz:
|
|||||||
- user: 939
|
- user: 939
|
||||||
- group: 939
|
- group: 939
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Add ES Group
|
|
||||||
elasticsearchgroup:
|
|
||||||
group.present:
|
|
||||||
- name: elasticsearch
|
|
||||||
- gid: 930
|
|
||||||
|
|
||||||
# Add ES user
|
|
||||||
elasticsearch:
|
|
||||||
user.present:
|
|
||||||
- uid: 930
|
|
||||||
- gid: 930
|
|
||||||
- home: /opt/so/conf/elasticsearch
|
|
||||||
- createhome: False
|
|
||||||
|
|
||||||
esconfdir:
|
|
||||||
file.directory:
|
|
||||||
- name: /opt/so/conf/elasticsearch
|
|
||||||
- user: 930
|
|
||||||
- group: 939
|
|
||||||
- makedirs: True
|
|
||||||
|
|
||||||
esingestdir:
|
esingestdir:
|
||||||
file.directory:
|
file.directory:
|
||||||
- name: /opt/so/conf/elasticsearch/ingest
|
- name: /opt/so/conf/elasticsearch/ingest
|
||||||
@@ -374,7 +381,7 @@ so-es-cluster-settings:
|
|||||||
- template: jinja
|
- template: jinja
|
||||||
- require:
|
- require:
|
||||||
- docker_container: so-elasticsearch
|
- docker_container: so-elasticsearch
|
||||||
- file: es_sync_scripts
|
- file: elasticsearch_sbin_jinja
|
||||||
|
|
||||||
so-elasticsearch-ilm-policy-load:
|
so-elasticsearch-ilm-policy-load:
|
||||||
cmd.run:
|
cmd.run:
|
||||||
@@ -393,7 +400,7 @@ so-elasticsearch-templates:
|
|||||||
- template: jinja
|
- template: jinja
|
||||||
- require:
|
- require:
|
||||||
- docker_container: so-elasticsearch
|
- docker_container: so-elasticsearch
|
||||||
- file: es_sync_scripts
|
- file: elasticsearch_sbin_jinja
|
||||||
|
|
||||||
so-elasticsearch-pipelines:
|
so-elasticsearch-pipelines:
|
||||||
cmd.run:
|
cmd.run:
|
||||||
@@ -409,7 +416,7 @@ so-elasticsearch-roles-load:
|
|||||||
- template: jinja
|
- template: jinja
|
||||||
- require:
|
- require:
|
||||||
- docker_container: so-elasticsearch
|
- docker_container: so-elasticsearch
|
||||||
- file: es_sync_scripts
|
- file: elasticsearch_sbin_jinja
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
# Elastic License 2.0.
|
# Elastic License 2.0.
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
SKIP=0
|
SKIP=0
|
||||||
@@ -59,7 +58,7 @@ done
|
|||||||
if [ $SKIP -ne 1 ]; then
|
if [ $SKIP -ne 1 ]; then
|
||||||
# List indices
|
# List indices
|
||||||
echo
|
echo
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -k -L https://{{ NODEIP }}:9200/_cat/indices?v
|
curl -K /opt/so/conf/elasticsearch/curl.config -k -L https://localhost:9200/_cat/indices?v
|
||||||
echo
|
echo
|
||||||
# Inform user we are about to delete all data
|
# Inform user we are about to delete all data
|
||||||
echo
|
echo
|
||||||
@@ -5,10 +5,9 @@
|
|||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
# Elastic License 2.0.
|
# Elastic License 2.0.
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_component_template | jq '.component_templates[] |.name'| sort
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://localhost:9200/_component_template | jq '.component_templates[] |.name'| sort
|
||||||
else
|
else
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_component_template/$1 | jq
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://localhost:9200/_component_template/$1 | jq
|
||||||
fi
|
fi
|
||||||
@@ -6,10 +6,8 @@
|
|||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
|
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_all/_ilm/explain | jq .
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://localhost:9200/_all/_ilm/explain | jq .
|
||||||
else
|
else
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/$1/_ilm/explain | jq .[]
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://localhost:9200/$1/_ilm/explain | jq .[]
|
||||||
fi
|
fi
|
||||||
@@ -6,6 +6,4 @@
|
|||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L -X DELETE https://localhost:9200/_ilm/policy/$1
|
||||||
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L -X DELETE https://{{ NODEIP }}:9200/_ilm/policy/$1
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
|
||||||
# Elastic License 2.0.
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
|
||||||
|
|
||||||
{% import_yaml 'elasticsearch/defaults.yaml' as ESCONFIG with context %}
|
|
||||||
{%- set ES_INDEX_SETTINGS = salt['pillar.get']('elasticsearch:index_settings', default=ESCONFIG.elasticsearch.index_settings, merge=True) %}
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
|
|
||||||
{%- for index, settings in ES_INDEX_SETTINGS.items() %}
|
|
||||||
{%- if settings.policy is defined %}
|
|
||||||
echo
|
|
||||||
echo "Setting up {{ index }}-logs policy..."
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -s -k -L -X PUT "https://{{ NODEIP }}:9200/_ilm/policy/{{ index }}-logs" -H 'Content-Type: application/json' -d'{ "policy": {{ settings.policy | tojson(true) }} }'
|
|
||||||
echo
|
|
||||||
{%- endif %}
|
|
||||||
{%- endfor %}
|
|
||||||
echo
|
|
||||||
@@ -6,10 +6,9 @@
|
|||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
|
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_ilm/policy | jq .
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://localhost:9200/_ilm/policy | jq .
|
||||||
else
|
else
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_ilm/policy/$1 | jq .[]
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://localhost:9200/_ilm/policy/$1 | jq .[]
|
||||||
fi
|
fi
|
||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
|
|
||||||
echo "Starting ILM..."
|
echo "Starting ILM..."
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L -X POST https://{{ NODEIP }}:9200/_ilm/start
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L -X POST https://localhost:9200/_ilm/start
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
/bin/bash
|
#!/bin/bash
|
||||||
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
@@ -6,6 +6,4 @@
|
|||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://localhost:9200/_ilm/status | jq .
|
||||||
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_ilm/status | jq .
|
|
||||||
@@ -6,7 +6,5 @@
|
|||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
|
|
||||||
echo "Stopping ILM..."
|
echo "Stopping ILM..."
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L -X POST https://{{ NODEIP }}:9200/_ilm/stop
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L -X POST https://localhost:9200/_ilm/stop
|
||||||
@@ -5,10 +5,9 @@
|
|||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
# Elastic License 2.0.
|
# Elastic License 2.0.
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_index_template | jq '.index_templates[] |.name'| sort
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://localhost:9200/_index_template | jq '.index_templates[] |.name'| sort
|
||||||
else
|
else
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_index_template/$1 | jq
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://localhost:9200/_index_template/$1 | jq
|
||||||
fi
|
fi
|
||||||
@@ -5,8 +5,6 @@
|
|||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
# Elastic License 2.0.
|
# Elastic License 2.0.
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L "https://{{ NODEIP }}:9200/_cat/indices?pretty&v&s=index"
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L "https://localhost:9200/_cat/indices?pretty&v&s=index"
|
||||||
13
salt/elasticsearch/tools/sbin/so-elasticsearch-indices-rw
Executable file
13
salt/elasticsearch/tools/sbin/so-elasticsearch-indices-rw
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
|
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
|
# Elastic License 2.0.
|
||||||
|
|
||||||
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
echo "Removing read only attributes for indices..."
|
||||||
|
echo
|
||||||
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -XPUT -H "Content-Type: application/json" -L https://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}' 2>&1 | if grep -q ack; then echo "Index settings updated..."; else echo "There was any issue updating the read-only attribute. Please ensure Elasticsearch is running.";fi;
|
||||||
@@ -5,12 +5,10 @@
|
|||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
# Elastic License 2.0.
|
# Elastic License 2.0.
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_nodes/stats | jq .nodes | jq ".[] | .ingest.pipelines"
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://localhost:9200/_nodes/stats | jq .nodes | jq ".[] | .ingest.pipelines"
|
||||||
else
|
else
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_nodes/stats | jq .nodes | jq ".[] | .ingest.pipelines.\"$1\""
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://localhost:9200/_nodes/stats | jq .nodes | jq ".[] | .ingest.pipelines.\"$1\""
|
||||||
fi
|
fi
|
||||||
@@ -5,12 +5,10 @@
|
|||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
# Elastic License 2.0.
|
# Elastic License 2.0.
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/* | jq .
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://localhost:9200/_ingest/pipeline/* | jq .
|
||||||
else
|
else
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/$1 | jq .[]
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://localhost:9200/_ingest/pipeline/$1 | jq .[]
|
||||||
fi
|
fi
|
||||||
@@ -5,10 +5,9 @@
|
|||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
# Elastic License 2.0.
|
# Elastic License 2.0.
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/* | jq 'keys'
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://localhost:9200/_ingest/pipeline/* | jq 'keys'
|
||||||
else
|
else
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_ingest/pipeline/$1 | jq
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://localhost:9200/_ingest/pipeline/$1 | jq
|
||||||
fi
|
fi
|
||||||
@@ -7,8 +7,6 @@
|
|||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
default_conf_dir=/opt/so/conf
|
default_conf_dir=/opt/so/conf
|
||||||
ELASTICSEARCH_HOST="{{ GLOBALS.node_ip }}"
|
|
||||||
ELASTICSEARCH_PORT=9200
|
|
||||||
|
|
||||||
# Define a default directory to load roles from
|
# Define a default directory to load roles from
|
||||||
ELASTICSEARCH_ROLES="$default_conf_dir/elasticsearch/roles/"
|
ELASTICSEARCH_ROLES="$default_conf_dir/elasticsearch/roles/"
|
||||||
@@ -18,7 +16,7 @@ echo -n "Waiting for ElasticSearch..."
|
|||||||
COUNT=0
|
COUNT=0
|
||||||
ELASTICSEARCH_CONNECTED="no"
|
ELASTICSEARCH_CONNECTED="no"
|
||||||
while [[ "$COUNT" -le 240 ]]; do
|
while [[ "$COUNT" -le 240 ]]; do
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -k --output /dev/null --silent --head --fail -L https://"$ELASTICSEARCH_HOST":"$ELASTICSEARCH_PORT"
|
curl -K /opt/so/conf/elasticsearch/curl.config -k --output /dev/null --silent --head --fail -L https://localhost:9200
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
ELASTICSEARCH_CONNECTED="yes"
|
ELASTICSEARCH_CONNECTED="yes"
|
||||||
echo "connected!"
|
echo "connected!"
|
||||||
|
|||||||
@@ -5,8 +5,6 @@
|
|||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
# Elastic License 2.0.
|
# Elastic License 2.0.
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_cat/shards?pretty
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://localhost:9200/_cat/shards?pretty
|
||||||
@@ -5,8 +5,6 @@
|
|||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
# Elastic License 2.0.
|
# Elastic License 2.0.
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L -XDELETE https://{{ NODEIP }}:9200/_template/$1
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L -XDELETE https://localhost:9200/_template/$1
|
||||||
@@ -5,12 +5,10 @@
|
|||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
# Elastic License 2.0.
|
# Elastic License 2.0.
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_template/* | jq .
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://localhost:9200/_template/* | jq .
|
||||||
else
|
else
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_template/$1 | jq .
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://localhost:9200/_template/$1 | jq .
|
||||||
fi
|
fi
|
||||||
@@ -5,10 +5,10 @@
|
|||||||
# https://securityonion.net/license; you may not use this file except in compliance with the
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
# Elastic License 2.0.
|
# Elastic License 2.0.
|
||||||
|
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_template/* | jq 'keys'
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://localhost:9200/_template/* | jq 'keys'
|
||||||
else
|
else
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://{{ NODEIP }}:9200/_template/$1 | jq
|
curl -K /opt/so/conf/elasticsearch/curl.config -s -k -L https://localhost:9200/_template/$1 | jq
|
||||||
fi
|
fi
|
||||||
@@ -7,9 +7,6 @@
|
|||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
default_conf_dir=/opt/so/conf
|
default_conf_dir=/opt/so/conf
|
||||||
ELASTICSEARCH_HOST="{{ GLOBALS.node_ip }}"
|
|
||||||
ELASTICSEARCH_PORT=9200
|
|
||||||
#ELASTICSEARCH_AUTH=""
|
|
||||||
|
|
||||||
# Define a default directory to load pipelines from
|
# Define a default directory to load pipelines from
|
||||||
ELASTICSEARCH_TEMPLATES="$default_conf_dir/elasticsearch/templates/"
|
ELASTICSEARCH_TEMPLATES="$default_conf_dir/elasticsearch/templates/"
|
||||||
|
|||||||
32
salt/elasticsearch/tools/sbin_jinja/so-elastic-restart
Executable file
32
salt/elasticsearch/tools/sbin_jinja/so-elastic-restart
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
|
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
|
# Elastic License 2.0.
|
||||||
|
|
||||||
|
|
||||||
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
|
|
||||||
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
|
||||||
|
{%- if GLOBALS.role in ['so-eval','so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode', 'so-import']%}
|
||||||
|
/usr/sbin/so-restart elasticsearch $1
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- if GLOBALS.role in ['so-eval', 'so-manager', 'so-managersearch', 'so-standalone', 'so-import']%}
|
||||||
|
/usr/sbin/so-restart kibana $1
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- if GLOBALS.role in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
|
||||||
|
/usr/sbin/so-restart logstash $1
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- if GLOBALS.role in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
|
||||||
|
/usr/sbin/so-restart curator $1
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- if GLOBALS.role in ['so-eval','so-manager', 'so-managersearch', 'so-standalone']%}
|
||||||
|
/usr/sbin/so-restart elastalert $1
|
||||||
|
{%- endif %}
|
||||||
31
salt/elasticsearch/tools/sbin_jinja/so-elastic-start
Executable file
31
salt/elasticsearch/tools/sbin_jinja/so-elastic-start
Executable file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
|
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
|
# Elastic License 2.0.
|
||||||
|
|
||||||
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
|
|
||||||
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
|
||||||
|
{%- if GLOBALS.role in ['so-eval','so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode', 'so-import']%}
|
||||||
|
/usr/sbin/so-start elasticsearch $1
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- if GLOBALS.role in ['so-eval', 'so-manager', 'so-managersearch', 'so-standalone', 'so-import']%}
|
||||||
|
/usr/sbin/so-start kibana $1
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- if GLOBALS.role in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
|
||||||
|
/usr/sbin/so-start logstash $1
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- if GLOBALS.role in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
|
||||||
|
/usr/sbin/so-start curator $1
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- if GLOBALS.role in ['so-eval','so-manager', 'so-managersearch', 'so-standalone']%}
|
||||||
|
/usr/sbin/so-start elastalert $1
|
||||||
|
{%- endif %}
|
||||||
31
salt/elasticsearch/tools/sbin_jinja/so-elastic-stop
Executable file
31
salt/elasticsearch/tools/sbin_jinja/so-elastic-stop
Executable file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
|
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
|
# Elastic License 2.0.
|
||||||
|
|
||||||
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
|
|
||||||
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
|
||||||
|
{%- if GLOBALS.role in ['so-eval','so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode', 'so-import']%}
|
||||||
|
/usr/sbin/so-stop elasticsearch $1
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- if GLOBALS.role in ['so-eval', 'so-manager', 'so-managersearch', 'so-standalone', 'so-import']%}
|
||||||
|
/usr/sbin/so-stop kibana $1
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- if GLOBALS.role in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
|
||||||
|
/usr/sbin/so-stop logstash $1
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- if GLOBALS.role in ['so-manager', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode']%}
|
||||||
|
/usr/sbin/so-stop curator $1
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- if GLOBALS.role in ['so-eval','so-manager', 'so-managersearch', 'so-standalone']%}
|
||||||
|
/usr/sbin/so-stop elastalert $1
|
||||||
|
{%- endif %}
|
||||||
@@ -8,13 +8,12 @@
|
|||||||
|
|
||||||
{% import_yaml 'elasticsearch/defaults.yaml' as ESCONFIG with context %}
|
{% import_yaml 'elasticsearch/defaults.yaml' as ESCONFIG with context %}
|
||||||
{%- set ES_INDEX_SETTINGS = salt['pillar.get']('elasticsearch:index_settings', default=ESCONFIG.elasticsearch.index_settings, merge=True) %}
|
{%- set ES_INDEX_SETTINGS = salt['pillar.get']('elasticsearch:index_settings', default=ESCONFIG.elasticsearch.index_settings, merge=True) %}
|
||||||
{%- set NODEIP = salt['pillar.get']('host:mainip', '') %}
|
|
||||||
|
|
||||||
{%- for index, settings in ES_INDEX_SETTINGS.items() %}
|
{%- for index, settings in ES_INDEX_SETTINGS.items() %}
|
||||||
{%- if settings.policy is defined %}
|
{%- if settings.policy is defined %}
|
||||||
echo
|
echo
|
||||||
echo "Setting up {{ index }}-logs policy..."
|
echo "Setting up {{ index }}-logs policy..."
|
||||||
curl -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -s -k -L -X PUT "https://{{ NODEIP }}:9200/_ilm/policy/{{ index }}-logs" -H 'Content-Type: application/json' -d'{ "policy": {{ settings.policy | tojson(true) }} }'
|
curl -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -s -k -L -X PUT "https://localhost:9200/_ilm/policy/{{ index }}-logs" -H 'Content-Type: application/json' -d'{ "policy": {{ settings.policy | tojson(true) }} }'
|
||||||
echo
|
echo
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
@@ -60,6 +60,23 @@ opencanary_config:
|
|||||||
- defaults:
|
- defaults:
|
||||||
OPENCANARYCONFIG: {{ OPENCANARYCONFIG }}
|
OPENCANARYCONFIG: {{ OPENCANARYCONFIG }}
|
||||||
|
|
||||||
|
idh_sbin:
|
||||||
|
file.recurse:
|
||||||
|
- name: /usr/sbin
|
||||||
|
- source: salt://idh/tools/sbin
|
||||||
|
- user: 934
|
||||||
|
- group: 939
|
||||||
|
- file_mode: 755
|
||||||
|
|
||||||
|
#idh_sbin_jinja:
|
||||||
|
# file.recurse:
|
||||||
|
# - name: /usr/sbin
|
||||||
|
# - source: salt://idh/tools/sbin_jinja
|
||||||
|
# - user: 939
|
||||||
|
# - group: 939
|
||||||
|
# - file_mode: 755
|
||||||
|
# - template: jinja
|
||||||
|
|
||||||
so-idh:
|
so-idh:
|
||||||
docker_container.running:
|
docker_container.running:
|
||||||
- image: {{ GLOBALS.registry_host }}:5000/{{ GLOBALS.image_repo }}/so-idh:{{ GLOBALS.so_version }}
|
- image: {{ GLOBALS.registry_host }}:5000/{{ GLOBALS.image_repo }}/so-idh:{{ GLOBALS.so_version }}
|
||||||
|
|||||||
@@ -20,6 +20,23 @@ idstoolslogdir:
|
|||||||
- group: 939
|
- group: 939
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
|
|
||||||
|
idstools_sbin:
|
||||||
|
file.recurse:
|
||||||
|
- name: /usr/sbin
|
||||||
|
- source: salt://idstools/tools/sbin
|
||||||
|
- user: 934
|
||||||
|
- group: 939
|
||||||
|
- file_mode: 755
|
||||||
|
|
||||||
|
#idstools_sbin_jinja:
|
||||||
|
# file.recurse:
|
||||||
|
# - name: /usr/sbin
|
||||||
|
# - source: salt://idstools/tools/sbin_jinja
|
||||||
|
# - user: 934
|
||||||
|
# - group: 939
|
||||||
|
# - file_mode: 755
|
||||||
|
# - template: jinja
|
||||||
|
|
||||||
so-rule-update:
|
so-rule-update:
|
||||||
cron.present:
|
cron.present:
|
||||||
- name: /usr/sbin/so-rule-update > /opt/so/log/idstools/download.log 2>&1
|
- name: /usr/sbin/so-rule-update > /opt/so/log/idstools/download.log 2>&1
|
||||||
|
|||||||
@@ -31,6 +31,23 @@ influxdbdir:
|
|||||||
- name: /nsm/influxdb
|
- name: /nsm/influxdb
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
|
|
||||||
|
influxdb_sbin:
|
||||||
|
file.recurse:
|
||||||
|
- name: /usr/sbin
|
||||||
|
- source: salt://influxdb/tools/sbin
|
||||||
|
- user: 939
|
||||||
|
- group: 939
|
||||||
|
- file_mode: 755
|
||||||
|
|
||||||
|
#influxdb_sbin_jinja:
|
||||||
|
# file.recurse:
|
||||||
|
# - name: /usr/sbin
|
||||||
|
# - source: salt://influxdb/tools/sbin_jinja
|
||||||
|
# - user: 939
|
||||||
|
# - group: 939
|
||||||
|
# - file_mode: 755
|
||||||
|
# - template: jinja
|
||||||
|
|
||||||
influxdbconf:
|
influxdbconf:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: /opt/so/conf/influxdb/config.yaml
|
- name: /opt/so/conf/influxdb/config.yaml
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user