mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Initial cut to remove Playbook and deps
This commit is contained in:
@@ -43,8 +43,6 @@ base:
|
||||
- soc.soc_soc
|
||||
- soc.adv_soc
|
||||
- soc.license
|
||||
- soctopus.soc_soctopus
|
||||
- soctopus.adv_soctopus
|
||||
- kibana.soc_kibana
|
||||
- kibana.adv_kibana
|
||||
- kratos.soc_kratos
|
||||
@@ -61,8 +59,6 @@ base:
|
||||
- elastalert.adv_elastalert
|
||||
- backup.soc_backup
|
||||
- backup.adv_backup
|
||||
- soctopus.soc_soctopus
|
||||
- soctopus.adv_soctopus
|
||||
- minions.{{ grains.id }}
|
||||
- minions.adv_{{ grains.id }}
|
||||
- stig.soc_stig
|
||||
@@ -108,8 +104,6 @@ base:
|
||||
- soc.soc_soc
|
||||
- soc.adv_soc
|
||||
- soc.license
|
||||
- soctopus.soc_soctopus
|
||||
- soctopus.adv_soctopus
|
||||
- kibana.soc_kibana
|
||||
- kibana.adv_kibana
|
||||
- strelka.soc_strelka
|
||||
@@ -165,8 +159,6 @@ base:
|
||||
- soc.soc_soc
|
||||
- soc.adv_soc
|
||||
- soc.license
|
||||
- soctopus.soc_soctopus
|
||||
- soctopus.adv_soctopus
|
||||
- kibana.soc_kibana
|
||||
- kibana.adv_kibana
|
||||
- strelka.soc_strelka
|
||||
@@ -262,8 +254,6 @@ base:
|
||||
- soc.soc_soc
|
||||
- soc.adv_soc
|
||||
- soc.license
|
||||
- soctopus.soc_soctopus
|
||||
- soctopus.adv_soctopus
|
||||
- kibana.soc_kibana
|
||||
- kibana.adv_kibana
|
||||
- backup.soc_backup
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
'suricata',
|
||||
'utility',
|
||||
'schedule',
|
||||
'soctopus',
|
||||
'tcpreplay',
|
||||
'docker_clean'
|
||||
],
|
||||
@@ -101,7 +100,6 @@
|
||||
'suricata.manager',
|
||||
'utility',
|
||||
'schedule',
|
||||
'soctopus',
|
||||
'docker_clean',
|
||||
'stig'
|
||||
],
|
||||
@@ -123,7 +121,6 @@
|
||||
'suricata.manager',
|
||||
'utility',
|
||||
'schedule',
|
||||
'soctopus',
|
||||
'docker_clean',
|
||||
'stig'
|
||||
],
|
||||
@@ -157,7 +154,6 @@
|
||||
'healthcheck',
|
||||
'utility',
|
||||
'schedule',
|
||||
'soctopus',
|
||||
'tcpreplay',
|
||||
'docker_clean',
|
||||
'stig'
|
||||
@@ -200,10 +196,6 @@
|
||||
],
|
||||
}, grain='role') %}
|
||||
|
||||
{% if grains.role in ['so-eval', 'so-manager', 'so-managersearch', 'so-standalone'] %}
|
||||
{% do allowed_states.append('mysql') %}
|
||||
{% endif %}
|
||||
|
||||
{%- if grains.role in ['so-sensor', 'so-eval', 'so-standalone', 'so-heavynode'] %}
|
||||
{% do allowed_states.append('zeek') %}
|
||||
{%- endif %}
|
||||
@@ -229,10 +221,6 @@
|
||||
{% do allowed_states.append('elastalert') %}
|
||||
{% endif %}
|
||||
|
||||
{% if grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-managersearch'] %}
|
||||
{% do allowed_states.append('playbook') %}
|
||||
{% endif %}
|
||||
|
||||
{% if grains.role in ['so-manager', 'so-standalone', 'so-searchnode', 'so-managersearch', 'so-heavynode', 'so-receiver'] %}
|
||||
{% do allowed_states.append('logstash') %}
|
||||
{% endif %}
|
||||
|
||||
@@ -53,13 +53,10 @@ container_list() {
|
||||
"so-kibana"
|
||||
"so-kratos"
|
||||
"so-logstash"
|
||||
"so-mysql"
|
||||
"so-nginx"
|
||||
"so-pcaptools"
|
||||
"so-playbook"
|
||||
"so-redis"
|
||||
"so-soc"
|
||||
"so-soctopus"
|
||||
"so-steno"
|
||||
"so-strelka-backend"
|
||||
"so-strelka-filestream"
|
||||
|
||||
@@ -49,10 +49,6 @@ if [ "$CONTINUE" == "y" ]; then
|
||||
sed -i "s|$OLD_IP|$NEW_IP|g" $file
|
||||
done
|
||||
|
||||
echo "Granting MySQL root user permissions on $NEW_IP"
|
||||
docker exec -i so-mysql mysql --user=root --password=$(lookup_pillar_secret 'mysql') -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'$NEW_IP' IDENTIFIED BY '$(lookup_pillar_secret 'mysql')' WITH GRANT OPTION;" &> /dev/null
|
||||
echo "Removing MySQL root user from $OLD_IP"
|
||||
docker exec -i so-mysql mysql --user=root --password=$(lookup_pillar_secret 'mysql') -e "DROP USER 'root'@'$OLD_IP';" &> /dev/null
|
||||
echo "Updating Kibana dashboards"
|
||||
salt-call state.apply kibana.so_savedobjects_defaults -l info queue=True
|
||||
|
||||
|
||||
@@ -155,15 +155,11 @@ if [[ $EXCLUDE_KNOWN_ERRORS == 'Y' ]]; then
|
||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|fail\\(error\\)" # redis/python generic stack line, rely on other lines for actual error
|
||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|urlerror" # idstools connection timeout
|
||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|timeouterror" # idstools connection timeout
|
||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|forbidden" # playbook
|
||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|_ml" # Elastic ML errors
|
||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|context canceled" # elastic agent during shutdown
|
||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|exited with code 128" # soctopus errors during forced restart by highstate
|
||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|geoip databases update" # airgap can't update GeoIP DB
|
||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|filenotfounderror" # bug in 2.4.10 filecheck salt state caused duplicate cronjobs
|
||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|salt-minion-check" # bug in early 2.4 place Jinja script in non-jinja salt dir causing cron output errors
|
||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|generating elastalert config" # playbook expected error
|
||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|activerecord" # playbook expected error
|
||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|monitoring.metrics" # known issue with elastic agent casting the field incorrectly if an integer value shows up before a float
|
||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|repodownload.conf" # known issue with reposync on pre-2.4.20
|
||||
EXCLUDED_ERRORS="$EXCLUDED_ERRORS|missing versions record" # stenographer corrupt index
|
||||
@@ -211,7 +207,6 @@ RESULT=0
|
||||
CONTAINER_IDS=$(docker ps -q)
|
||||
exclude_container so-kibana # kibana error logs are too verbose with large varieties of errors most of which are temporary
|
||||
exclude_container so-idstools # ignore due to known issues and noisy logging
|
||||
exclude_container so-playbook # ignore due to several playbook known issues
|
||||
|
||||
for container_id in $CONTAINER_IDS; do
|
||||
container_name=$(docker ps --format json | jq ". | select(.ID==\"$container_id\")|.Names")
|
||||
|
||||
@@ -67,13 +67,6 @@ docker:
|
||||
custom_bind_mounts: []
|
||||
extra_hosts: []
|
||||
extra_env: []
|
||||
'so-mysql':
|
||||
final_octet: 30
|
||||
port_bindings:
|
||||
- 0.0.0.0:3306:3306
|
||||
custom_bind_mounts: []
|
||||
extra_hosts: []
|
||||
extra_env: []
|
||||
'so-nginx':
|
||||
final_octet: 31
|
||||
port_bindings:
|
||||
@@ -91,13 +84,6 @@ docker:
|
||||
custom_bind_mounts: []
|
||||
extra_hosts: []
|
||||
extra_env: []
|
||||
'so-playbook':
|
||||
final_octet: 32
|
||||
port_bindings:
|
||||
- 0.0.0.0:3000:3000
|
||||
custom_bind_mounts: []
|
||||
extra_hosts: []
|
||||
extra_env: []
|
||||
'so-redis':
|
||||
final_octet: 33
|
||||
port_bindings:
|
||||
@@ -118,13 +104,6 @@ docker:
|
||||
custom_bind_mounts: []
|
||||
extra_hosts: []
|
||||
extra_env: []
|
||||
'so-soctopus':
|
||||
final_octet: 35
|
||||
port_bindings:
|
||||
- 0.0.0.0:7000:7000
|
||||
custom_bind_mounts: []
|
||||
extra_hosts: []
|
||||
extra_env: []
|
||||
'so-strelka-backend':
|
||||
final_octet: 36
|
||||
custom_bind_mounts: []
|
||||
|
||||
@@ -46,14 +46,11 @@ docker:
|
||||
so-kibana: *dockerOptions
|
||||
so-kratos: *dockerOptions
|
||||
so-logstash: *dockerOptions
|
||||
so-mysql: *dockerOptions
|
||||
so-nginx: *dockerOptions
|
||||
so-nginx-fleet-node: *dockerOptions
|
||||
so-playbook: *dockerOptions
|
||||
so-redis: *dockerOptions
|
||||
so-sensoroni: *dockerOptions
|
||||
so-soc: *dockerOptions
|
||||
so-soctopus: *dockerOptions
|
||||
so-strelka-backend: *dockerOptions
|
||||
so-strelka-filestream: *dockerOptions
|
||||
so-strelka-frontend: *dockerOptions
|
||||
|
||||
@@ -9,11 +9,9 @@
|
||||
'so-influxdb',
|
||||
'so-kibana',
|
||||
'so-kratos',
|
||||
'so-mysql',
|
||||
'so-nginx',
|
||||
'so-redis',
|
||||
'so-soc',
|
||||
'so-soctopus',
|
||||
'so-strelka-coordinator',
|
||||
'so-strelka-gatekeeper',
|
||||
'so-strelka-frontend',
|
||||
@@ -32,11 +30,9 @@
|
||||
'so-kibana',
|
||||
'so-kratos',
|
||||
'so-logstash',
|
||||
'so-mysql',
|
||||
'so-nginx',
|
||||
'so-redis',
|
||||
'so-soc',
|
||||
'so-soctopus',
|
||||
'so-strelka-coordinator',
|
||||
'so-strelka-gatekeeper',
|
||||
'so-strelka-frontend',
|
||||
|
||||
@@ -98,19 +98,11 @@ firewall:
|
||||
tcp:
|
||||
- 7788
|
||||
udp: []
|
||||
mysql:
|
||||
tcp:
|
||||
- 3306
|
||||
udp: []
|
||||
nginx:
|
||||
tcp:
|
||||
- 80
|
||||
- 443
|
||||
udp: []
|
||||
playbook:
|
||||
tcp:
|
||||
- 3000
|
||||
udp: []
|
||||
redis:
|
||||
tcp:
|
||||
- 6379
|
||||
@@ -178,8 +170,6 @@ firewall:
|
||||
hostgroups:
|
||||
eval:
|
||||
portgroups:
|
||||
- playbook
|
||||
- mysql
|
||||
- kibana
|
||||
- redis
|
||||
- influxdb
|
||||
@@ -363,8 +353,6 @@ firewall:
|
||||
hostgroups:
|
||||
manager:
|
||||
portgroups:
|
||||
- playbook
|
||||
- mysql
|
||||
- kibana
|
||||
- redis
|
||||
- influxdb
|
||||
@@ -559,8 +547,6 @@ firewall:
|
||||
hostgroups:
|
||||
managersearch:
|
||||
portgroups:
|
||||
- playbook
|
||||
- mysql
|
||||
- kibana
|
||||
- redis
|
||||
- influxdb
|
||||
@@ -756,8 +742,6 @@ firewall:
|
||||
- all
|
||||
standalone:
|
||||
portgroups:
|
||||
- playbook
|
||||
- mysql
|
||||
- kibana
|
||||
- redis
|
||||
- influxdb
|
||||
|
||||
@@ -121,15 +121,9 @@ firewall:
|
||||
localrules:
|
||||
tcp: *tcpsettings
|
||||
udp: *udpsettings
|
||||
mysql:
|
||||
tcp: *tcpsettings
|
||||
udp: *udpsettings
|
||||
nginx:
|
||||
tcp: *tcpsettings
|
||||
udp: *udpsettings
|
||||
playbook:
|
||||
tcp: *tcpsettings
|
||||
udp: *udpsettings
|
||||
redis:
|
||||
tcp: *tcpsettings
|
||||
udp: *udpsettings
|
||||
|
||||
@@ -20,10 +20,6 @@ manager:
|
||||
description: String of hosts to ignore the proxy settings for.
|
||||
global: True
|
||||
helpLink: proxy.html
|
||||
playbook:
|
||||
description: Enable playbook 1=enabled 0=disabled.
|
||||
global: True
|
||||
helpLink: playbook.html
|
||||
proxy:
|
||||
description: Proxy server to use for updates.
|
||||
global: True
|
||||
|
||||
@@ -286,12 +286,6 @@ function add_sensor_to_minion() {
|
||||
echo " " >> $PILLARFILE
|
||||
}
|
||||
|
||||
function add_playbook_to_minion() {
|
||||
printf '%s\n'\
|
||||
"playbook:"\
|
||||
" enabled: True"\
|
||||
" " >> $PILLARFILE
|
||||
}
|
||||
|
||||
function add_elastalert_to_minion() {
|
||||
printf '%s\n'\
|
||||
@@ -353,13 +347,6 @@ function add_nginx_to_minion() {
|
||||
" " >> $PILLARFILE
|
||||
}
|
||||
|
||||
function add_soctopus_to_minion() {
|
||||
printf '%s\n'\
|
||||
"soctopus:"\
|
||||
" enabled: True"\
|
||||
" " >> $PILLARFILE
|
||||
}
|
||||
|
||||
function add_soc_to_minion() {
|
||||
printf '%s\n'\
|
||||
"soc:"\
|
||||
@@ -374,13 +361,6 @@ function add_registry_to_minion() {
|
||||
" " >> $PILLARFILE
|
||||
}
|
||||
|
||||
function add_mysql_to_minion() {
|
||||
printf '%s\n'\
|
||||
"mysql:"\
|
||||
" enabled: True"\
|
||||
" " >> $PILLARFILE
|
||||
}
|
||||
|
||||
function add_kratos_to_minion() {
|
||||
printf '%s\n'\
|
||||
"kratos:"\
|
||||
@@ -456,16 +436,13 @@ function createEVAL() {
|
||||
add_elasticsearch_to_minion
|
||||
add_sensor_to_minion
|
||||
add_strelka_to_minion
|
||||
add_playbook_to_minion
|
||||
add_elastalert_to_minion
|
||||
add_kibana_to_minion
|
||||
add_telegraf_to_minion
|
||||
add_influxdb_to_minion
|
||||
add_nginx_to_minion
|
||||
add_soctopus_to_minion
|
||||
add_soc_to_minion
|
||||
add_registry_to_minion
|
||||
add_mysql_to_minion
|
||||
add_kratos_to_minion
|
||||
add_idstools_to_minion
|
||||
add_elastic_fleet_package_registry_to_minion
|
||||
@@ -478,17 +455,14 @@ function createSTANDALONE() {
|
||||
add_logstash_to_minion
|
||||
add_sensor_to_minion
|
||||
add_strelka_to_minion
|
||||
add_playbook_to_minion
|
||||
add_elastalert_to_minion
|
||||
add_kibana_to_minion
|
||||
add_redis_to_minion
|
||||
add_telegraf_to_minion
|
||||
add_influxdb_to_minion
|
||||
add_nginx_to_minion
|
||||
add_soctopus_to_minion
|
||||
add_soc_to_minion
|
||||
add_registry_to_minion
|
||||
add_mysql_to_minion
|
||||
add_kratos_to_minion
|
||||
add_idstools_to_minion
|
||||
add_elastic_fleet_package_registry_to_minion
|
||||
@@ -497,17 +471,14 @@ function createSTANDALONE() {
|
||||
function createMANAGER() {
|
||||
add_elasticsearch_to_minion
|
||||
add_logstash_to_minion
|
||||
add_playbook_to_minion
|
||||
add_elastalert_to_minion
|
||||
add_kibana_to_minion
|
||||
add_redis_to_minion
|
||||
add_telegraf_to_minion
|
||||
add_influxdb_to_minion
|
||||
add_nginx_to_minion
|
||||
add_soctopus_to_minion
|
||||
add_soc_to_minion
|
||||
add_registry_to_minion
|
||||
add_mysql_to_minion
|
||||
add_kratos_to_minion
|
||||
add_idstools_to_minion
|
||||
add_elastic_fleet_package_registry_to_minion
|
||||
@@ -516,17 +487,14 @@ function createMANAGER() {
|
||||
function createMANAGERSEARCH() {
|
||||
add_elasticsearch_to_minion
|
||||
add_logstash_to_minion
|
||||
add_playbook_to_minion
|
||||
add_elastalert_to_minion
|
||||
add_kibana_to_minion
|
||||
add_redis_to_minion
|
||||
add_telegraf_to_minion
|
||||
add_influxdb_to_minion
|
||||
add_nginx_to_minion
|
||||
add_soctopus_to_minion
|
||||
add_soc_to_minion
|
||||
add_registry_to_minion
|
||||
add_mysql_to_minion
|
||||
add_kratos_to_minion
|
||||
add_idstools_to_minion
|
||||
add_elastic_fleet_package_registry_to_minion
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
# 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 'allowed_states.map.jinja' import allowed_states %}
|
||||
{% if sls.split('.')[0] in allowed_states %}
|
||||
{% set MYSQLPASS = salt['pillar.get']('secrets:mysql') %}
|
||||
|
||||
# MySQL Setup
|
||||
mysqlpkgs:
|
||||
pkg.removed:
|
||||
- skip_suggestions: False
|
||||
- pkgs:
|
||||
{% if grains['os_family'] != 'RedHat' %}
|
||||
- python3-mysqldb
|
||||
{% else %}
|
||||
- python3-mysqlclient
|
||||
{% endif %}
|
||||
|
||||
mysqletcdir:
|
||||
file.directory:
|
||||
- name: /opt/so/conf/mysql/etc
|
||||
- user: 939
|
||||
- group: 939
|
||||
- makedirs: True
|
||||
|
||||
mysqlpiddir:
|
||||
file.directory:
|
||||
- name: /opt/so/conf/mysql/pid
|
||||
- user: 939
|
||||
- group: 939
|
||||
- makedirs: True
|
||||
|
||||
mysqlcnf:
|
||||
file.managed:
|
||||
- name: /opt/so/conf/mysql/etc/my.cnf
|
||||
- source: salt://mysql/etc/my.cnf
|
||||
- user: 939
|
||||
- group: 939
|
||||
|
||||
mysqlpass:
|
||||
file.managed:
|
||||
- name: /opt/so/conf/mysql/etc/mypass
|
||||
- source: salt://mysql/etc/mypass
|
||||
- user: 939
|
||||
- group: 939
|
||||
- template: jinja
|
||||
- defaults:
|
||||
MYSQLPASS: {{ MYSQLPASS }}
|
||||
|
||||
mysqllogdir:
|
||||
file.directory:
|
||||
- name: /opt/so/log/mysql
|
||||
- user: 939
|
||||
- group: 939
|
||||
- makedirs: True
|
||||
|
||||
mysqldatadir:
|
||||
file.directory:
|
||||
- name: /nsm/mysql
|
||||
- user: 939
|
||||
- group: 939
|
||||
- makedirs: True
|
||||
|
||||
mysql_sbin:
|
||||
file.recurse:
|
||||
- name: /usr/sbin
|
||||
- source: salt://mysql/tools/sbin
|
||||
- user: 939
|
||||
- group: 939
|
||||
- file_mode: 755
|
||||
|
||||
#mysql_sbin_jinja:
|
||||
# file.recurse:
|
||||
# - name: /usr/sbin
|
||||
# - source: salt://mysql/tools/sbin_jinja
|
||||
# - user: 939
|
||||
# - group: 939
|
||||
# - file_mode: 755
|
||||
# - template: jinja
|
||||
|
||||
{% else %}
|
||||
|
||||
{{sls}}_state_not_allowed:
|
||||
test.fail_without_changes:
|
||||
- name: {{sls}}_state_not_allowed
|
||||
|
||||
{% endif %}
|
||||
@@ -1,2 +0,0 @@
|
||||
mysql:
|
||||
enabled: False
|
||||
@@ -1,27 +0,0 @@
|
||||
# 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 'allowed_states.map.jinja' import allowed_states %}
|
||||
{% if sls.split('.')[0] in allowed_states %}
|
||||
|
||||
include:
|
||||
- mysql.sostatus
|
||||
|
||||
so-mysql:
|
||||
docker_container.absent:
|
||||
- force: True
|
||||
|
||||
so-mysql_so-status.disabled:
|
||||
file.comment:
|
||||
- name: /opt/so/conf/so-status/so-status.conf
|
||||
- regex: ^so-mysql$
|
||||
|
||||
{% else %}
|
||||
|
||||
{{sls}}_state_not_allowed:
|
||||
test.fail_without_changes:
|
||||
- name: {{sls}}_state_not_allowed
|
||||
|
||||
{% endif %}
|
||||
@@ -1,84 +0,0 @@
|
||||
# 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 'allowed_states.map.jinja' import allowed_states %}
|
||||
{% if sls.split('.')[0] in allowed_states %}
|
||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||
{% set MYSQLPASS = salt['pillar.get']('secrets:mysql') %}
|
||||
|
||||
include:
|
||||
- mysql.config
|
||||
- mysql.sostatus
|
||||
|
||||
{% if MYSQLPASS == None %}
|
||||
|
||||
mysql_password_none:
|
||||
test.configurable_test_state:
|
||||
- changes: False
|
||||
- result: False
|
||||
- comment: "MySQL Password Error - Not Starting MySQL"
|
||||
|
||||
{% else %}
|
||||
|
||||
so-mysql:
|
||||
docker_container.running:
|
||||
- image: {{ GLOBALS.registry_host }}:5000/{{ GLOBALS.image_repo }}/so-mysql:{{ GLOBALS.so_version }}
|
||||
- hostname: so-mysql
|
||||
- user: socore
|
||||
- networks:
|
||||
- sobridge:
|
||||
- ipv4_address: {{ DOCKER.containers['so-mysql'].ip }}
|
||||
- extra_hosts:
|
||||
- {{ GLOBALS.manager }}:{{ GLOBALS.manager_ip }}
|
||||
{% if DOCKER.containers['so-mysql'].extra_hosts %}
|
||||
{% for XTRAHOST in DOCKER.containers['so-mysql'].extra_hosts %}
|
||||
- {{ XTRAHOST }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
- port_bindings:
|
||||
{% for BINDING in DOCKER.containers['so-mysql'].port_bindings %}
|
||||
- {{ BINDING }}
|
||||
{% endfor %}
|
||||
- environment:
|
||||
- MYSQL_ROOT_HOST={{ GLOBALS.so_docker_gateway }}
|
||||
- MYSQL_ROOT_PASSWORD=/etc/mypass
|
||||
{% if DOCKER.containers['so-mysql'].extra_env %}
|
||||
{% for XTRAENV in DOCKER.containers['so-mysql'].extra_env %}
|
||||
- {{ XTRAENV }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
- binds:
|
||||
- /opt/so/conf/mysql/etc/my.cnf:/etc/my.cnf:ro
|
||||
- /opt/so/conf/mysql/etc/mypass:/etc/mypass
|
||||
- /nsm/mysql:/var/lib/mysql:rw
|
||||
- /opt/so/log/mysql:/var/log/mysql:rw
|
||||
{% if DOCKER.containers['so-mysql'].custom_bind_mounts %}
|
||||
{% for BIND in DOCKER.containers['so-mysql'].custom_bind_mounts %}
|
||||
- {{ BIND }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
- cap_add:
|
||||
- SYS_NICE
|
||||
- watch:
|
||||
- file: mysqlcnf
|
||||
- file: mysqlpass
|
||||
- require:
|
||||
- file: mysqlcnf
|
||||
- file: mysqlpass
|
||||
{% endif %}
|
||||
|
||||
delete_so-mysql_so-status.disabled:
|
||||
file.uncomment:
|
||||
- name: /opt/so/conf/so-status/so-status.conf
|
||||
- regex: ^so-mysql$
|
||||
|
||||
{% else %}
|
||||
|
||||
{{sls}}_state_not_allowed:
|
||||
test.fail_without_changes:
|
||||
- name: {{sls}}_state_not_allowed
|
||||
|
||||
{% endif %}
|
||||
@@ -1,32 +0,0 @@
|
||||
# For advice on how to change settings please see
|
||||
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
|
||||
|
||||
[mysqld]
|
||||
#
|
||||
# Remove leading # and set to the amount of RAM for the most important data
|
||||
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
|
||||
# innodb_buffer_pool_size = 128M
|
||||
#
|
||||
# Remove leading # to turn on a very important data integrity option: logging
|
||||
# changes to the binary log between backups.
|
||||
# log_bin
|
||||
#
|
||||
# Remove leading # to set options mainly useful for reporting servers.
|
||||
# The server defaults are faster for transactions and fast SELECTs.
|
||||
# Adjust sizes as needed, experiment to find the optimal values.
|
||||
# join_buffer_size = 128M
|
||||
# sort_buffer_size = 2M
|
||||
# read_rnd_buffer_size = 2M
|
||||
|
||||
host_cache_size=0
|
||||
skip-name-resolve
|
||||
datadir=/var/lib/mysql
|
||||
socket=/var/lib/mysql/mysql.sock
|
||||
secure-file-priv=/var/lib/mysql-files
|
||||
user=socore
|
||||
|
||||
log-error=/var/log/mysql/mysqld.log
|
||||
pid-file=/var/run/mysqld/mysqld.pid
|
||||
|
||||
# Switch back to the native password module so that playbook can connect
|
||||
authentication_policy=mysql_native_password
|
||||
@@ -1 +0,0 @@
|
||||
{{ MYSQLPASS }}
|
||||
@@ -1,14 +0,0 @@
|
||||
|
||||
# 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 'mysql/map.jinja' import MYSQLMERGED %}
|
||||
|
||||
include:
|
||||
{% if MYSQLMERGED.enabled %}
|
||||
- mysql.enabled
|
||||
{% else %}
|
||||
- mysql.disabled
|
||||
{% endif %}
|
||||
@@ -1,7 +0,0 @@
|
||||
{# 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. #}
|
||||
|
||||
{% import_yaml 'mysql/defaults.yaml' as MYSQLDEFAULTS with context %}
|
||||
{% set MYSQLMERGED = salt['pillar.get']('mysql', MYSQLDEFAULTS.mysql, merge=True) %}
|
||||
@@ -1,4 +0,0 @@
|
||||
mysql:
|
||||
enabled:
|
||||
description: You can enable or disable MySQL.
|
||||
advanced: True
|
||||
@@ -1,21 +0,0 @@
|
||||
# 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 'allowed_states.map.jinja' import allowed_states %}
|
||||
{% if sls.split('.')[0] in allowed_states %}
|
||||
|
||||
append_so-mysql_so-status.conf:
|
||||
file.append:
|
||||
- name: /opt/so/conf/so-status/so-status.conf
|
||||
- text: so-mysql
|
||||
- unless: grep -q so-mysql /opt/so/conf/so-status/so-status.conf
|
||||
|
||||
{% else %}
|
||||
|
||||
{{sls}}_state_not_allowed:
|
||||
test.fail_without_changes:
|
||||
- name: {{sls}}_state_not_allowed
|
||||
|
||||
{% endif %}
|
||||
@@ -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-restart mysql $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-start mysql $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 mysql $1
|
||||
@@ -277,38 +277,11 @@ http {
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location /playbook/ {
|
||||
auth_request /auth/sessions/whoami;
|
||||
proxy_pass http://{{ GLOBALS.manager }}:3000/playbook/;
|
||||
proxy_read_timeout 90;
|
||||
proxy_connect_timeout 90;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Proxy "";
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
|
||||
location /soctopus/ {
|
||||
auth_request /auth/sessions/whoami;
|
||||
proxy_pass http://{{ GLOBALS.manager }}:7000/;
|
||||
proxy_read_timeout 300;
|
||||
proxy_connect_timeout 300;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Proxy "";
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location /kibana/app/soc/ {
|
||||
rewrite ^/kibana/app/soc/(.*) /soc/$1 permanent;
|
||||
}
|
||||
|
||||
location /kibana/app/soctopus/ {
|
||||
rewrite ^/kibana/app/soctopus/(.*) /soctopus/$1 permanent;
|
||||
}
|
||||
|
||||
location /sensoroniagents/ {
|
||||
if ($http_authorization = "") {
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||
|
||||
# This state will create the SecOps Automation user within Playbook
|
||||
|
||||
include:
|
||||
- playbook
|
||||
|
||||
wait_for_playbook:
|
||||
cmd.run:
|
||||
- name: until nc -z {{ GLOBALS.manager }} 3000; do sleep 1; done
|
||||
- timeout: 300
|
||||
|
||||
create_user:
|
||||
cmd.script:
|
||||
- source: salt://playbook/files/automation_user_create.sh
|
||||
- cwd: /root
|
||||
- template: jinja
|
||||
- onchanges:
|
||||
- cmd: wait_for_playbook
|
||||
@@ -1,120 +0,0 @@
|
||||
# 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 'allowed_states.map.jinja' import allowed_states %}
|
||||
{% if sls.split('.')[0] in allowed_states %}
|
||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||
{% set MYSQLPASS = salt['pillar.get']('secrets:mysql') %}
|
||||
{% set PLAYBOOKPASS = salt['pillar.get']('secrets:playbook_db') %}
|
||||
|
||||
|
||||
include:
|
||||
- mysql
|
||||
|
||||
create_playbookdbuser:
|
||||
mysql_user.present:
|
||||
- name: playbookdbuser
|
||||
- password: {{ PLAYBOOKPASS }}
|
||||
- host: "{{ DOCKER.range.split('/')[0] }}/255.255.255.0"
|
||||
- connection_host: {{ GLOBALS.manager }}
|
||||
- connection_port: 3306
|
||||
- connection_user: root
|
||||
- connection_pass: {{ MYSQLPASS }}
|
||||
|
||||
query_playbookdbuser_grants:
|
||||
mysql_query.run:
|
||||
- database: playbook
|
||||
- query: "GRANT ALL ON playbook.* TO 'playbookdbuser'@'{{ DOCKER.range.split('/')[0] }}/255.255.255.0';"
|
||||
- connection_host: {{ GLOBALS.manager }}
|
||||
- connection_port: 3306
|
||||
- connection_user: root
|
||||
- connection_pass: {{ MYSQLPASS }}
|
||||
|
||||
query_updatwebhooks:
|
||||
mysql_query.run:
|
||||
- database: playbook
|
||||
- query: "update webhooks set url = 'http://{{ GLOBALS.manager_ip}}:7000/playbook/webhook' where project_id = 1"
|
||||
- connection_host: {{ GLOBALS.manager }}
|
||||
- connection_port: 3306
|
||||
- connection_user: root
|
||||
- connection_pass: {{ MYSQLPASS }}
|
||||
|
||||
query_updatename:
|
||||
mysql_query.run:
|
||||
- database: playbook
|
||||
- query: "update custom_fields set name = 'Custom Filter' where id = 21;"
|
||||
- connection_host: {{ GLOBALS.manager }}
|
||||
- connection_port: 3306
|
||||
- connection_user: root
|
||||
- connection_pass: {{ MYSQLPASS }}
|
||||
|
||||
query_updatepluginurls:
|
||||
mysql_query.run:
|
||||
- database: playbook
|
||||
- query: |-
|
||||
update settings set value =
|
||||
"--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess
|
||||
project: '1'
|
||||
convert_url: http://{{ GLOBALS.manager }}:7000/playbook/sigmac
|
||||
create_url: http://{{ GLOBALS.manager }}:7000/playbook/play"
|
||||
where id = 43
|
||||
- connection_host: {{ GLOBALS.manager }}
|
||||
- connection_port: 3306
|
||||
- connection_user: root
|
||||
- connection_pass: {{ MYSQLPASS }}
|
||||
|
||||
playbook_sbin:
|
||||
file.recurse:
|
||||
- name: /usr/sbin
|
||||
- source: salt://playbook/tools/sbin
|
||||
- user: 939
|
||||
- group: 939
|
||||
- file_mode: 755
|
||||
|
||||
#playbook_sbin_jinja:
|
||||
# file.recurse:
|
||||
# - name: /usr/sbin
|
||||
# - source: salt://playbook/tools/sbin_jinja
|
||||
# - user: 939
|
||||
# - group: 939
|
||||
# - file_mode: 755
|
||||
# - template: jinja
|
||||
|
||||
playbooklogdir:
|
||||
file.directory:
|
||||
- name: /opt/so/log/playbook
|
||||
- dir_mode: 775
|
||||
- user: 939
|
||||
- group: 939
|
||||
- makedirs: True
|
||||
|
||||
playbookfilesdir:
|
||||
file.directory:
|
||||
- name: /opt/so/conf/playbook/redmine-files
|
||||
- dir_mode: 775
|
||||
- user: 939
|
||||
- group: 939
|
||||
- makedirs: True
|
||||
|
||||
{% if 'idh' in salt['cmd.shell']("ls /opt/so/saltstack/local/pillar/minions/|awk -F'_' {'print $2'}|awk -F'.' {'print $1'}").split() %}
|
||||
idh-plays:
|
||||
file.recurse:
|
||||
- name: /opt/so/conf/soctopus/sigma-import
|
||||
- source: salt://idh/plays
|
||||
- makedirs: True
|
||||
cmd.run:
|
||||
- name: so-playbook-import True
|
||||
- onchanges:
|
||||
- file: /opt/so/conf/soctopus/sigma-import
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
|
||||
{{sls}}_state_not_allowed:
|
||||
test.fail_without_changes:
|
||||
- name: {{sls}}_state_not_allowed
|
||||
|
||||
{% endif %}
|
||||
@@ -1,14 +0,0 @@
|
||||
|
||||
# This state will import the initial default playbook database.
|
||||
# If there is an existing playbook database, it will be overwritten - no backups are made.
|
||||
|
||||
include:
|
||||
- mysql
|
||||
|
||||
salt://playbook/files/playbook_db_init.sh:
|
||||
cmd.script:
|
||||
- cwd: /root
|
||||
- template: jinja
|
||||
|
||||
'sleep 5':
|
||||
cmd.run
|
||||
@@ -1,2 +0,0 @@
|
||||
playbook:
|
||||
enabled: False
|
||||
@@ -1,37 +0,0 @@
|
||||
# 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 'allowed_states.map.jinja' import allowed_states %}
|
||||
{% if sls.split('.')[0] in allowed_states %}
|
||||
|
||||
include:
|
||||
- playbook.sostatus
|
||||
|
||||
so-playbook:
|
||||
docker_container.absent:
|
||||
- force: True
|
||||
|
||||
so-playbook_so-status.disabled:
|
||||
file.comment:
|
||||
- name: /opt/so/conf/so-status/so-status.conf
|
||||
- regex: ^so-playbook$
|
||||
|
||||
so-playbook-sync_cron:
|
||||
cron.absent:
|
||||
- identifier: so-playbook-sync_cron
|
||||
- user: root
|
||||
|
||||
so-playbook-ruleupdate_cron:
|
||||
cron.absent:
|
||||
- identifier: so-playbook-ruleupdate_cron
|
||||
- user: root
|
||||
|
||||
{% else %}
|
||||
|
||||
{{sls}}_state_not_allowed:
|
||||
test.fail_without_changes:
|
||||
- name: {{sls}}_state_not_allowed
|
||||
|
||||
{% endif %}
|
||||
@@ -1,93 +0,0 @@
|
||||
# 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 'allowed_states.map.jinja' import allowed_states %}
|
||||
{% if sls.split('.')[0] in allowed_states %}
|
||||
|
||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||
{% set PLAYBOOKPASS = salt['pillar.get']('secrets:playbook_db') %}
|
||||
|
||||
include:
|
||||
- playbook.config
|
||||
- playbook.sostatus
|
||||
|
||||
{% if PLAYBOOKPASS == None %}
|
||||
|
||||
playbook_password_none:
|
||||
test.configurable_test_state:
|
||||
- changes: False
|
||||
- result: False
|
||||
- comment: "Playbook MySQL Password Error - Not Starting Playbook"
|
||||
|
||||
{% else %}
|
||||
|
||||
so-playbook:
|
||||
docker_container.running:
|
||||
- image: {{ GLOBALS.registry_host }}:5000/{{ GLOBALS.image_repo }}/so-playbook:{{ GLOBALS.so_version }}
|
||||
- hostname: playbook
|
||||
- name: so-playbook
|
||||
- networks:
|
||||
- sobridge:
|
||||
- ipv4_address: {{ DOCKER.containers['so-playbook'].ip }}
|
||||
- binds:
|
||||
- /opt/so/conf/playbook/redmine-files:/usr/src/redmine/files:rw
|
||||
- /opt/so/log/playbook:/playbook/log:rw
|
||||
{% if DOCKER.containers['so-playbook'].custom_bind_mounts %}
|
||||
{% for BIND in DOCKER.containers['so-playbook'].custom_bind_mounts %}
|
||||
- {{ BIND }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
- extra_hosts:
|
||||
- {{ GLOBALS.manager }}:{{ GLOBALS.manager_ip }}
|
||||
{% if DOCKER.containers['so-playbook'].extra_hosts %}
|
||||
{% for XTRAHOST in DOCKER.containers['so-playbook'].extra_hosts %}
|
||||
- {{ XTRAHOST }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
- environment:
|
||||
- REDMINE_DB_MYSQL={{ GLOBALS.manager }}
|
||||
- REDMINE_DB_DATABASE=playbook
|
||||
- REDMINE_DB_USERNAME=playbookdbuser
|
||||
- REDMINE_DB_PASSWORD={{ PLAYBOOKPASS }}
|
||||
{% if DOCKER.containers['so-playbook'].extra_env %}
|
||||
{% for XTRAENV in DOCKER.containers['so-playbook'].extra_env %}
|
||||
- {{ XTRAENV }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
- port_bindings:
|
||||
{% for BINDING in DOCKER.containers['so-playbook'].port_bindings %}
|
||||
- {{ BINDING }}
|
||||
{% endfor %}
|
||||
|
||||
delete_so-playbook_so-status.disabled:
|
||||
file.uncomment:
|
||||
- name: /opt/so/conf/so-status/so-status.conf
|
||||
- regex: ^so-playbook$
|
||||
|
||||
so-playbook-sync_cron:
|
||||
cron.present:
|
||||
- name: /usr/sbin/so-playbook-sync > /opt/so/log/playbook/sync.log 2>&1
|
||||
- identifier: so-playbook-sync_cron
|
||||
- user: root
|
||||
- minute: '*/5'
|
||||
|
||||
so-playbook-ruleupdate_cron:
|
||||
cron.present:
|
||||
- name: /usr/sbin/so-playbook-ruleupdate > /opt/so/log/playbook/update.log 2>&1
|
||||
- identifier: so-playbook-ruleupdate_cron
|
||||
- user: root
|
||||
- minute: '1'
|
||||
- hour: '6'
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
|
||||
{{sls}}_state_not_allowed:
|
||||
test.fail_without_changes:
|
||||
- name: {{sls}}_state_not_allowed
|
||||
|
||||
{% endif %}
|
||||
@@ -1,49 +0,0 @@
|
||||
#!/bin/bash
|
||||
# {%- set admin_pass = salt['pillar.get']('secrets:playbook_admin', None) -%}
|
||||
# {%- set automation_pass = salt['pillar.get']('secrets:playbook_automation', None) %}
|
||||
|
||||
local_salt_dir=/opt/so/saltstack/local
|
||||
|
||||
try_count=6
|
||||
interval=10
|
||||
|
||||
while [[ $try_count -le 6 ]]; do
|
||||
if docker top "so-playbook" &>/dev/null; then
|
||||
automation_group=6
|
||||
|
||||
# Create user and retrieve api_key and user_id from response
|
||||
mapfile -t automation_res < <(
|
||||
curl -s --location --request POST 'http://127.0.0.1:3000/playbook/users.json' --user "admin:{{ admin_pass }}" --header 'Content-Type: application/json' --data '{
|
||||
"user" : {
|
||||
"login" : "automation",
|
||||
"password": "{{ automation_pass }}",
|
||||
"firstname": "SecOps",
|
||||
"lastname": "Automation",
|
||||
"mail": "automation2@localhost.local"
|
||||
}
|
||||
}' | jq -r '.user.api_key, .user.id'
|
||||
)
|
||||
|
||||
automation_api_key=${automation_res[0]}
|
||||
automation_user_id=${automation_res[1]}
|
||||
|
||||
# Add user_id from newly created user to Automation group
|
||||
curl -s --location --request POST "http://127.0.0.1:3000/playbook/groups/${automation_group}/users.json" \
|
||||
--user "admin:{{ admin_pass }}" \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data "{
|
||||
\"user_id\" : ${automation_user_id}
|
||||
}"
|
||||
|
||||
# Update the Automation API key in the secrets pillar
|
||||
so-yaml.py remove $local_salt_dir/pillar/secrets.sls secrets.playbook_automation_api_key
|
||||
printf '%s\n'\
|
||||
" playbook_automation_api_key: $automation_api_key" >> $local_salt_dir/pillar/secrets.sls
|
||||
exit 0
|
||||
fi
|
||||
((try_count++))
|
||||
sleep "${interval}s"
|
||||
done
|
||||
|
||||
# Timeout exceeded, exit with non-zero exit code
|
||||
exit 1
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/bin/bash
|
||||
# {%- set MYSQLPASS = salt['pillar.get']('secrets:mysql', None) -%}
|
||||
# {%- set admin_pass = salt['pillar.get']('secrets:playbook_admin', None) %}
|
||||
. /usr/sbin/so-common
|
||||
|
||||
default_salt_dir=/opt/so/saltstack/default
|
||||
|
||||
# Generate salt + hash for admin user
|
||||
admin_salt=$(get_random_value 32)
|
||||
admin_stage1_hash=$(echo -n '{{ admin_pass }}' | sha1sum | awk '{print $1}')
|
||||
admin_hash=$(echo -n "${admin_salt}${admin_stage1_hash}" | sha1sum | awk '{print $1}')
|
||||
sed -i "s/ADMIN_HASH/${admin_hash}/g" $default_salt_dir/salt/playbook/files/playbook_db_init.sql
|
||||
sed -i "s/ADMIN_SALT/${admin_salt}/g" $default_salt_dir/salt/playbook/files/playbook_db_init.sql
|
||||
|
||||
# Copy file to destination + execute SQL
|
||||
docker cp $default_salt_dir/salt/playbook/files/playbook_db_init.sql so-mysql:/tmp/playbook_db_init.sql
|
||||
docker exec so-mysql /bin/bash -c "/usr/bin/mysql -b -uroot -p{{MYSQLPASS}} < /tmp/playbook_db_init.sql"
|
||||
File diff suppressed because one or more lines are too long
@@ -1,14 +0,0 @@
|
||||
# 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 %}
|
||||
{% from 'playbook/map.jinja' import PLAYBOOKMERGED %}
|
||||
|
||||
include:
|
||||
{% if PLAYBOOKMERGED.enabled %}
|
||||
- playbook.enabled
|
||||
{% else %}
|
||||
- playbook.disabled
|
||||
{% endif %}
|
||||
@@ -1,2 +0,0 @@
|
||||
{% import_yaml 'playbook/defaults.yaml' as PLAYBOOKDEFAULTS %}
|
||||
{% set PLAYBOOKMERGED = salt['pillar.get']('playbook', PLAYBOOKDEFAULTS.playbook, merge=True) %}
|
||||
@@ -1,4 +0,0 @@
|
||||
playbook:
|
||||
enabled:
|
||||
description: You can enable or disable Playbook.
|
||||
helpLink: playbook.html
|
||||
@@ -1,21 +0,0 @@
|
||||
# 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 'allowed_states.map.jinja' import allowed_states %}
|
||||
{% if sls.split('.')[0] in allowed_states %}
|
||||
|
||||
append_so-playbook_so-status.conf:
|
||||
file.append:
|
||||
- name: /opt/so/conf/so-status/so-status.conf
|
||||
- text: so-playbook
|
||||
- unless: grep -q so-playbook /opt/so/conf/so-status/so-status.conf
|
||||
|
||||
{% else %}
|
||||
|
||||
{{sls}}_state_not_allowed:
|
||||
test.fail_without_changes:
|
||||
- name: {{sls}}_state_not_allowed
|
||||
|
||||
{% endif %}
|
||||
@@ -1,14 +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
|
||||
|
||||
ENABLEPLAY=${1:-False}
|
||||
|
||||
docker exec so-soctopus /usr/local/bin/python -c "import playbook; print(playbook.play_import($ENABLEPLAY))"
|
||||
@@ -1,22 +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
|
||||
|
||||
salt-call state.apply playbook.db_init,playbook queue=True
|
||||
|
||||
/usr/sbin/so-soctopus-restart
|
||||
|
||||
salt-call state.apply playbook,playbook.automation_user_create queue=True
|
||||
|
||||
/usr/sbin/so-soctopus-restart
|
||||
|
||||
echo "Importing Plays - NOTE: this will continue after installation finishes and could take an hour or more. Rebooting while the import is in progress will delay playbook imports."
|
||||
sleep 5
|
||||
so-playbook-ruleupdate >> /root/setup_playbook_rule_update.log 2>&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-restart playbook $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
|
||||
|
||||
docker exec so-soctopus python3 playbook_bulk-update.py
|
||||
@@ -1,29 +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 ! [ -f /opt/so/state/playbook_regen_plays ] || [ "$1" = "--force" ]; then
|
||||
|
||||
echo "Refreshing Sigma & regenerating plays... "
|
||||
|
||||
# Regenerate ElastAlert & update Plays
|
||||
docker exec so-soctopus python3 playbook_play-update.py
|
||||
|
||||
# Delete current Elastalert Rules
|
||||
rm /opt/so/rules/elastalert/playbook/*.yaml
|
||||
|
||||
# Regenerate Elastalert Rules
|
||||
so-playbook-sync
|
||||
|
||||
# Create state file
|
||||
touch /opt/so/state/playbook_regen_plays
|
||||
else
|
||||
printf "\nState file found, exiting...\nRerun with --force to override.\n"
|
||||
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
|
||||
|
||||
/usr/sbin/so-start playbook $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 playbook $1
|
||||
@@ -1,16 +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
|
||||
|
||||
# Check to see if we are already running
|
||||
NUM_RUNNING=$(pgrep -cf "/bin/bash /usr/sbin/so-playbook-sync")
|
||||
[ "$NUM_RUNNING" -gt 1 ] && echo "$(date) - $NUM_RUNNING Playbook sync processes running...exiting." && exit 0
|
||||
|
||||
docker exec so-soctopus python3 playbook_play-sync.py
|
||||
@@ -1291,11 +1291,6 @@ soc:
|
||||
icon: fa-external-link-alt
|
||||
target: so-cyberchef
|
||||
link: /cyberchef/
|
||||
- name: toolPlaybook
|
||||
description: toolPlaybookHelp
|
||||
icon: fa-external-link-alt
|
||||
target: so-playbook
|
||||
link: /playbook/projects/detection-playbooks/issues/
|
||||
- name: toolNavigator
|
||||
description: toolNavigatorHelp
|
||||
icon: fa-external-link-alt
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
# 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 'allowed_states.map.jinja' import allowed_states %}
|
||||
{% if sls.split('.')[0] in allowed_states %}
|
||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||
|
||||
include:
|
||||
- nginx.config
|
||||
|
||||
soctopusdir:
|
||||
file.directory:
|
||||
- name: /opt/so/conf/soctopus/sigma-import
|
||||
- user: 939
|
||||
- group: 939
|
||||
- makedirs: True
|
||||
|
||||
soctopus-sync:
|
||||
file.recurse:
|
||||
- name: /opt/so/conf/soctopus/templates
|
||||
- source: salt://soctopus/files/templates
|
||||
- user: 939
|
||||
- group: 939
|
||||
- template: jinja
|
||||
- defaults:
|
||||
GLOBALS: {{ GLOBALS }}
|
||||
|
||||
soctopusconf:
|
||||
file.managed:
|
||||
- name: /opt/so/conf/soctopus/SOCtopus.conf
|
||||
- source: salt://soctopus/files/SOCtopus.conf
|
||||
- user: 939
|
||||
- group: 939
|
||||
- mode: 600
|
||||
- template: jinja
|
||||
- show_changes: False
|
||||
- defaults:
|
||||
GLOBALS: {{ GLOBALS }}
|
||||
|
||||
soctopuslogdir:
|
||||
file.directory:
|
||||
- name: /opt/so/log/soctopus
|
||||
- user: 939
|
||||
- group: 939
|
||||
|
||||
playbookrulesdir:
|
||||
file.directory:
|
||||
- name: /opt/so/rules/elastalert/playbook
|
||||
- user: 939
|
||||
- group: 939
|
||||
- makedirs: True
|
||||
|
||||
playbookrulessync:
|
||||
file.recurse:
|
||||
- name: /opt/so/rules/elastalert/playbook
|
||||
- source: salt://soctopus/files/templates
|
||||
- user: 939
|
||||
- group: 939
|
||||
- template: jinja
|
||||
- defaults:
|
||||
GLOBALS: {{ GLOBALS }}
|
||||
|
||||
soctopus_sbin:
|
||||
file.recurse:
|
||||
- name: /usr/sbin
|
||||
- source: salt://soctopus/tools/sbin
|
||||
- user: 939
|
||||
- group: 939
|
||||
- file_mode: 755
|
||||
|
||||
#soctopus_sbin_jinja:
|
||||
# file.recurse:
|
||||
# - name: /usr/sbin
|
||||
# - source: salt://soctopus/tools/sbin_jinja
|
||||
# - user: 939
|
||||
# - group: 939
|
||||
# - file_mode: 755
|
||||
# - template: jinja
|
||||
|
||||
{% else %}
|
||||
|
||||
{{sls}}_state_not_allowed:
|
||||
test.fail_without_changes:
|
||||
- name: {{sls}}_state_not_allowed
|
||||
|
||||
{% endif %}
|
||||
@@ -1,2 +0,0 @@
|
||||
soctopus:
|
||||
enabled: False
|
||||
@@ -1,27 +0,0 @@
|
||||
# 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 'allowed_states.map.jinja' import allowed_states %}
|
||||
{% if sls.split('.')[0] in allowed_states %}
|
||||
|
||||
include:
|
||||
- soctopus.sostatus
|
||||
|
||||
so-soctopus:
|
||||
docker_container.absent:
|
||||
- force: True
|
||||
|
||||
so-soctopus_so-status.disabled:
|
||||
file.comment:
|
||||
- name: /opt/so/conf/so-status/so-status.conf
|
||||
- regex: ^so-soctopus$
|
||||
|
||||
{% else %}
|
||||
|
||||
{{sls}}_state_not_allowed:
|
||||
test.fail_without_changes:
|
||||
- name: {{sls}}_state_not_allowed
|
||||
|
||||
{% endif %}
|
||||
@@ -1,72 +0,0 @@
|
||||
# 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 'allowed_states.map.jinja' import allowed_states %}
|
||||
{% if sls.split('.')[0] in allowed_states %}
|
||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
||||
|
||||
include:
|
||||
- soctopus.config
|
||||
- soctopus.sostatus
|
||||
|
||||
so-soctopus:
|
||||
docker_container.running:
|
||||
- image: {{ GLOBALS.registry_host }}:5000/{{ GLOBALS.image_repo }}/so-soctopus:{{ GLOBALS.so_version }}
|
||||
- hostname: soctopus
|
||||
- name: so-soctopus
|
||||
- networks:
|
||||
- sobridge:
|
||||
- ipv4_address: {{ DOCKER.containers['so-soctopus'].ip }}
|
||||
- binds:
|
||||
- /opt/so/conf/soctopus/SOCtopus.conf:/SOCtopus/SOCtopus.conf:ro
|
||||
- /opt/so/log/soctopus/:/var/log/SOCtopus/:rw
|
||||
- /opt/so/rules/elastalert/playbook:/etc/playbook-rules:rw
|
||||
- /opt/so/conf/navigator/layers/:/etc/playbook/:rw
|
||||
- /opt/so/conf/soctopus/sigma-import/:/SOCtopus/sigma-import/:rw
|
||||
{% if GLOBALS.airgap %}
|
||||
- /nsm/repo/rules/sigma:/soctopus/sigma
|
||||
{% endif %}
|
||||
{% if DOCKER.containers['so-soctopus'].custom_bind_mounts %}
|
||||
{% for BIND in DOCKER.containers['so-soctopus'].custom_bind_mounts %}
|
||||
- {{ BIND }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
- port_bindings:
|
||||
{% for BINDING in DOCKER.containers['so-soctopus'].port_bindings %}
|
||||
- {{ BINDING }}
|
||||
{% endfor %}
|
||||
- extra_hosts:
|
||||
- {{GLOBALS.url_base}}:{{GLOBALS.manager_ip}}
|
||||
- {{ GLOBALS.manager }}:{{ GLOBALS.manager_ip }}
|
||||
{% if DOCKER.containers['so-soctopus'].extra_hosts %}
|
||||
{% for XTRAHOST in DOCKER.containers['so-soctopus'].extra_hosts %}
|
||||
- {{ XTRAHOST }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if DOCKER.containers['so-soctopus'].extra_env %}
|
||||
- environment:
|
||||
{% for XTRAENV in DOCKER.containers['so-soctopus'].extra_env %}
|
||||
- {{ XTRAENV }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
- watch:
|
||||
- file: /opt/so/conf/soctopus/SOCtopus.conf
|
||||
- require:
|
||||
- file: soctopusconf
|
||||
- file: navigatordefaultlayer
|
||||
|
||||
delete_so-soctopus_so-status.disabled:
|
||||
file.uncomment:
|
||||
- name: /opt/so/conf/so-status/so-status.conf
|
||||
- regex: ^so-soctopus$
|
||||
|
||||
{% else %}
|
||||
|
||||
{{sls}}_state_not_allowed:
|
||||
test.fail_without_changes:
|
||||
- name: {{sls}}_state_not_allowed
|
||||
|
||||
{% endif %}
|
||||
@@ -1,77 +0,0 @@
|
||||
{%- set HIVEKEY = salt['pillar.get']('global:hivekey', '') %}
|
||||
{%- set THEHIVEURL = salt['pillar.get']('global:hiveurl', '') %}
|
||||
{%- set CORTEXKEY = salt['pillar.get']('global:cortexorguserkey', '') %}
|
||||
{%- set PLAYBOOK_KEY = salt['pillar.get']('secrets:playbook_automation_api_key', '') %}
|
||||
{%- set ES_USER = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:user', '') %}
|
||||
{%- set ES_PASS = salt['pillar.get']('elasticsearch:auth:users:so_elastic_user:pass', '') %}
|
||||
|
||||
[es]
|
||||
es_url = https://{{ GLOBALS.manager_ip }}:9200
|
||||
es_ip = {{ GLOBALS.manager_ip }}
|
||||
es_user = {{ ES_USER }}
|
||||
es_pass = "{{ ES_PASS }}"
|
||||
es_index_pattern = so-*
|
||||
es_verifycert = no
|
||||
|
||||
[cortex]
|
||||
auto_analyze_alerts = no
|
||||
cortex_url = https://{{THEHIVEURL}}/cortex/
|
||||
cortex_key = {{ CORTEXKEY }}
|
||||
supported_analyzers = Urlscan_io_Search,CERTatPassiveDNS
|
||||
|
||||
[fir]
|
||||
fir_url = YOURFIRURL
|
||||
fir_token = YOURFIRTOKEN
|
||||
fir_actor = 3
|
||||
fir_category = 3
|
||||
fir_confidentiality = 1
|
||||
fir_detection = 2
|
||||
fir_plan = 8
|
||||
fir_severity = 4
|
||||
fir_verifycert = no
|
||||
|
||||
[grr]
|
||||
grr_url = YOURGRRURL
|
||||
grr_user = YOURGRRUSER
|
||||
grr_pass = YOURGRRPASS
|
||||
|
||||
[hive]
|
||||
hive_url = https://{{THEHIVEURL}}/thehive/
|
||||
hive_key = {{ HIVEKEY }}
|
||||
hive_tlp = 3
|
||||
hive_verifycert = no
|
||||
|
||||
[misp]
|
||||
misp_url = YOURMISPURL
|
||||
misp_key = YOURMISPKEY
|
||||
misp_verifycert = no
|
||||
distrib = 0
|
||||
threat = 4
|
||||
analysis = 0
|
||||
|
||||
[rtir]
|
||||
rtir_url = YOURRTIRURL
|
||||
rtir_api = REST/1.0/
|
||||
rtir_user = YOURRTIRUSER
|
||||
rtir_pass = YOURRTIRPASS
|
||||
rtir_queue = Incidents
|
||||
rtir_creator = root
|
||||
rtir_verifycert = no
|
||||
|
||||
[slack]
|
||||
slack_url = YOURSLACKWORKSPACE
|
||||
slack_webhook = YOURSLACKWEBHOOK
|
||||
|
||||
[soc]
|
||||
soc_url = http://{{ GLOBALS.manager }}:9822
|
||||
|
||||
[playbook]
|
||||
playbook_url = http://{{ GLOBALS.manager }}:3000/playbook
|
||||
playbook_ext_url = https://{{ GLOBALS.url_base }}/playbook
|
||||
playbook_key = {{ PLAYBOOK_KEY }}
|
||||
playbook_verifycert = no
|
||||
playbook_unit_test_index = playbook-testing
|
||||
playbook_rulesets = {{ salt['pillar.get']('soctopus:playbook:rulesets')|join(",") }}
|
||||
|
||||
[log]
|
||||
logfile = /var/log/SOCtopus/soctopus.log
|
||||
@@ -1,5 +0,0 @@
|
||||
alert: modules.so.playbook-es.PlaybookESAlerter
|
||||
elasticsearch_host: "{{ GLOBALS.manager_ip }}:9200"
|
||||
play_title: ""
|
||||
play_url: "https://{{ GLOBALS.manager_ip }}/playbook/issues/6000"
|
||||
sigma_level: ""
|
||||
@@ -1,22 +0,0 @@
|
||||
alert:
|
||||
- "modules.so.playbook-es.PlaybookESAlerter"
|
||||
|
||||
elasticsearch_host: "{{ GLOBALS.url_base }}:9200"
|
||||
play_title: ""
|
||||
play_id: ""
|
||||
event.module: "playbook"
|
||||
event.dataset: "playbook.alert"
|
||||
event.severity:
|
||||
rule.category:
|
||||
play_url: "https://{{ GLOBALS.url_base }}/playbook/issues/6000"
|
||||
kibana_pivot: "https://{{ GLOBALS.url_base }}/kibana/app/kibana#/discover?_g=()&_a=(columns:!(_source),interval:auto,query:(language:lucene,query:'_id:{[_id]}'),sort:!('@timestamp',desc))"
|
||||
soc_pivot: "https://{{ GLOBALS.url_base }}/#/hunt"
|
||||
sigma_level: ""
|
||||
|
||||
index: '.ds-logs-*'
|
||||
name: EQL
|
||||
priority: 3
|
||||
realert:
|
||||
minutes: 0
|
||||
type: any
|
||||
filter:
|
||||
@@ -1,13 +0,0 @@
|
||||
alert:
|
||||
- "modules.so.playbook-es.PlaybookESAlerter"
|
||||
|
||||
elasticsearch_host: "{{ GLOBALS.url_base }}:9200"
|
||||
play_title: ""
|
||||
event.module: "playbook"
|
||||
event.dataset: "alert"
|
||||
event.severity:
|
||||
rule.category:
|
||||
play_url: "https://{{ GLOBALS.url_base }}/playbook/issues/6000"
|
||||
kibana_pivot: "https://{{ GLOBALS.url_base }}/kibana/app/kibana#/discover?_g=()&_a=(columns:!(_source),interval:auto,query:(language:lucene,query:'_id:{[_id]}'),sort:!('@timestamp',desc))"
|
||||
soc_pivot: "https://{{ GLOBALS.url_base }}/#/hunt"
|
||||
sigma_level: ""
|
||||
@@ -1,13 +0,0 @@
|
||||
# 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 'soctopus/map.jinja' import SOCTOPUSMERGED %}
|
||||
|
||||
include:
|
||||
{% if SOCTOPUSMERGED.enabled %}
|
||||
- soctopus.enabled
|
||||
{% else %}
|
||||
- soctopus.disabled
|
||||
{% endif %}
|
||||
@@ -1,7 +0,0 @@
|
||||
{# 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. #}
|
||||
|
||||
{% import_yaml 'soctopus/defaults.yaml' as SOCTOPUSDEFAULTS %}
|
||||
{% set SOCTOPUSMERGED = salt['pillar.get']('soctopus', SOCTOPUSDEFAULTS.soctopus, merge=True) %}
|
||||
@@ -1,10 +0,0 @@
|
||||
soctopus:
|
||||
enabled:
|
||||
description: You can enable or disable SOCtopus.
|
||||
helpLink: playbook.html
|
||||
playbook:
|
||||
rulesets:
|
||||
description: List of playbook rulesets.
|
||||
advanced: True
|
||||
helpLink: playbook.html
|
||||
global: True
|
||||
@@ -1,21 +0,0 @@
|
||||
# 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 'allowed_states.map.jinja' import allowed_states %}
|
||||
{% if sls.split('.')[0] in allowed_states %}
|
||||
|
||||
append_so-soctopus_so-status.conf:
|
||||
file.append:
|
||||
- name: /opt/so/conf/so-status/so-status.conf
|
||||
- text: so-soctopus
|
||||
- unless: grep -q so-soctopus /opt/so/conf/so-status/so-status.conf
|
||||
|
||||
{% else %}
|
||||
|
||||
{{sls}}_state_not_allowed:
|
||||
test.fail_without_changes:
|
||||
- name: {{sls}}_state_not_allowed
|
||||
|
||||
{% endif %}
|
||||
@@ -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-restart soctopus $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-start soctopus $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 soctopus $1
|
||||
12
salt/top.sls
12
salt/top.sls
@@ -67,7 +67,6 @@ base:
|
||||
- idstools
|
||||
- suricata.manager
|
||||
- healthcheck
|
||||
- mysql
|
||||
- elasticsearch
|
||||
- elastic-fleet-package-registry
|
||||
- kibana
|
||||
@@ -78,8 +77,6 @@ base:
|
||||
- curator.disabled
|
||||
- elastalert
|
||||
- utility
|
||||
- soctopus
|
||||
- playbook
|
||||
- elasticfleet
|
||||
|
||||
'*_manager and G@saltversion:{{saltversion}}':
|
||||
@@ -99,7 +96,6 @@ base:
|
||||
- backup.config_backup
|
||||
- idstools
|
||||
- suricata.manager
|
||||
- mysql
|
||||
- elasticsearch
|
||||
- logstash
|
||||
- redis
|
||||
@@ -108,8 +104,6 @@ base:
|
||||
- curator.disabled
|
||||
- elastalert
|
||||
- utility
|
||||
- soctopus
|
||||
- playbook
|
||||
- elasticfleet
|
||||
- stig
|
||||
|
||||
@@ -132,7 +126,6 @@ base:
|
||||
- idstools
|
||||
- suricata.manager
|
||||
- healthcheck
|
||||
- mysql
|
||||
- elasticsearch
|
||||
- logstash
|
||||
- redis
|
||||
@@ -145,8 +138,6 @@ base:
|
||||
- curator.disabled
|
||||
- elastalert
|
||||
- utility
|
||||
- soctopus
|
||||
- playbook
|
||||
- elasticfleet
|
||||
- stig
|
||||
|
||||
@@ -179,7 +170,6 @@ base:
|
||||
- backup.config_backup
|
||||
- idstools
|
||||
- suricata.manager
|
||||
- mysql
|
||||
- elasticsearch
|
||||
- logstash
|
||||
- redis
|
||||
@@ -188,8 +178,6 @@ base:
|
||||
- kibana
|
||||
- elastalert
|
||||
- utility
|
||||
- soctopus
|
||||
- playbook
|
||||
- elasticfleet
|
||||
- stig
|
||||
|
||||
|
||||
@@ -792,7 +792,6 @@ create_manager_pillars() {
|
||||
create_global
|
||||
create_sensoroni_pillar
|
||||
backup_pillar
|
||||
soctopus_pillar
|
||||
docker_pillar
|
||||
redis_pillar
|
||||
idstools_pillar
|
||||
@@ -1109,10 +1108,6 @@ generate_ssl() {
|
||||
|
||||
generate_passwords(){
|
||||
title "Generate Random Passwords"
|
||||
MYSQLPASS=$(get_random_value)
|
||||
PLAYBOOKDBPASS=$(get_random_value)
|
||||
PLAYBOOKADMINPASS=$(get_random_value)
|
||||
PLAYBOOKAUTOMATIONPASS=$(get_random_value)
|
||||
INFLUXPASS=$(get_random_value)
|
||||
INFLUXTOKEN=$(head -c 64 /dev/urandom | base64 --wrap=0)
|
||||
SENSORONIKEY=$(get_random_value)
|
||||
@@ -1167,11 +1162,6 @@ install_cleanup() {
|
||||
# that will disrupt automated tests should be placed beneath this statement.
|
||||
[ -n "$TESTING" ] && return
|
||||
|
||||
# If Mysql is running stop it
|
||||
if docker ps --format "{{.Names}}" 2>&1 | grep -q "so-mysql"; then
|
||||
logVmd "/usr/sbin/so-mysql-stop"
|
||||
fi
|
||||
|
||||
if [[ $setup_type == 'iso' ]]; then
|
||||
info "Removing so-setup permission entry from sudoers file"
|
||||
logCmd "sed -i '/so-setup/d' /etc/sudoers"
|
||||
@@ -1279,17 +1269,11 @@ telegraf_pillar() {
|
||||
manager_pillar() {
|
||||
touch $adv_manager_pillar_file
|
||||
title "Create the manager pillar"
|
||||
if [[ $is_import ]]; then
|
||||
PLAYBOOK=0
|
||||
else
|
||||
PLAYBOOK=1
|
||||
fi
|
||||
printf '%s\n'\
|
||||
"manager:"\
|
||||
" proxy: '$so_proxy'"\
|
||||
" no_proxy: '$no_proxy_string'"\
|
||||
" elastalert: 1"\
|
||||
" playbook: $PLAYBOOK"\
|
||||
"" > "$manager_pillar_file"
|
||||
}
|
||||
|
||||
@@ -1362,16 +1346,6 @@ backup_pillar() {
|
||||
touch $adv_backup_pillar_file
|
||||
}
|
||||
|
||||
soctopus_pillar() {
|
||||
title "Create the soctopus pillar file"
|
||||
touch $adv_soctopus_pillar_file
|
||||
printf '%s\n'\
|
||||
"soctopus:"\
|
||||
" playbook:"\
|
||||
" rulesets:"\
|
||||
" - windows" > "$soctopus_pillar_file"
|
||||
}
|
||||
|
||||
docker_pillar() {
|
||||
title "Create the docker pillar file"
|
||||
touch $adv_docker_pillar_file
|
||||
@@ -1413,7 +1387,7 @@ make_some_dirs() {
|
||||
mkdir -p $local_salt_dir/salt/firewall/portgroups
|
||||
mkdir -p $local_salt_dir/salt/firewall/ports
|
||||
|
||||
for THEDIR in bpf pcap elasticsearch ntp firewall redis backup influxdb strelka sensoroni soc soctopus docker zeek suricata nginx telegraf logstash soc manager kratos idstools idh elastalert stig global;do
|
||||
for THEDIR in bpf pcap elasticsearch ntp firewall redis backup influxdb strelka sensoroni soc docker zeek suricata nginx telegraf logstash soc manager kratos idstools idh elastalert stig global;do
|
||||
mkdir -p $local_salt_dir/pillar/$THEDIR
|
||||
touch $local_salt_dir/pillar/$THEDIR/adv_$THEDIR.sls
|
||||
touch $local_salt_dir/pillar/$THEDIR/soc_$THEDIR.sls
|
||||
@@ -1949,7 +1923,6 @@ saltify() {
|
||||
|
||||
salt_install_module_deps() {
|
||||
logCmd "salt-pip install docker --no-index --only-binary=:all: --find-links files/salt_module_deps/docker/"
|
||||
logCmd "salt-pip install pymysql --no-index --only-binary=:all: --find-links files/salt_module_deps/pymysql/"
|
||||
}
|
||||
|
||||
salt_patch_x509_v2() {
|
||||
@@ -1967,11 +1940,6 @@ secrets_pillar(){
|
||||
mkdir -p $local_salt_dir/pillar
|
||||
printf '%s\n'\
|
||||
"secrets:"\
|
||||
" mysql: $MYSQLPASS"\
|
||||
" playbook_db: $PLAYBOOKDBPASS"\
|
||||
" playbook_admin: $PLAYBOOKADMINPASS"\
|
||||
" playbook_automation: $PLAYBOOKAUTOMATIONPASS"\
|
||||
" playbook_automation_api_key: "\
|
||||
" import_pass: $IMPORTPASS"\
|
||||
" influx_pass: $INFLUXPASS" > $local_salt_dir/pillar/secrets.sls
|
||||
fi
|
||||
|
||||
@@ -775,10 +775,6 @@ if ! [[ -f $install_opt_file ]]; then
|
||||
error "Failed to run so-elastic-fleet-setup"
|
||||
fail_setup
|
||||
fi
|
||||
if [[ ! $is_import ]]; then
|
||||
title "Setting up Playbook"
|
||||
logCmd "so-playbook-reset"
|
||||
fi
|
||||
checkin_at_boot
|
||||
set_initial_firewall_access
|
||||
logCmd "salt-call schedule.enable -linfo --local"
|
||||
|
||||
@@ -112,12 +112,6 @@ export sensoroni_pillar_file
|
||||
adv_sensoroni_pillar_file="$local_salt_dir/pillar/sensoroni/adv_sensoroni.sls"
|
||||
export adv_sensoroni_pillar_file
|
||||
|
||||
soctopus_pillar_file="$local_salt_dir/pillar/soctopus/soc_soctopus.sls"
|
||||
export soctopus_pillar_file
|
||||
|
||||
adv_soctopus_pillar_file="$local_salt_dir/pillar/soctopus/adv_soctopus.sls"
|
||||
export adv_soctopus_pillar_file
|
||||
|
||||
docker_pillar_file="$local_salt_dir/pillar/docker/soc_docker.sls"
|
||||
export docker_pillar
|
||||
|
||||
|
||||
Reference in New Issue
Block a user