mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
enabled/disable soctopus in ui
This commit is contained in:
@@ -295,6 +295,13 @@ function add_nginx_to_minion() {
|
|||||||
" " >> $PILLARFILE
|
" " >> $PILLARFILE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function add_soctopus_to_minion() {
|
||||||
|
printf '%s\n'\
|
||||||
|
"soctopus:"\
|
||||||
|
" enabled: True"\
|
||||||
|
" " >> $PILLARFILE
|
||||||
|
}
|
||||||
|
|
||||||
function create_fleet_policy() {
|
function create_fleet_policy() {
|
||||||
|
|
||||||
JSON_STRING=$( jq -n \
|
JSON_STRING=$( jq -n \
|
||||||
@@ -348,6 +355,7 @@ function createEVAL() {
|
|||||||
add_telegraf_to_minion
|
add_telegraf_to_minion
|
||||||
add_influxdb_to_minion
|
add_influxdb_to_minion
|
||||||
add_nginx_to_minion
|
add_nginx_to_minion
|
||||||
|
add_soctopus_to_minion
|
||||||
}
|
}
|
||||||
|
|
||||||
function createSTANDALONE() {
|
function createSTANDALONE() {
|
||||||
@@ -363,6 +371,7 @@ function createSTANDALONE() {
|
|||||||
add_telegraf_to_minion
|
add_telegraf_to_minion
|
||||||
add_influxdb_to_minion
|
add_influxdb_to_minion
|
||||||
add_nginx_to_minion
|
add_nginx_to_minion
|
||||||
|
add_soctopus_to_minion
|
||||||
}
|
}
|
||||||
|
|
||||||
function createMANAGER() {
|
function createMANAGER() {
|
||||||
@@ -376,6 +385,7 @@ function createMANAGER() {
|
|||||||
add_telegraf_to_minion
|
add_telegraf_to_minion
|
||||||
add_influxdb_to_minion
|
add_influxdb_to_minion
|
||||||
add_nginx_to_minion
|
add_nginx_to_minion
|
||||||
|
add_soctopus_to_minion
|
||||||
}
|
}
|
||||||
|
|
||||||
function createMANAGERSEARCH() {
|
function createMANAGERSEARCH() {
|
||||||
@@ -389,6 +399,7 @@ function createMANAGERSEARCH() {
|
|||||||
add_telegraf_to_minion
|
add_telegraf_to_minion
|
||||||
add_influxdb_to_minion
|
add_influxdb_to_minion
|
||||||
add_nginx_to_minion
|
add_nginx_to_minion
|
||||||
|
add_soctopus_to_minion
|
||||||
}
|
}
|
||||||
|
|
||||||
function createIMPORT() {
|
function createIMPORT() {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
nginx:
|
nginx:
|
||||||
enabled:
|
enabled:
|
||||||
description: You can enable or disable Nginx.
|
description: You can enable or disable Nginx.
|
||||||
|
advanced: True
|
||||||
helpLink: nginx.html
|
helpLink: nginx.html
|
||||||
config:
|
config:
|
||||||
replace_cert:
|
replace_cert:
|
||||||
|
|||||||
88
salt/soctopus/config.sls
Normal file
88
salt/soctopus/config.sls
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
# 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 %}
|
||||||
2
salt/soctopus/defaults.yaml
Normal file
2
salt/soctopus/defaults.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
soctopus:
|
||||||
|
enabled: False
|
||||||
27
salt/soctopus/disabled.sls
Normal file
27
salt/soctopus/disabled.sls
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# 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 %}
|
||||||
54
salt/soctopus/enabled.sls
Normal file
54
salt/soctopus/enabled.sls
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
# 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/nav_layer_playbook.json:/etc/playbook/nav_layer_playbook.json:rw
|
||||||
|
- /opt/so/conf/soctopus/sigma-import/:/SOCtopus/sigma-import/:rw
|
||||||
|
{% if GLOBALS.airgap %}
|
||||||
|
- /nsm/repo/rules/sigma:/soctopus/sigma
|
||||||
|
{% 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 }}
|
||||||
|
- 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,117 +1,13 @@
|
|||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
|
||||||
{% if sls in allowed_states %}
|
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
|
||||||
{% from 'docker/docker.map.jinja' import DOCKER %}
|
# https://securityonion.net/license; you may not use this file except in compliance with the
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
# Elastic License 2.0.
|
||||||
|
|
||||||
|
{% from 'soctopus/map.jinja' import SOCTOPUSMERGED %}
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- nginx.config
|
{% if SOCTOPUSMERGED.enabled %}
|
||||||
|
- soctopus.enabled
|
||||||
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
|
|
||||||
|
|
||||||
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/nav_layer_playbook.json:/etc/playbook/nav_layer_playbook.json:rw
|
|
||||||
- /opt/so/conf/soctopus/sigma-import/:/SOCtopus/sigma-import/:rw
|
|
||||||
{% if GLOBALS.airgap %}
|
|
||||||
- /nsm/repo/rules/sigma:/soctopus/sigma
|
|
||||||
{% 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 }}
|
|
||||||
- require:
|
|
||||||
- file: soctopusconf
|
|
||||||
- file: navigatordefaultlayer
|
|
||||||
|
|
||||||
append_so-soctopus_so-status.conf:
|
|
||||||
file.append:
|
|
||||||
- name: /opt/so/conf/so-status/so-status.conf
|
|
||||||
- text: so-soctopus
|
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
- soctopus.disabled
|
||||||
{{sls}}_state_not_allowed:
|
|
||||||
test.fail_without_changes:
|
|
||||||
- name: {{sls}}_state_not_allowed
|
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
7
salt/soctopus/map.jinja
Normal file
7
salt/soctopus/map.jinja
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{# 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,7 +1,10 @@
|
|||||||
soctopus:
|
soctopus:
|
||||||
|
enabled:
|
||||||
|
description: You can enable or disable SOCtopus.
|
||||||
|
helpLink: soctopus.html
|
||||||
playbook:
|
playbook:
|
||||||
rulesets:
|
rulesets:
|
||||||
description: List of playbook rulesets.
|
description: List of playbook rulesets.
|
||||||
advanced: True
|
advanced: True
|
||||||
helplink: soctopus.html
|
helplink: soctopus.html
|
||||||
global: True
|
global: True
|
||||||
|
|||||||
21
salt/soctopus/sostatus.sls
Normal file
21
salt/soctopus/sostatus.sls
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# 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 %}
|
||||||
Reference in New Issue
Block a user