Merge pull request #1185 from Security-Onion-Solutions/issue/1049

Issue/1049
This commit is contained in:
Josh Patterson
2020-08-14 14:55:14 -04:00
committed by GitHub
11 changed files with 30 additions and 4 deletions

View File

@@ -5,8 +5,6 @@
'so-soc', 'so-soc',
'so-kratos', 'so-kratos',
'so-elasticsearch', 'so-elasticsearch',
'so-kibana', 'so-kibana'
'so-suricata',
'so-zeek'
] ]
} %} } %}

View File

@@ -506,6 +506,7 @@ role:
portgroups: portgroups:
- {{ portgroups.beats_5044 }} - {{ portgroups.beats_5044 }}
- {{ portgroups.beats_5644 }} - {{ portgroups.beats_5644 }}
- {{ portgroups.sensoroni }}
search_node: search_node:
portgroups: portgroups:
- {{ portgroups.redis }} - {{ portgroups.redis }}

View File

@@ -18,6 +18,7 @@
{% set INTERFACE = salt['pillar.get']('sensor:interface', 'bond0') %} {% set INTERFACE = salt['pillar.get']('sensor:interface', 'bond0') %}
{% set BPF_STENO = salt['pillar.get']('steno:bpf', None) %} {% set BPF_STENO = salt['pillar.get']('steno:bpf', None) %}
{% set BPF_COMPILED = "" %} {% set BPF_COMPILED = "" %}
{% from "pcap/map.jinja" import START with context %}
# PCAP Section # PCAP Section
@@ -131,6 +132,7 @@ sensoronilog:
so-steno: so-steno:
docker_container.running: docker_container.running:
- image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-steno:{{ VERSION }} - image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-steno:{{ VERSION }}
- start: {{ START }}
- network_mode: host - network_mode: host
- privileged: True - privileged: True
- port_bindings: - port_bindings:

6
salt/pcap/map.jinja Normal file
View File

@@ -0,0 +1,6 @@
# don't start the docker container if it is an import node
{% if grains.id.split('_')|last == 'import' %}
{% set START = False %}
{% else %}
{% set START = True %}
{% endif %}

View File

@@ -23,6 +23,7 @@
{# import_yaml 'suricata/files/defaults2.yaml' as suricata #} {# import_yaml 'suricata/files/defaults2.yaml' as suricata #}
{% from 'suricata/suricata_config.map.jinja' import suricata_defaults as suricata_config with context %} {% from 'suricata/suricata_config.map.jinja' import suricata_defaults as suricata_config with context %}
{% from "suricata/map.jinja" import START with context %}
# Suricata # Suricata
@@ -134,6 +135,7 @@ suribpf:
so-suricata: so-suricata:
docker_container.running: docker_container.running:
- image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-suricata:{{ VERSION }} - image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-suricata:{{ VERSION }}
- start: {{ START }}
- privileged: True - privileged: True
- environment: - environment:
- INTERFACE={{ interface }} - INTERFACE={{ interface }}

6
salt/suricata/map.jinja Normal file
View File

@@ -0,0 +1,6 @@
# don't start the docker container if it is an import node
{% if grains.id.split('_')|last == 'import' %}
{% set START = False %}
{% else %}
{% set START = True %}
{% endif %}

View File

@@ -399,6 +399,7 @@ base:
- firewall - firewall
- idstools - idstools
- suricata.manager - suricata.manager
- pcap
- elasticsearch - elasticsearch
- kibana - kibana
- filebeat - filebeat

View File

@@ -1,3 +1,5 @@
{% from "zeek/map.jinja" import START with context %}
{% set VERSION = salt['pillar.get']('global:soversion', 'HH1.2.2') %} {% set VERSION = salt['pillar.get']('global:soversion', 'HH1.2.2') %}
{% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %} {% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %}
{% set MANAGER = salt['grains.get']('master') %} {% set MANAGER = salt['grains.get']('master') %}
@@ -167,6 +169,7 @@ localzeeksync:
so-zeek: so-zeek:
docker_container.running: docker_container.running:
- image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-zeek:{{ VERSION }} - image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-zeek:{{ VERSION }}
- start: {{ START }}
- privileged: True - privileged: True
- binds: - binds:
- /nsm/zeek/logs:/nsm/zeek/logs:rw - /nsm/zeek/logs:/nsm/zeek/logs:rw

6
salt/zeek/map.jinja Normal file
View File

@@ -0,0 +1,6 @@
# don't start the docker container if it is an import node
{% if grains.id.split('_')|last == 'import' %}
{% set START = False %}
{% else %}
{% set START = True %}
{% endif %}

View File

@@ -804,6 +804,7 @@ docker_seed_registry() {
"so-filebeat:$VERSION" \ "so-filebeat:$VERSION" \
"so-suricata:$VERSION" \ "so-suricata:$VERSION" \
"so-soc:$VERSION" \ "so-soc:$VERSION" \
"so-steno:$VERSION" \
"so-elasticsearch:$VERSION" \ "so-elasticsearch:$VERSION" \
"so-kibana:$VERSION" \ "so-kibana:$VERSION" \
"so-kratos:$VERSION" \ "so-kratos:$VERSION" \

View File

@@ -577,7 +577,7 @@ fi
salt-call state.apply -l info elasticsearch >> $setup_log 2>&1 salt-call state.apply -l info elasticsearch >> $setup_log 2>&1
fi fi
if [[ $is_sensor ]]; then if [[ $is_sensor || $is_import ]]; then
set_progress_str 65 "$(print_salt_state_apply 'pcap')" set_progress_str 65 "$(print_salt_state_apply 'pcap')"
salt-call state.apply -l info pcap >> $setup_log 2>&1 salt-call state.apply -l info pcap >> $setup_log 2>&1
fi fi