mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-16 14:02:52 +01:00
Merge branch 'dev' into feature/issue124
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
{% set VERSION = salt['pillar.get']('static:soversion', '1.1.4') %}
|
||||
{% set MASTER = salt['grains.get']('master') %}
|
||||
{%- set GRAFANA = salt['pillar.get']('master:grafana', '0') %}
|
||||
# Add socore Group
|
||||
socoregroup:
|
||||
@@ -114,16 +116,9 @@ nginxtmp:
|
||||
- group: 939
|
||||
- makedirs: True
|
||||
|
||||
# Start the core docker
|
||||
so-coreimage:
|
||||
cmd.run:
|
||||
- name: docker pull --disable-content-trust=false docker.io/soshybridhunter/so-core:HH1.1.3
|
||||
|
||||
so-core:
|
||||
docker_container.running:
|
||||
- require:
|
||||
- so-coreimage
|
||||
- image: docker.io/soshybridhunter/so-core:HH1.1.3
|
||||
- image: {{ MASTER }}:5000/soshybridhunter/so-core:HH{{ VERSION }}
|
||||
- hostname: so-core
|
||||
- user: socore
|
||||
- binds:
|
||||
@@ -175,15 +170,9 @@ tgrafconf:
|
||||
- template: jinja
|
||||
- source: salt://common/telegraf/etc/telegraf.conf
|
||||
|
||||
so-telegrafimage:
|
||||
cmd.run:
|
||||
- name: docker pull --disable-content-trust=false docker.io/soshybridhunter/so-telegraf:HH1.1.0
|
||||
|
||||
so-telegraf:
|
||||
docker_container.running:
|
||||
- require:
|
||||
- so-telegrafimage
|
||||
- image: docker.io/soshybridhunter/so-telegraf:HH1.1.0
|
||||
- image: {{ MASTER }}:5000/soshybridhunter/so-telegraf:HH{{ VERSION }}
|
||||
- environment:
|
||||
- HOST_PROC=/host/proc
|
||||
- HOST_ETC=/host/etc
|
||||
@@ -214,7 +203,7 @@ so-telegraf:
|
||||
- /opt/so/conf/telegraf/etc/telegraf.conf
|
||||
- /opt/so/conf/telegraf/scripts
|
||||
|
||||
# If its a master or eval lets install the back end for now
|
||||
# If its a master or eval lets install the back end for now
|
||||
{% if grains['role'] == 'so-master' or grains['role'] == 'so-eval' and GRAFANA == 1 %}
|
||||
|
||||
# Influx DB
|
||||
@@ -236,15 +225,9 @@ influxdbconf:
|
||||
- template: jinja
|
||||
- source: salt://common/influxdb/etc/influxdb.conf
|
||||
|
||||
so-influximage:
|
||||
cmd.run:
|
||||
- name: docker pull --disable-content-trust=false docker.io/soshybridhunter/so-influxdb:HH1.1.0
|
||||
|
||||
so-influxdb:
|
||||
docker_container.running:
|
||||
- require:
|
||||
- so-influximage
|
||||
- image: docker.io/soshybridhunter/so-influxdb:HH1.1.0
|
||||
- image: {{ MASTER }}:5000/soshybridhunter/so-influxdb:HH{{ VERSION }}
|
||||
- hostname: influxdb
|
||||
- environment:
|
||||
- INFLUXDB_HTTP_LOG_ENABLED=false
|
||||
@@ -303,7 +286,7 @@ grafanadashfndir:
|
||||
|
||||
grafanadashsndir:
|
||||
file.directory:
|
||||
- name: /opt/so/conf/grafana/grafana_dashboards/storage_nodes
|
||||
- name: /opt/so/conf/grafana/grafana_dashboards/search_nodes
|
||||
- user: 939
|
||||
- group: 939
|
||||
- makedirs: True
|
||||
@@ -362,11 +345,11 @@ dashboard-{{ SN }}:
|
||||
{%- for SN, SNDATA in salt['pillar.get']('nodestab', {}).items() %}
|
||||
dashboard-{{ SN }}:
|
||||
file.managed:
|
||||
- name: /opt/so/conf/grafana/grafana_dashboards/storage_nodes/{{ SN }}-Node.json
|
||||
- name: /opt/so/conf/grafana/grafana_dashboards/search_nodes/{{ SN }}-Node.json
|
||||
- user: 939
|
||||
- group: 939
|
||||
- template: jinja
|
||||
- source: salt://common/grafana/grafana_dashboards/storage_nodes/storage.json
|
||||
- source: salt://common/grafana/grafana_dashboards/search_nodes/searchnode.json
|
||||
- defaults:
|
||||
SERVERNAME: {{ SN }}
|
||||
MANINT: {{ SNDATA.manint }}
|
||||
@@ -400,14 +383,9 @@ dashboard-{{ SN }}:
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
# Install the docker. This needs to be behind nginx at some point
|
||||
so-grafanaimage:
|
||||
cmd.run:
|
||||
- name: docker pull --disable-content-trust=false docker.io/soshybridhunter/so-grafana:HH1.1.0
|
||||
|
||||
so-grafana:
|
||||
docker_container.running:
|
||||
- image: docker.io/soshybridhunter/so-grafana:HH1.1.0
|
||||
- image: {{ MASTER }}:5000/soshybridhunter/so-grafana:HH{{ VERSION }}
|
||||
- hostname: grafana
|
||||
- user: socore
|
||||
- binds:
|
||||
|
||||
@@ -58,9 +58,9 @@ http {
|
||||
# }
|
||||
#}
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name _;
|
||||
return 301 https://$host$request_uri;
|
||||
listen 80 default_server;
|
||||
server_name _;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
|
||||
@@ -88,8 +88,8 @@ http {
|
||||
# }
|
||||
|
||||
location /grafana/ {
|
||||
rewrite /grafana/(.*) /$1 break;
|
||||
proxy_pass http://{{ masterip }}:3000/;
|
||||
rewrite /grafana/(.*) /$1 break;
|
||||
proxy_pass http://{{ masterip }}:3000/;
|
||||
proxy_read_timeout 90;
|
||||
proxy_connect_timeout 90;
|
||||
proxy_set_header Host $host;
|
||||
@@ -100,10 +100,9 @@ http {
|
||||
}
|
||||
|
||||
location /kibana/ {
|
||||
auth_basic "Security Onion";
|
||||
auth_basic_user_file /opt/so/conf/nginx/.htpasswd;
|
||||
rewrite /kibana/(.*) /$1 break;
|
||||
proxy_pass http://{{ masterip }}:5601/;
|
||||
auth_request /so-auth/api/auth/;
|
||||
rewrite /kibana/(.*) /$1 break;
|
||||
proxy_pass http://{{ masterip }}:5601/;
|
||||
proxy_read_timeout 90;
|
||||
proxy_connect_timeout 90;
|
||||
proxy_set_header Host $host;
|
||||
@@ -114,7 +113,7 @@ http {
|
||||
}
|
||||
|
||||
location /playbook/ {
|
||||
proxy_pass http://{{ masterip }}:3200/playbook/;
|
||||
proxy_pass http://{{ masterip }}:3200/playbook/;
|
||||
proxy_read_timeout 90;
|
||||
proxy_connect_timeout 90;
|
||||
proxy_set_header Host $host;
|
||||
@@ -126,9 +125,8 @@ http {
|
||||
|
||||
|
||||
location /navigator/ {
|
||||
auth_basic "Security Onion";
|
||||
auth_basic_user_file /opt/so/conf/nginx/.htpasswd;
|
||||
proxy_pass http://{{ masterip }}:4200/navigator/;
|
||||
auth_request /so-auth/api/auth/;
|
||||
proxy_pass http://{{ masterip }}:4200/navigator/;
|
||||
proxy_read_timeout 90;
|
||||
proxy_connect_timeout 90;
|
||||
proxy_set_header Host $host;
|
||||
@@ -139,7 +137,7 @@ http {
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
proxy_pass https://{{ masterip }}:8080/api/;
|
||||
proxy_pass https://{{ masterip }}:8080/api/;
|
||||
proxy_read_timeout 90;
|
||||
proxy_connect_timeout 90;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
@@ -152,7 +150,7 @@ http {
|
||||
}
|
||||
|
||||
location /fleet/ {
|
||||
proxy_pass https://{{ masterip }}:8080/fleet/;
|
||||
proxy_pass https://{{ masterip }}:8080/fleet/;
|
||||
proxy_read_timeout 90;
|
||||
proxy_connect_timeout 90;
|
||||
proxy_set_header Host $host;
|
||||
@@ -163,10 +161,10 @@ http {
|
||||
}
|
||||
|
||||
location /thehive/ {
|
||||
proxy_pass http://{{ masterip }}:9000/thehive/;
|
||||
proxy_pass http://{{ masterip }}:9000/thehive/;
|
||||
proxy_read_timeout 90;
|
||||
proxy_connect_timeout 90;
|
||||
proxy_http_version 1.1; # this is essential for chunked responses to work
|
||||
proxy_http_version 1.1; # this is essential for chunked responses to work
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
@@ -175,10 +173,10 @@ http {
|
||||
}
|
||||
|
||||
location /cortex/ {
|
||||
proxy_pass http://{{ masterip }}:9001/cortex/;
|
||||
proxy_pass http://{{ masterip }}:9001/cortex/;
|
||||
proxy_read_timeout 90;
|
||||
proxy_connect_timeout 90;
|
||||
proxy_http_version 1.1; # this is essential for chunked responses to work
|
||||
proxy_http_version 1.1; # this is essential for chunked responses to work
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
@@ -186,20 +184,8 @@ http {
|
||||
|
||||
}
|
||||
|
||||
location /cyberchef/ {
|
||||
proxy_pass http://{{ masterip }}:9080/;
|
||||
proxy_read_timeout 90;
|
||||
proxy_connect_timeout 90;
|
||||
proxy_http_version 1.1; # this is essential for chunked responses to work
|
||||
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 "";
|
||||
|
||||
}
|
||||
|
||||
location /soctopus/ {
|
||||
proxy_pass http://{{ masterip }}:7000/;
|
||||
proxy_pass http://{{ masterip }}:7000/;
|
||||
proxy_read_timeout 90;
|
||||
proxy_connect_timeout 90;
|
||||
proxy_set_header Host $host;
|
||||
@@ -210,17 +196,16 @@ http {
|
||||
}
|
||||
|
||||
location /sensoroni/ {
|
||||
auth_basic "Security Onion";
|
||||
auth_basic_user_file /opt/so/conf/nginx/.htpasswd;
|
||||
proxy_pass http://{{ masterip }}:9822/;
|
||||
auth_request /so-auth/api/auth/;
|
||||
proxy_pass http://{{ masterip }}:9822/;
|
||||
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 Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
|
||||
}
|
||||
|
||||
@@ -237,15 +222,34 @@ http {
|
||||
}
|
||||
|
||||
location /sensoroniagents/ {
|
||||
proxy_pass http://{{ masterip }}:9822/;
|
||||
proxy_pass http://{{ masterip }}:9822/;
|
||||
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 "";
|
||||
|
||||
}
|
||||
|
||||
location /so-auth/loginpage/ {
|
||||
proxy_pass http://{{ masterip }}:4242/;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location /so-auth/api/ {
|
||||
proxy_pass http://{{ masterip }}:5656/;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
}
|
||||
|
||||
error_page 401 = @error401;
|
||||
|
||||
location @error401 {
|
||||
add_header Set-Cookie "NSREDIRECT=http://{{ masterip }}$request_uri;Domain={{ masterip }};Path=/";
|
||||
return 302 http://{{ masterip }}/so-auth/loginpage/;
|
||||
}
|
||||
|
||||
error_page 404 /404.html;
|
||||
location = /40x.html {
|
||||
}
|
||||
|
||||
@@ -188,18 +188,6 @@ http {
|
||||
|
||||
}
|
||||
|
||||
location /cyberchef/ {
|
||||
proxy_pass http://{{ masterip }}:9080/;
|
||||
proxy_read_timeout 90;
|
||||
proxy_connect_timeout 90;
|
||||
proxy_http_version 1.1; # this is essential for chunked responses to work
|
||||
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 "";
|
||||
|
||||
}
|
||||
|
||||
location /soctopus/ {
|
||||
proxy_pass http://{{ masterip }}:7000/;
|
||||
proxy_read_timeout 90;
|
||||
|
||||
@@ -1,41 +1,82 @@
|
||||
#!/bin/bash
|
||||
got_root() {
|
||||
#
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Make sure you are root
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "This script must be run using sudo!"
|
||||
exit 1
|
||||
fi
|
||||
. /usr/sbin/so-common
|
||||
|
||||
}
|
||||
SKIP=0
|
||||
|
||||
got_root
|
||||
while getopts "abowi:" OPTION
|
||||
do
|
||||
case $OPTION in
|
||||
|
||||
echo "This program allows you to add a firewall rule to allow connections from a new IP address."
|
||||
echo ""
|
||||
echo "Choose the role for the IP or Range you would like to add"
|
||||
echo ""
|
||||
echo "[a] - Analyst - ports 80/tcp and 443/tcp"
|
||||
echo "[b] - Logstash Beat - port 5044/tcp"
|
||||
echo "[o] - Osquery endpoint - port 8080/tcp"
|
||||
echo "[w] - Wazuh endpoint - port 1514"
|
||||
echo ""
|
||||
echo "Please enter your selection (a - analyst, b - beats, o - osquery, w - wazuh):"
|
||||
read ROLE
|
||||
echo "Enter a single ip address or range to allow (example: 10.10.10.10 or 10.10.0.0/16):"
|
||||
read IP
|
||||
h)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
a)
|
||||
FULLROLE="analyst"
|
||||
SKIP=1
|
||||
;;
|
||||
b)
|
||||
FULLROLE="beats_endpoint"
|
||||
SKIP=1
|
||||
;;
|
||||
i) IP=$OPTARG
|
||||
;;
|
||||
o)
|
||||
FULLROLE="osquery_endpoint"
|
||||
SKIP=1
|
||||
;;
|
||||
w)
|
||||
FULLROLE="wazuh_endpoint"
|
||||
SKIP=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$SKIP" -eq 0 ]; then
|
||||
|
||||
echo "This program allows you to add a firewall rule to allow connections from a new IP address."
|
||||
echo ""
|
||||
echo "Choose the role for the IP or Range you would like to add"
|
||||
echo ""
|
||||
echo "[a] - Analyst - ports 80/tcp and 443/tcp"
|
||||
echo "[b] - Logstash Beat - port 5044/tcp"
|
||||
echo "[o] - Osquery endpoint - port 8080/tcp"
|
||||
echo "[w] - Wazuh endpoint - port 1514"
|
||||
echo ""
|
||||
echo "Please enter your selection (a - analyst, b - beats, o - osquery, w - wazuh):"
|
||||
read ROLE
|
||||
echo "Enter a single ip address or range to allow (example: 10.10.10.10 or 10.10.0.0/16):"
|
||||
read IP
|
||||
|
||||
if [ "$ROLE" == "a" ]; then
|
||||
FULLROLE=analyst
|
||||
elif [ "$ROLE" == "b" ]; then
|
||||
FULLROLE=beats_endpoint
|
||||
elif [ "$ROLE" == "o" ]; then
|
||||
FULLROLE=osquery_endpoint
|
||||
elif [ "$ROLE" == "w" ]; then
|
||||
FULLROLE=wazuh_endpoint
|
||||
else
|
||||
echo "I don't recognize that role"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$ROLE" == "a" ]; then
|
||||
FULLROLE=analyst
|
||||
elif [ "$ROLE" == "b" ]; then
|
||||
FULLROLE=beats_endpoint
|
||||
elif [ "$ROLE" == "o" ]; then
|
||||
FULLROLE=osquery_endpoint
|
||||
elif [ "$ROLE" == "w" ]; then
|
||||
FULLROLE=wazuh_endpoint
|
||||
else
|
||||
echo "I don't recognize that role"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Adding $IP to the $FULLROLE role. This can take a few seconds"
|
||||
|
||||
1000
salt/common/tools/sbin/so-elastalert-create
Normal file
1000
salt/common/tools/sbin/so-elastalert-create
Normal file
File diff suppressed because it is too large
Load Diff
142
salt/common/tools/sbin/so-elastalert-test
Normal file
142
salt/common/tools/sbin/so-elastalert-test
Normal file
@@ -0,0 +1,142 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Originally written by Bryant Treacle
|
||||
# https://raw.githubusercontent.com/bryant-treacle/so-elastalert-test-rule/master/so-elastalert-test
|
||||
# Modified by Doug Burks and Wes Lambert
|
||||
#
|
||||
# Purpose: This script will allow you to test your elastalert rule without entering the Docker container.
|
||||
|
||||
. /usr/sbin/so-elastic-common
|
||||
|
||||
OPTIONS=""
|
||||
SKIP=0
|
||||
RESULTS_TO_LOG="n"
|
||||
RULE_NAME=""
|
||||
FILE_SAVE_LOCATION=""
|
||||
|
||||
usage()
|
||||
{
|
||||
cat <<EOF
|
||||
|
||||
Test Elastalert Rule
|
||||
Options:
|
||||
-h This message
|
||||
-a Trigger real alerts instead of the debug alert
|
||||
-l <path_to_file> Write results to specified log file
|
||||
-o '<options>' Specify Elastalert options ( Ex. --schema-only , --count-only, --days N )
|
||||
-r <rule_name> Specify path/name of rule to test
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
while getopts "hal:o:r:" OPTION
|
||||
do
|
||||
case $OPTION in
|
||||
h)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
a)
|
||||
OPTIONS="--alert"
|
||||
;;
|
||||
l)
|
||||
RESULTS_TO_LOG="y"
|
||||
FILE_SAVE_LOCATION=$OPTARG
|
||||
;;
|
||||
|
||||
o)
|
||||
OPTIONS=$OPTARG
|
||||
;;
|
||||
|
||||
r)
|
||||
RULE_NAME=$OPTARG
|
||||
SKIP=1
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
docker_exec(){
|
||||
if [ ${RESULTS_TO_LOG,,} = "y" ] ; then
|
||||
docker exec -it so-elastalert bash -c "elastalert-test-rule $RULE_NAME $OPTIONS" > $FILE_SAVE_LOCATION
|
||||
else
|
||||
docker exec -it so-elastalert bash -c "elastalert-test-rule $RULE_NAME $OPTIONS"
|
||||
fi
|
||||
}
|
||||
|
||||
rule_prompt(){
|
||||
CURRENT_RULES=$(find /opt/so/rules/elastalert -name "*.yaml")
|
||||
echo
|
||||
echo "This script will allow you to test an Elastalert rule."
|
||||
echo
|
||||
echo "Below is a list of active Elastalert rules:"
|
||||
echo
|
||||
echo "-----------------------------------"
|
||||
echo
|
||||
echo "$CURRENT_RULES"
|
||||
echo
|
||||
echo "-----------------------------------"
|
||||
echo
|
||||
echo "Note: To test a rule it must be accessible by the Elastalert Docker container."
|
||||
echo
|
||||
echo "Make sure to swap the local path (/opt/so/rules/elastalert/) for the docker path (/etc/elastalert/rules/)"
|
||||
echo "Example: /opt/so/rules/elastalert/nids2hive.yaml would be /etc/elastalert/rules/nids2hive.yaml"
|
||||
echo
|
||||
while [ -z $RULE_NAME ]; do
|
||||
echo "Please enter the file path and rule name you want to test."
|
||||
read -e RULE_NAME
|
||||
done
|
||||
}
|
||||
|
||||
log_save_prompt(){
|
||||
RESULTS_TO_LOG=""
|
||||
while [ -z $RESULTS_TO_LOG ]; do
|
||||
echo "The results can be rather long. Would you like to write the results to a file? (Y/N)"
|
||||
read RESULTS_TO_LOG
|
||||
done
|
||||
}
|
||||
|
||||
log_path_prompt(){
|
||||
while [ -z $FILE_SAVE_LOCATION ]; do
|
||||
echo "Please enter the file path and file name."
|
||||
read -e FILE_SAVE_LOCATION
|
||||
done
|
||||
echo "Depending on the rule this may take a while."
|
||||
}
|
||||
|
||||
if [ $SKIP -eq 0 ]; then
|
||||
rule_prompt
|
||||
log_save_prompt
|
||||
if [ ${RESULTS_TO_LOG,,} = "y" ] ; then
|
||||
log_path_prompt
|
||||
fi
|
||||
fi
|
||||
|
||||
docker_exec
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Test completed successfully!"
|
||||
else
|
||||
echo "Something went wrong..."
|
||||
fi
|
||||
|
||||
echo
|
||||
|
||||
|
||||
|
||||
33
salt/common/tools/sbin/so-elastic-diagnose
Normal file
33
salt/common/tools/sbin/so-elastic-diagnose
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Source common settings
|
||||
. /usr/sbin/so-common
|
||||
|
||||
# Check for log files
|
||||
for FILE in /opt/so/log/elasticsearch/*.log /opt/so/log/logstash/*.log /opt/so/log/kibana/*.log /opt/so/log/elastalert/*.log /opt/so/log/curator/*.log /opt/so/log/freqserver/*.log /opt/so/log/nginx/*.log; do
|
||||
|
||||
# If file exists, then look for errors or warnings
|
||||
if [ -f $FILE ]; then
|
||||
MESSAGE=`grep -i 'ERROR\|FAIL\|WARN' $FILE`
|
||||
if [ ! -z "$MESSAGE" ]; then
|
||||
header $FILE
|
||||
echo $MESSAGE | sed 's/WARN/\nWARN/g' | sed 's/WARNING/\nWARNING/g' | sed 's/ERROR/\nERROR/g' | sort | uniq -c | sort -nr
|
||||
echo
|
||||
fi
|
||||
fi
|
||||
done
|
||||
46
salt/common/tools/sbin/so-elastic-download
Normal file
46
salt/common/tools/sbin/so-elastic-download
Normal file
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
MASTER=MASTER
|
||||
VERSION="HH1.1.4"
|
||||
TRUSTED_CONTAINERS=( \
|
||||
"so-auth-api:$VERSION" \
|
||||
"so-auth-ui:$VERSION" \
|
||||
"so-core:$VERSION" \
|
||||
"so-thehive-cortex:$VERSION" \
|
||||
"so-curator:$VERSION" \
|
||||
"so-domainstats:$VERSION" \
|
||||
"so-elastalert:$VERSION" \
|
||||
"so-elasticsearch:$VERSION" \
|
||||
"so-filebeat:$VERSION" \
|
||||
"so-fleet:$VERSION" \
|
||||
"so-fleet-launcher:$VERSION" \
|
||||
"so-freqserver:$VERSION" \
|
||||
"so-grafana:$VERSION" \
|
||||
"so-idstools:$VERSION" \
|
||||
"so-influxdb:$VERSION" \
|
||||
"so-kibana:$VERSION" \
|
||||
"so-logstash:$VERSION" \
|
||||
"so-mysql:$VERSION" \
|
||||
"so-navigator:$VERSION" \
|
||||
"so-playbook:$VERSION" \
|
||||
"so-redis:$VERSION" \
|
||||
"so-sensoroni:$VERSION" \
|
||||
"so-soctopus:$VERSION" \
|
||||
"so-steno:$VERSION" \
|
||||
#"so-strelka:$VERSION" \
|
||||
"so-suricata:$VERSION" \
|
||||
"so-telegraf:$VERSION" \
|
||||
"so-thehive:$VERSION" \
|
||||
"so-thehive-es:$VERSION" \
|
||||
"so-wazuh:$VERSION" \
|
||||
"so-zeek:$VERSION" )
|
||||
|
||||
for i in "${TRUSTED_CONTAINERS[@]}"
|
||||
do
|
||||
# Pull down the trusted docker image
|
||||
echo "Downloading $i"
|
||||
docker pull --disable-content-trust=false docker.io/soshybridhunter/$i
|
||||
# Tag it with the new registry destination
|
||||
docker tag soshybridhunter/$i $MASTER:5000/soshybridhunter/$i
|
||||
docker push $MASTER:5000/soshybridhunter/$i
|
||||
docker rmi soshybridhunter/$i
|
||||
done
|
||||
28
salt/common/tools/sbin/so-tcpreplay
Executable file
28
salt/common/tools/sbin/so-tcpreplay
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
REPLAY_ENABLED=$(docker images | grep so-tcpreplay)
|
||||
REPLAY_RUNNING=$(docker ps | grep so-tcpreplay)
|
||||
|
||||
if [ "$REPLAY_ENABLED" != "" ] && [ "$REPLAY_RUNNING" != "" ]; then
|
||||
docker cp so-tcpreplay:/opt/samples /opt/samples
|
||||
docker exec -it so-tcpreplay /usr/bin/tcpreplay -i bond0 -M10 $1
|
||||
else
|
||||
echo "Replay functionality not enabled! To enable, run `so-tcpreplay-start`"
|
||||
echo
|
||||
echo "Note that you will need internet access to download the appropiriate components"
|
||||
fi
|
||||
21
salt/common/tools/sbin/so-tcpreplay-restart
Executable file
21
salt/common/tools/sbin/so-tcpreplay-restart
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
. /usr/sbin/so-common
|
||||
|
||||
/usr/sbin/so-restart tcreplay $1
|
||||
|
||||
20
salt/common/tools/sbin/so-tcpreplay-start
Executable file
20
salt/common/tools/sbin/so-tcpreplay-start
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
. /usr/sbin/so-common
|
||||
|
||||
/usr/sbin/so-start tcpreplay $1
|
||||
21
salt/common/tools/sbin/so-tcpreplay-stop
Executable file
21
salt/common/tools/sbin/so-tcpreplay-stop
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
. /usr/sbin/so-common
|
||||
|
||||
/usr/sbin/so-stop tcpreplay $1
|
||||
|
||||
Reference in New Issue
Block a user