Merge pull request #891 from Security-Onion-Solutions/feature/navigator-to-nginx

Feature/navigator to nginx
This commit is contained in:
William Wernert
2020-06-26 15:48:46 -04:00
committed by GitHub
23 changed files with 1171 additions and 1222 deletions

View File

@@ -44,7 +44,6 @@ eval:
{% endif %} {% endif %}
{% if PLAYBOOK != '0' %} {% if PLAYBOOK != '0' %}
- so-playbook - so-playbook
- so-navigator
{% endif %} {% endif %}
{% if FREQSERVER != '0' %} {% if FREQSERVER != '0' %}
- so-freqserver - so-freqserver
@@ -116,7 +115,6 @@ master_search:
{% endif %} {% endif %}
{% if PLAYBOOK != '0' %} {% if PLAYBOOK != '0' %}
- so-playbook - so-playbook
- so-navigator
{% endif %} {% endif %}
{% if FREQSERVER != '0' %} {% if FREQSERVER != '0' %}
- so-freqserver - so-freqserver
@@ -159,7 +157,6 @@ master:
{% endif %} {% endif %}
{% if PLAYBOOK != '0' %} {% if PLAYBOOK != '0' %}
- so-playbook - so-playbook
- so-navigator
{% endif %} {% endif %}
{% if FREQSERVER != '0' %} {% if FREQSERVER != '0' %}
- so-freqserver - so-freqserver

View File

@@ -1,6 +1,5 @@
{% set docker = { {% set docker = {
'containers': [ 'containers': [
'so-playbook', 'so-playbook'
'so-navigator'
] ]
} %} } %}

View File

@@ -81,7 +81,6 @@ if [ $MASTERCHECK != 'so-helix' ]; then
"so-kratos:$VERSION" \ "so-kratos:$VERSION" \
"so-logstash:$VERSION" \ "so-logstash:$VERSION" \
"so-mysql:$VERSION" \ "so-mysql:$VERSION" \
"so-navigator:$VERSION" \
"so-nginx:$VERSION" \ "so-nginx:$VERSION" \
"so-playbook:$VERSION" \ "so-playbook:$VERSION" \
"so-redis:$VERSION" \ "so-redis:$VERSION" \

View File

@@ -18,7 +18,6 @@ TRUSTED_CONTAINERS=( \
"so-kibana:$VERSION" \ "so-kibana:$VERSION" \
"so-logstash:$VERSION" \ "so-logstash:$VERSION" \
"so-mysql:$VERSION" \ "so-mysql:$VERSION" \
"so-navigator:$VERSION" \
"so-playbook:$VERSION" \ "so-playbook:$VERSION" \
"so-redis:$VERSION" \ "so-redis:$VERSION" \
"so-sensoroni:$VERSION" \ "so-sensoroni:$VERSION" \

View File

@@ -1,4 +1,6 @@
#!/bin/bash
{%- if grains['role'] in ['so-node', 'so-searchnode', 'so-heavynode'] %} {%- if grains['role'] in ['so-node', 'so-searchnode', 'so-heavynode'] %}
{%- set ELASTICSEARCH_HOST = salt['pillar.get']('node:mainip', '') -%} {%- set ELASTICSEARCH_HOST = salt['pillar.get']('node:mainip', '') -%}
{%- set ELASTICSEARCH_PORT = salt['pillar.get']('node:es_port', '') -%} {%- set ELASTICSEARCH_PORT = salt['pillar.get']('node:es_port', '') -%}
@@ -9,8 +11,6 @@
{%- set LOG_SIZE_LIMIT = salt['pillar.get']('master:log_size_limit', '') -%} {%- set LOG_SIZE_LIMIT = salt['pillar.get']('master:log_size_limit', '') -%}
{%- endif -%} {%- endif -%}
#!/bin/bash
#
# Copyright 2014,2015,2016,2017,2018 Security Onion Solutions, LLC # Copyright 2014,2015,2016,2017,2018 Security Onion Solutions, LLC
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify

View File

@@ -13,7 +13,6 @@ role:
- {{ portgroups.wazuh_authd }} - {{ portgroups.wazuh_authd }}
- {{ portgroups.playbook }} - {{ portgroups.playbook }}
- {{ portgroups.mysql }} - {{ portgroups.mysql }}
- {{ portgroups.navigator }}
- {{ portgroups.kibana }} - {{ portgroups.kibana }}
- {{ portgroups.redis }} - {{ portgroups.redis }}
- {{ portgroups.influxdb }} - {{ portgroups.influxdb }}
@@ -95,7 +94,6 @@ role:
- {{ portgroups.wazuh_authd }} - {{ portgroups.wazuh_authd }}
- {{ portgroups.playbook }} - {{ portgroups.playbook }}
- {{ portgroups.mysql }} - {{ portgroups.mysql }}
- {{ portgroups.navigator }}
- {{ portgroups.kibana }} - {{ portgroups.kibana }}
- {{ portgroups.redis }} - {{ portgroups.redis }}
- {{ portgroups.influxdb }} - {{ portgroups.influxdb }}
@@ -174,7 +172,6 @@ role:
- {{ portgroups.wazuh_authd }} - {{ portgroups.wazuh_authd }}
- {{ portgroups.playbook }} - {{ portgroups.playbook }}
- {{ portgroups.mysql }} - {{ portgroups.mysql }}
- {{ portgroups.navigator }}
- {{ portgroups.kibana }} - {{ portgroups.kibana }}
- {{ portgroups.redis }} - {{ portgroups.redis }}
- {{ portgroups.influxdb }} - {{ portgroups.influxdb }}
@@ -253,7 +250,6 @@ role:
- {{ portgroups.wazuh_authd }} - {{ portgroups.wazuh_authd }}
- {{ portgroups.playbook }} - {{ portgroups.playbook }}
- {{ portgroups.mysql }} - {{ portgroups.mysql }}
- {{ portgroups.navigator }}
- {{ portgroups.kibana }} - {{ portgroups.kibana }}
- {{ portgroups.redis }} - {{ portgroups.redis }}
- {{ portgroups.influxdb }} - {{ portgroups.influxdb }}
@@ -330,7 +326,6 @@ role:
- {{ portgroups.wazuh_agent }} - {{ portgroups.wazuh_agent }}
- {{ portgroups.playbook }} - {{ portgroups.playbook }}
- {{ portgroups.mysql }} - {{ portgroups.mysql }}
- {{ portgroups.navigator }}
- {{ portgroups.kibana }} - {{ portgroups.kibana }}
- {{ portgroups.redis }} - {{ portgroups.redis }}
- {{ portgroups.influxdb }} - {{ portgroups.influxdb }}

View File

@@ -48,9 +48,6 @@ firewall:
mysql: mysql:
tcp: tcp:
- 3306 - 3306
navigator:
tcp:
- 4200
nginx: nginx:
tcp: tcp:
- 80 - 80

View File

@@ -18,7 +18,6 @@ TRUSTED_CONTAINERS=( \
"so-wazuh:$VERSION" \ "so-wazuh:$VERSION" \
"so-kibana:$VERSION" \ "so-kibana:$VERSION" \
"so-elastalert:$VERSION" \ "so-elastalert:$VERSION" \
"so-navigator:$VERSION" \
"so-filebeat:$VERSION" \ "so-filebeat:$VERSION" \
"so-suricata:$VERSION" \ "so-suricata:$VERSION" \
"so-logstash:$VERSION" \ "so-logstash:$VERSION" \

View File

@@ -159,8 +159,15 @@ http {
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
} }
location /cyberchef { location /navigator/ {
rewrite ^ /cyberchef/ permanent; auth_request /auth/sessions/whoami;
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 /packages/ { location /packages/ {
@@ -224,19 +231,6 @@ http {
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
} }
location /navigator/ {
auth_request /auth/sessions/whoami;
proxy_pass http://{{ masterip }}:4200/navigator/;
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;
}
{%- if FLEET_NODE %} {%- if FLEET_NODE %}
location /fleet/ { location /fleet/ {
return 301 https://{{ FLEET_IP }}/fleet; return 301 https://{{ FLEET_IP }}/fleet;

View File

@@ -159,8 +159,15 @@ http {
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
} }
location /cyberchef { location /navigator/ {
rewrite ^ /cyberchef/ permanent; auth_request /auth/sessions/whoami;
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 /packages/ { location /packages/ {
@@ -224,19 +231,6 @@ http {
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
} }
location /navigator/ {
auth_request /auth/sessions/whoami;
proxy_pass http://{{ masterip }}:4200/navigator/;
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;
}
{%- if FLEET_NODE %} {%- if FLEET_NODE %}
location /fleet/ { location /fleet/ {
return 301 https://{{ FLEET_IP }}/fleet; return 301 https://{{ FLEET_IP }}/fleet;

View File

@@ -86,7 +86,6 @@ http {
grpc_set_header X-Forwarded-For $proxy_add_x_forwarded_for; grpc_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off; proxy_buffering off;
} }
} }
{% endif %} {% endif %}
@@ -159,8 +158,15 @@ http {
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
} }
location /cyberchef { location /navigator/ {
rewrite ^ /cyberchef/ permanent; auth_request /auth/sessions/whoami;
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 /packages/ { location /packages/ {
@@ -224,19 +230,6 @@ http {
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
} }
location /navigator/ {
auth_request /auth/sessions/whoami;
proxy_pass http://{{ masterip }}:4200/navigator/;
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;
}
{%- if FLEET_NODE %} {%- if FLEET_NODE %}
location /fleet/ { location /fleet/ {
return 301 https://{{ FLEET_IP }}/fleet; return 301 https://{{ FLEET_IP }}/fleet;

View File

@@ -159,8 +159,15 @@ http {
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
} }
location /cyberchef { location /navigator/ {
rewrite ^ /cyberchef/ permanent; auth_request /auth/sessions/whoami;
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 /packages/ { location /packages/ {
@@ -224,19 +231,6 @@ http {
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
} }
location /navigator/ {
auth_request /auth/sessions/whoami;
proxy_pass http://{{ masterip }}:4200/navigator/;
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;
}
{%- if FLEET_NODE %} {%- if FLEET_NODE %}
location /fleet/ { location /fleet/ {
return 301 https://{{ FLEET_IP }}/fleet; return 301 https://{{ FLEET_IP }}/fleet;

View File

@@ -40,6 +40,15 @@ nginxtmp:
- group: 939 - group: 939
- makedirs: True - makedirs: True
navigatorconfig:
file.managed:
- name: /opt/so/conf/navigator/navigator_config.json
- source: salt://nginx/files/navigator_config.json
- user: 939
- group: 939
- makedirs: True
- template: jinja
so-nginx: so-nginx:
docker_container.running: docker_container.running:
- image: {{ MASTER }}:5000/soshybridhunter/so-nginx:{{ VERSION }} - image: {{ MASTER }}:5000/soshybridhunter/so-nginx:{{ VERSION }}
@@ -52,6 +61,9 @@ so-nginx:
- /etc/pki/masterssl.crt:/etc/pki/nginx/server.crt:ro - /etc/pki/masterssl.crt:/etc/pki/nginx/server.crt:ro
- /etc/pki/masterssl.key:/etc/pki/nginx/server.key:ro - /etc/pki/masterssl.key:/etc/pki/nginx/server.key:ro
- /opt/so/conf/fleet/packages:/opt/socore/html/packages - /opt/so/conf/fleet/packages:/opt/socore/html/packages
# ATT&CK Navigator binds
- /opt/so/conf/navigator/navigator_config.json:/opt/socore/html/navigator/assets/config.json:ro
- /opt/so/conf/navigator/nav_layer_playbook.json:/opt/socore/html/navigator/assets/playbook.json:ro
- cap_add: NET_BIND_SERVICE - cap_add: NET_BIND_SERVICE
- port_bindings: - port_bindings:
- 80:80 - 80:80

View File

@@ -2,7 +2,6 @@
{%- set WAZUH = salt['pillar.get']('static:wazuh', '0') -%} {%- set WAZUH = salt['pillar.get']('static:wazuh', '0') -%}
{%- set THEHIVE = salt['pillar.get']('master:thehive', '0') -%} {%- set THEHIVE = salt['pillar.get']('master:thehive', '0') -%}
{%- set PLAYBOOK = salt['pillar.get']('master:playbook', '0') -%} {%- set PLAYBOOK = salt['pillar.get']('master:playbook', '0') -%}
{%- set NAVIGATOR = salt['pillar.get']('master:navigator', '0') -%}
{%- set FREQSERVER = salt['pillar.get']('master:freq', '0') -%} {%- set FREQSERVER = salt['pillar.get']('master:freq', '0') -%}
{%- set DOMAINSTATS = salt['pillar.get']('master:domainstats', '0') -%} {%- set DOMAINSTATS = salt['pillar.get']('master:domainstats', '0') -%}
{%- set FLEETMASTER = salt['pillar.get']('static:fleet_master', False) -%} {%- set FLEETMASTER = salt['pillar.get']('static:fleet_master', False) -%}
@@ -109,9 +108,6 @@ base:
{%- if PLAYBOOK != 0 %} {%- if PLAYBOOK != 0 %}
- playbook - playbook
{%- endif %} {%- endif %}
{%- if NAVIGATOR != 0 %}
- navigator
{%- endif %}
{%- if FREQSERVER != 0 %} {%- if FREQSERVER != 0 %}
- freqserver - freqserver
{%- endif %} {%- endif %}
@@ -159,9 +155,6 @@ base:
{%- if PLAYBOOK != 0 %} {%- if PLAYBOOK != 0 %}
- playbook - playbook
{%- endif %} {%- endif %}
{%- if NAVIGATOR != 0 %}
- navigator
{%- endif %}
{%- if FREQSERVER != 0 %} {%- if FREQSERVER != 0 %}
- freqserver - freqserver
{%- endif %} {%- endif %}
@@ -219,9 +212,6 @@ base:
{%- if PLAYBOOK != 0 %} {%- if PLAYBOOK != 0 %}
- playbook - playbook
{%- endif %} {%- endif %}
{%- if NAVIGATOR != 0 %}
- navigator
{%- endif %}
{%- if FREQSERVER != 0 %} {%- if FREQSERVER != 0 %}
- freqserver - freqserver
{%- endif %} {%- endif %}
@@ -336,9 +326,6 @@ base:
{%- if PLAYBOOK != 0 %} {%- if PLAYBOOK != 0 %}
- playbook - playbook
{%- endif %} {%- endif %}
{%- if NAVIGATOR != 0 %}
- navigator
{%- endif %}
{%- if FREQSERVER != 0 %} {%- if FREQSERVER != 0 %}
- freqserver - freqserver
{%- endif %} {%- endif %}

View File

@@ -50,7 +50,6 @@ MNIC=eth0
# MSEARCH= # MSEARCH=
# MSRV= # MSRV=
# MTU= # MTU=
NAVIGATOR=1
NIDS=Suricata NIDS=Suricata
# NODE_ES_HEAP_SIZE= # NODE_ES_HEAP_SIZE=
# NODE_LS_HEAP_SIZE= # NODE_LS_HEAP_SIZE=

View File

@@ -718,7 +718,6 @@ docker_seed_registry() {
"so-influxdb:$VERSION" \ "so-influxdb:$VERSION" \
"so-kibana:$VERSION" \ "so-kibana:$VERSION" \
"so-mysql:$VERSION" \ "so-mysql:$VERSION" \
"so-navigator:$VERSION" \
"so-playbook:$VERSION" \ "so-playbook:$VERSION" \
"so-soc:$VERSION" \ "so-soc:$VERSION" \
"so-kratos:$VERSION" \ "so-kratos:$VERSION" \
@@ -910,7 +909,6 @@ master_pillar() {
" osquery: $OSQUERY"\ " osquery: $OSQUERY"\
" thehive: $THEHIVE"\ " thehive: $THEHIVE"\
" playbook: $PLAYBOOK"\ " playbook: $PLAYBOOK"\
" navigator: $NAVIGATOR"\
" url_base: $REDIRECTIT"\ " url_base: $REDIRECTIT"\
""\ ""\
"kratos:" >> "$pillar_file" "kratos:" >> "$pillar_file"

View File

@@ -561,11 +561,6 @@ fi
salt-call state.apply -l info playbook >> $setup_log 2>&1 salt-call state.apply -l info playbook >> $setup_log 2>&1
fi fi
if [[ "$NAVIGATOR" = 1 ]]; then
set_progress_str 78 "$(print_salt_state_apply 'navigator')"
salt-call state.apply -l info navigator >> $setup_log 2>&1
fi
if [[ $is_master || $is_helix ]]; then if [[ $is_master || $is_helix ]]; then
set_progress_str 81 "$(print_salt_state_apply 'utility')" set_progress_str 81 "$(print_salt_state_apply 'utility')"
salt-call state.apply -l info utility >> $setup_log 2>&1 salt-call state.apply -l info utility >> $setup_log 2>&1

View File

@@ -343,7 +343,6 @@ whiptail_enable_components() {
WAZUH "Enable Wazuh" ON \ WAZUH "Enable Wazuh" ON \
THEHIVE "Enable TheHive" ON \ THEHIVE "Enable TheHive" ON \
PLAYBOOK "Enable Playbook" ON \ PLAYBOOK "Enable Playbook" ON \
NAVIGATOR "Enable ATT&CK Navigator" ON \
STRELKA "Enable Strelka" ON 3>&1 1>&2 2>&3) STRELKA "Enable Strelka" ON 3>&1 1>&2 2>&3)
local exitstatus=$? local exitstatus=$?
whiptail_check_exitstatus $exitstatus whiptail_check_exitstatus $exitstatus

View File

@@ -51,7 +51,6 @@ if [ $MASTERCHECK != 'so-helix' ]; then
"so-kratos:$BUILD$UPDATEVERSION" \ "so-kratos:$BUILD$UPDATEVERSION" \
"so-logstash:$BUILD$UPDATEVERSION" \ "so-logstash:$BUILD$UPDATEVERSION" \
"so-mysql:$BUILD$UPDATEVERSION" \ "so-mysql:$BUILD$UPDATEVERSION" \
"so-navigator:$BUILD$UPDATEVERSION" \
"so-nginx:$BUILD$UPDATEVERSION" \ "so-nginx:$BUILD$UPDATEVERSION" \
"so-playbook:$BUILD$UPDATEVERSION" \ "so-playbook:$BUILD$UPDATEVERSION" \
"so-redis:$BUILD$UPDATEVERSION" \ "so-redis:$BUILD$UPDATEVERSION" \