mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Merge pull request #3199 from Security-Onion-Solutions/dev
2.3.30 Release
This commit is contained in:
2
.github/workflows/leaktest.yml
vendored
2
.github/workflows/leaktest.yml
vendored
@@ -1,6 +1,6 @@
|
|||||||
name: leak-test
|
name: leak-test
|
||||||
|
|
||||||
on: [push,pull_request]
|
on: [pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## Security Onion 2.3.21
|
## Security Onion 2.3.30
|
||||||
|
|
||||||
Security Onion 2.3.21 is here!
|
Security Onion 2.3.30 is here!
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
### 2.3.21 ISO image built on 2020/12/21
|
### 2.3.30 ISO image built on 2021/03/01
|
||||||
|
|
||||||
### Download and Verify
|
### Download and Verify
|
||||||
|
|
||||||
2.3.21 ISO image:
|
2.3.30 ISO image:
|
||||||
https://download.securityonion.net/file/securityonion/securityonion-2.3.21.iso
|
https://download.securityonion.net/file/securityonion/securityonion-2.3.30.iso
|
||||||
|
|
||||||
MD5: 7B8BC5B241B7220C011215BCE852FF78
|
MD5: 7716A56E0F46FA29422B07B30235417B
|
||||||
SHA1: 541C9689D8F8E8D3F25E169ED34A3F683851975B
|
SHA1: D01C26E4391C80FF690384C1DB77550EA4C1E239
|
||||||
SHA256: 7647FD67BA6AC85CCB1308789FFF7DAB19A841621FDA9AE41B89A0A79618F068
|
SHA256: 3BB0CE7F3F84A0D26B00EAF30F7AEB42A3B5C7E9D8E3BA7E160577B1FA3830F6
|
||||||
|
|
||||||
Signature for ISO image:
|
Signature for ISO image:
|
||||||
https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.21.iso.sig
|
https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.30.iso.sig
|
||||||
|
|
||||||
Signing key:
|
Signing key:
|
||||||
https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/master/KEYS
|
https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/master/KEYS
|
||||||
@@ -24,22 +24,22 @@ wget https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/ma
|
|||||||
|
|
||||||
Download the signature file for the ISO:
|
Download the signature file for the ISO:
|
||||||
```
|
```
|
||||||
wget https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.21.iso.sig
|
wget https://github.com/Security-Onion-Solutions/securityonion/raw/master/sigs/securityonion-2.3.30.iso.sig
|
||||||
```
|
```
|
||||||
|
|
||||||
Download the ISO image:
|
Download the ISO image:
|
||||||
```
|
```
|
||||||
wget https://download.securityonion.net/file/securityonion/securityonion-2.3.21.iso
|
wget https://download.securityonion.net/file/securityonion/securityonion-2.3.30.iso
|
||||||
```
|
```
|
||||||
|
|
||||||
Verify the downloaded ISO image using the signature file:
|
Verify the downloaded ISO image using the signature file:
|
||||||
```
|
```
|
||||||
gpg --verify securityonion-2.3.21.iso.sig securityonion-2.3.21.iso
|
gpg --verify securityonion-2.3.30.iso.sig securityonion-2.3.30.iso
|
||||||
```
|
```
|
||||||
|
|
||||||
The output should show "Good signature" and the Primary key fingerprint should match what's shown below:
|
The output should show "Good signature" and the Primary key fingerprint should match what's shown below:
|
||||||
```
|
```
|
||||||
gpg: Signature made Mon 21 Dec 2020 06:27:53 PM EST using RSA key ID FE507013
|
gpg: Signature made Mon 01 Mar 2021 10:23:05 AM EST using RSA key ID FE507013
|
||||||
gpg: Good signature from "Security Onion Solutions, LLC <info@securityonionsolutions.com>"
|
gpg: Good signature from "Security Onion Solutions, LLC <info@securityonionsolutions.com>"
|
||||||
gpg: WARNING: This key is not certified with a trusted signature!
|
gpg: WARNING: This key is not certified with a trusted signature!
|
||||||
gpg: There is no indication that the signature belongs to the owner.
|
gpg: There is no indication that the signature belongs to the owner.
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
# user: socore
|
# user: socore
|
||||||
|
|
||||||
log_file: /opt/so/log/salt/master
|
log_file: /opt/so/log/salt/master
|
||||||
|
log_level_logfile: info
|
||||||
|
log_level: info
|
||||||
|
|
||||||
##### File Server settings #####
|
##### File Server settings #####
|
||||||
##########################################
|
##########################################
|
||||||
|
|||||||
@@ -9,3 +9,5 @@ logrotate:
|
|||||||
extension .log
|
extension .log
|
||||||
dateext
|
dateext
|
||||||
dateyesterday
|
dateyesterday
|
||||||
|
group_conf: |
|
||||||
|
su root socore
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
|
{% if sls in allowed_states %}
|
||||||
|
|
||||||
{% set MANAGER = salt['grains.get']('master') %}
|
{% set MANAGER = salt['grains.get']('master') %}
|
||||||
airgapyum:
|
airgapyum:
|
||||||
file.managed:
|
file.managed:
|
||||||
@@ -58,3 +61,11 @@ agssrepo:
|
|||||||
agwazrepo:
|
agwazrepo:
|
||||||
file.absent:
|
file.absent:
|
||||||
- name: /etc/yum.repos.d/wazuh.repo
|
- name: /etc/yum.repos.d/wazuh.repo
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
{{sls}}_state_not_allowed:
|
||||||
|
test.fail_without_changes:
|
||||||
|
- name: {{sls}}_state_not_allowed
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
299
salt/allowed_states.map.jinja
Normal file
299
salt/allowed_states.map.jinja
Normal file
@@ -0,0 +1,299 @@
|
|||||||
|
{% set ZEEKVER = salt['pillar.get']('global:mdengine', '') %}
|
||||||
|
{% set WAZUH = salt['pillar.get']('global:wazuh', '0') %}
|
||||||
|
{% set THEHIVE = salt['pillar.get']('manager:thehive', '0') %}
|
||||||
|
{% set PLAYBOOK = salt['pillar.get']('manager:playbook', '0') %}
|
||||||
|
{% set FREQSERVER = salt['pillar.get']('manager:freq', '0') %}
|
||||||
|
{% set DOMAINSTATS = salt['pillar.get']('manager:domainstats', '0') %}
|
||||||
|
{% set FLEETMANAGER = salt['pillar.get']('global:fleet_manager', False) %}
|
||||||
|
{% set FLEETNODE = salt['pillar.get']('global:fleet_node', False) %}
|
||||||
|
{% set ELASTALERT = salt['pillar.get']('elastalert:enabled', True) %}
|
||||||
|
{% set ELASTICSEARCH = salt['pillar.get']('elasticsearch:enabled', True) %}
|
||||||
|
{% set FILEBEAT = salt['pillar.get']('filebeat:enabled', True) %}
|
||||||
|
{% set KIBANA = salt['pillar.get']('kibana:enabled', True) %}
|
||||||
|
{% set LOGSTASH = salt['pillar.get']('logstash:enabled', True) %}
|
||||||
|
{% set CURATOR = salt['pillar.get']('curator:enabled', True) %}
|
||||||
|
{% set REDIS = salt['pillar.get']('redis:enabled', True) %}
|
||||||
|
{% set STRELKA = salt['pillar.get']('strelka:enabled', '0') %}
|
||||||
|
{% set ISAIRGAP = salt['pillar.get']('global:airgap', False) %}
|
||||||
|
{% import_yaml 'salt/minion.defaults.yaml' as saltversion %}
|
||||||
|
{% set saltversion = saltversion.salt.minion.version %}
|
||||||
|
|
||||||
|
{# this is the list we are returning from this map file, it gets built below #}
|
||||||
|
{% set allowed_states= [] %}
|
||||||
|
|
||||||
|
{% if grains.saltversion | string == saltversion | string %}
|
||||||
|
|
||||||
|
{% set allowed_states= salt['grains.filter_by']({
|
||||||
|
'so-eval': [
|
||||||
|
'salt.master',
|
||||||
|
'ca',
|
||||||
|
'ssl',
|
||||||
|
'registry',
|
||||||
|
'manager',
|
||||||
|
'nginx',
|
||||||
|
'telegraf',
|
||||||
|
'influxdb',
|
||||||
|
'grafana',
|
||||||
|
'soc',
|
||||||
|
'firewall',
|
||||||
|
'idstools',
|
||||||
|
'suricata.manager',
|
||||||
|
'healthcheck',
|
||||||
|
'pcap',
|
||||||
|
'suricata',
|
||||||
|
'utility',
|
||||||
|
'schedule',
|
||||||
|
'soctopus',
|
||||||
|
'tcpreplay',
|
||||||
|
'docker_clean'
|
||||||
|
],
|
||||||
|
'so-heavynode': [
|
||||||
|
'ca',
|
||||||
|
'ssl',
|
||||||
|
'nginx',
|
||||||
|
'telegraf',
|
||||||
|
'firewall',
|
||||||
|
'pcap',
|
||||||
|
'suricata',
|
||||||
|
'healthcheck',
|
||||||
|
'schedule',
|
||||||
|
'tcpreplay',
|
||||||
|
'docker_clean'
|
||||||
|
],
|
||||||
|
'so-helixsensor': [
|
||||||
|
'salt.master',
|
||||||
|
'ca',
|
||||||
|
'ssl',
|
||||||
|
'registry',
|
||||||
|
'telegraf',
|
||||||
|
'firewall',
|
||||||
|
'idstools',
|
||||||
|
'suricata.manager',
|
||||||
|
'zeek',
|
||||||
|
'redis',
|
||||||
|
'elasticsearch',
|
||||||
|
'logstash',
|
||||||
|
'schedule',
|
||||||
|
'tcpreplay',
|
||||||
|
'docker_clean'
|
||||||
|
],
|
||||||
|
'so-fleet': [
|
||||||
|
'ca',
|
||||||
|
'ssl',
|
||||||
|
'nginx',
|
||||||
|
'telegraf',
|
||||||
|
'firewall',
|
||||||
|
'mysql',
|
||||||
|
'redis',
|
||||||
|
'fleet',
|
||||||
|
'fleet.install_package',
|
||||||
|
'filebeat',
|
||||||
|
'schedule',
|
||||||
|
'docker_clean'
|
||||||
|
],
|
||||||
|
'so-import': [
|
||||||
|
'salt.master',
|
||||||
|
'ca',
|
||||||
|
'ssl',
|
||||||
|
'registry',
|
||||||
|
'manager',
|
||||||
|
'nginx',
|
||||||
|
'soc',
|
||||||
|
'firewall',
|
||||||
|
'idstools',
|
||||||
|
'suricata.manager',
|
||||||
|
'pcap',
|
||||||
|
'utility',
|
||||||
|
'suricata',
|
||||||
|
'zeek',
|
||||||
|
'schedule',
|
||||||
|
'tcpreplay',
|
||||||
|
'docker_clean'
|
||||||
|
],
|
||||||
|
'so-manager': [
|
||||||
|
'salt.master',
|
||||||
|
'ca',
|
||||||
|
'ssl',
|
||||||
|
'registry',
|
||||||
|
'manager',
|
||||||
|
'nginx',
|
||||||
|
'telegraf',
|
||||||
|
'influxdb',
|
||||||
|
'grafana',
|
||||||
|
'soc',
|
||||||
|
'firewall',
|
||||||
|
'idstools',
|
||||||
|
'suricata.manager',
|
||||||
|
'utility',
|
||||||
|
'schedule',
|
||||||
|
'soctopus',
|
||||||
|
'docker_clean'
|
||||||
|
],
|
||||||
|
'so-managersearch': [
|
||||||
|
'salt.master',
|
||||||
|
'ca',
|
||||||
|
'ssl',
|
||||||
|
'registry',
|
||||||
|
'nginx',
|
||||||
|
'telegraf',
|
||||||
|
'influxdb',
|
||||||
|
'grafana',
|
||||||
|
'soc',
|
||||||
|
'firewall',
|
||||||
|
'manager',
|
||||||
|
'idstools',
|
||||||
|
'suricata.manager',
|
||||||
|
'utility',
|
||||||
|
'schedule',
|
||||||
|
'soctopus',
|
||||||
|
'docker_clean'
|
||||||
|
],
|
||||||
|
'so-node': [
|
||||||
|
'ca',
|
||||||
|
'ssl',
|
||||||
|
'nginx',
|
||||||
|
'telegraf',
|
||||||
|
'firewall',
|
||||||
|
'schedule',
|
||||||
|
'docker_clean'
|
||||||
|
],
|
||||||
|
'so-standalone': [
|
||||||
|
'salt.master',
|
||||||
|
'ca',
|
||||||
|
'ssl',
|
||||||
|
'registry',
|
||||||
|
'manager',
|
||||||
|
'nginx',
|
||||||
|
'telegraf',
|
||||||
|
'influxdb',
|
||||||
|
'grafana',
|
||||||
|
'soc',
|
||||||
|
'firewall',
|
||||||
|
'idstools',
|
||||||
|
'suricata.manager',
|
||||||
|
'pcap',
|
||||||
|
'suricata',
|
||||||
|
'healthcheck',
|
||||||
|
'utility',
|
||||||
|
'schedule',
|
||||||
|
'soctopus',
|
||||||
|
'tcpreplay',
|
||||||
|
'docker_clean'
|
||||||
|
],
|
||||||
|
'so-sensor': [
|
||||||
|
'ca',
|
||||||
|
'ssl',
|
||||||
|
'telegraf',
|
||||||
|
'firewall',
|
||||||
|
'nginx',
|
||||||
|
'pcap',
|
||||||
|
'suricata',
|
||||||
|
'healthcheck',
|
||||||
|
'wazuh',
|
||||||
|
'filebeat',
|
||||||
|
'schedule',
|
||||||
|
'tcpreplay',
|
||||||
|
'docker_clean'
|
||||||
|
],
|
||||||
|
}, grain='role') %}
|
||||||
|
|
||||||
|
{% if FILEBEAT and grains.role in ['so-helixsensor', 'so-eval', 'so-manager', 'so-standalone', 'so-node', 'so-managersearch', 'so-heavynode', 'so-import'] %}
|
||||||
|
{% do allowed_states.append('filebeat') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if ((FLEETMANAGER or FLEETNODE) or PLAYBOOK != 0) and grains.role in ['so-eval', 'so-manager', 'so-managersearch', 'so-standalone'] %}
|
||||||
|
{% do allowed_states.append('mysql') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if (FLEETMANAGER or FLEETNODE) and grains.role in ['so-sensor', 'so-eval', 'so-manager', 'so-standalone', 'so-node', 'so-managersearch', 'so-heavynode'] %}
|
||||||
|
{% do allowed_states.append('fleet.install_package') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if (FLEETMANAGER or FLEETNODE) and grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-managersearch', 'so-heavynode'] %}
|
||||||
|
{% do allowed_states.append('fleet') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if (FLEETMANAGER or FLEETNODE) and grains.role in ['so-eval'] %}
|
||||||
|
{% do allowed_states.append('redis') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{%- if ZEEKVER != 'SURICATA' and grains.role in ['so-sensor', 'so-eval', 'so-standalone', 'so-heavynode'] %}
|
||||||
|
{% do allowed_states.append('zeek') %}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{% if STRELKA and grains.role in ['so-sensor', 'so-eval', 'so-standalone', 'so-heavynode'] %}
|
||||||
|
{% do allowed_states.append('strelka') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if WAZUH and grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-node', 'so-managersearch', 'so-heavynode']%}
|
||||||
|
{% do allowed_states.append('wazuh') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if ELASTICSEARCH and grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-node', 'so-managersearch', 'so-heavynode', 'so-import'] %}
|
||||||
|
{% do allowed_states.append('elasticsearch') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if KIBANA and grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-managersearch', 'so-import'] %}
|
||||||
|
{% do allowed_states.append('kibana') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if CURATOR and grains.role in ['so-eval', 'so-standalone', 'so-node', 'so-managersearch', 'so-heavynode'] %}
|
||||||
|
{% do allowed_states.append('curator') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if ELASTALERT and grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-managersearch'] %}
|
||||||
|
{% do allowed_states.append('elastalert') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if (THEHIVE != 0) and grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-managersearch'] %}
|
||||||
|
{% do allowed_states.append('thehive') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if (PLAYBOOK !=0) and grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-managersearch'] %}
|
||||||
|
{% do allowed_states.append('playbook') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if (PLAYBOOK !=0) and grains.role in ['so-eval'] %}
|
||||||
|
{% do allowed_states.append('redis') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if (FREQSERVER !=0) and grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-managersearch'] %}
|
||||||
|
{% do allowed_states.append('freqserver') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if (DOMAINSTATS !=0) and grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-managersearch'] %}
|
||||||
|
{% do allowed_states.append('domainstats') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if LOGSTASH and grains.role in ['so-helixsensor', 'so-manager', 'so-standalone', 'so-node', 'so-managersearch', 'so-heavynode'] %}
|
||||||
|
{% do allowed_states.append('logstash') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if REDIS and grains.role in ['so-manager', 'so-standalone', 'so-managersearch', 'so-heavynode'] %}
|
||||||
|
{% do allowed_states.append('redis') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if grains.os == 'CentOS' %}
|
||||||
|
{% if not ISAIRGAP %}
|
||||||
|
{% do allowed_states.append('yum') %}
|
||||||
|
{% endif %}
|
||||||
|
{% do allowed_states.append('yum.packages') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{# all nodes on the right salt version can run the following states #}
|
||||||
|
{% do allowed_states.append('common') %}
|
||||||
|
{% do allowed_states.append('patch.os.schedule') %}
|
||||||
|
{% do allowed_states.append('motd') %}
|
||||||
|
{% do allowed_states.append('salt.minion-check') %}
|
||||||
|
{% do allowed_states.append('sensoroni') %}
|
||||||
|
{% do allowed_states.append('salt.lasthighstate') %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
{% if ISAIRGAP %}
|
||||||
|
{% do allowed_states.append('airgap') %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{# all nodes can always run salt.minion state #}
|
||||||
|
{% do allowed_states.append('salt.minion') %}
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
{% set show_top = salt['state.show_top']() %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% set top_states = show_top.values() | join(', ') %}
|
{% if sls in allowed_states %}
|
||||||
|
|
||||||
{% if 'ca' in top_states %}
|
|
||||||
|
|
||||||
{% set manager = salt['grains.get']('master') %}
|
{% set manager = salt['grains.get']('master') %}
|
||||||
/etc/salt/minion.d/signing_policies.conf:
|
/etc/salt/minion.d/signing_policies.conf:
|
||||||
@@ -44,6 +42,9 @@ pki_private_key:
|
|||||||
- replace: False
|
- replace: False
|
||||||
- require:
|
- require:
|
||||||
- file: /etc/pki
|
- file: /etc/pki
|
||||||
|
- timeout: 30
|
||||||
|
- retry: 5
|
||||||
|
- interval: 30
|
||||||
|
|
||||||
x509_pem_entries:
|
x509_pem_entries:
|
||||||
module.run:
|
module.run:
|
||||||
@@ -60,8 +61,8 @@ cakeyperms:
|
|||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
ca_state_not_allowed:
|
{{sls}}_state_not_allowed:
|
||||||
test.fail_without_changes:
|
test.fail_without_changes:
|
||||||
- name: ca_state_not_allowed
|
- name: {{sls}}_state_not_allowed
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
logrotate -f /opt/so/conf/log-rotate.conf >/dev/null 2>&1
|
/usr/sbin/logrotate -f /opt/so/conf/log-rotate.conf > /dev/null 2>&1
|
||||||
|
|||||||
1
salt/common/files/99-reserved-ports.conf
Normal file
1
salt/common/files/99-reserved-ports.conf
Normal file
@@ -0,0 +1 @@
|
|||||||
|
net.ipv4.ip_local_reserved_ports="55000,57314"
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
{%- set logrotate_conf = salt['pillar.get']('logrotate:conf') %}
|
{%- set logrotate_conf = salt['pillar.get']('logrotate:conf') %}
|
||||||
|
{%- set group_conf = salt['pillar.get']('logrotate:group_conf') %}
|
||||||
|
|
||||||
|
|
||||||
/opt/so/log/aptcacher-ng/*.log
|
/opt/so/log/aptcacher-ng/*.log
|
||||||
/opt/so/log/idstools/*.log
|
/opt/so/log/idstools/*.log
|
||||||
@@ -13,12 +15,21 @@
|
|||||||
/opt/so/log/fleet/*.log
|
/opt/so/log/fleet/*.log
|
||||||
/opt/so/log/suricata/*.log
|
/opt/so/log/suricata/*.log
|
||||||
/opt/so/log/mysql/*.log
|
/opt/so/log/mysql/*.log
|
||||||
/opt/so/log/playbook/*.log
|
|
||||||
/opt/so/log/logstash/*.log
|
|
||||||
/opt/so/log/filebeat/*.log
|
|
||||||
/opt/so/log/telegraf/*.log
|
/opt/so/log/telegraf/*.log
|
||||||
/opt/so/log/redis/*.log
|
/opt/so/log/redis/*.log
|
||||||
|
/opt/so/log/sensoroni/*.log
|
||||||
|
/opt/so/log/stenographer/*.log
|
||||||
/opt/so/log/salt/so-salt-minion-check
|
/opt/so/log/salt/so-salt-minion-check
|
||||||
|
/opt/so/log/salt/minion
|
||||||
|
/opt/so/log/salt/master
|
||||||
{
|
{
|
||||||
{{ logrotate_conf | indent(width=4) }}
|
{{ logrotate_conf | indent(width=4) }}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Playbook's log directory needs additional configuration
|
||||||
|
# because Playbook requires a more permissive directory
|
||||||
|
/opt/so/log/playbook/*.log
|
||||||
|
{
|
||||||
|
{{ logrotate_conf | indent(width=4) }}
|
||||||
|
{{ group_conf | indent(width=4) }}
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,5 +6,17 @@
|
|||||||
nocompress
|
nocompress
|
||||||
create
|
create
|
||||||
sharedscripts
|
sharedscripts
|
||||||
endscript
|
}
|
||||||
|
|
||||||
|
/nsm/strelka/log/strelka.log
|
||||||
|
{
|
||||||
|
daily
|
||||||
|
rotate 14
|
||||||
|
missingok
|
||||||
|
copytruncate
|
||||||
|
compress
|
||||||
|
create
|
||||||
|
extension .log
|
||||||
|
dateext
|
||||||
|
dateyesterday
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
{% set show_top = salt['state.show_top']() %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% set top_states = show_top.values() | join(', ') %}
|
{% if sls in allowed_states %}
|
||||||
|
|
||||||
{% if 'common' in top_states %}
|
|
||||||
|
|
||||||
{% set role = grains.id.split('_') | last %}
|
{% set role = grains.id.split('_') | last %}
|
||||||
|
|
||||||
@@ -233,6 +231,15 @@ commonlogrotateconf:
|
|||||||
- dayweek: '*'
|
- dayweek: '*'
|
||||||
|
|
||||||
{% if role in ['eval', 'manager', 'managersearch', 'standalone'] %}
|
{% if role in ['eval', 'manager', 'managersearch', 'standalone'] %}
|
||||||
|
# Lock permissions on the backup directory
|
||||||
|
backupdir:
|
||||||
|
file.directory:
|
||||||
|
- name: /nsm/backup
|
||||||
|
- user: 0
|
||||||
|
- group: 0
|
||||||
|
- makedirs: True
|
||||||
|
- mode: 700
|
||||||
|
|
||||||
# Add config backup
|
# Add config backup
|
||||||
/usr/sbin/so-config-backup > /dev/null 2>&1:
|
/usr/sbin/so-config-backup > /dev/null 2>&1:
|
||||||
cron.present:
|
cron.present:
|
||||||
@@ -258,10 +265,34 @@ docker:
|
|||||||
- watch:
|
- watch:
|
||||||
- file: docker_daemon
|
- file: docker_daemon
|
||||||
|
|
||||||
{% else %}
|
# Reserve OS ports for Docker proxy in case boot settings are not already applied/present
|
||||||
|
dockerapplyports:
|
||||||
|
cmd.run:
|
||||||
|
- name: if [ ! -s /etc/sysctl.d/99-reserved-ports.conf ]; then sysctl -w net.ipv4.ip_local_reserved_ports="55000,57314"; fi
|
||||||
|
|
||||||
common_state_not_allowed:
|
# Reserve OS ports for Docker proxy
|
||||||
test.fail_without_changes:
|
dockerreserveports:
|
||||||
- name: common_state_not_allowed
|
file.managed:
|
||||||
|
- source: salt://common/files/99-reserved-ports.conf
|
||||||
|
- name: /etc/sysctl.d/99-reserved-ports.conf
|
||||||
|
|
||||||
|
{% if salt['grains.get']('sosmodel', '') %}
|
||||||
|
# Install raid check cron
|
||||||
|
/usr/sbin/so-raid-status > /dev/null 2>&1:
|
||||||
|
cron.present:
|
||||||
|
- user: root
|
||||||
|
- minute: '*/15'
|
||||||
|
- hour: '*'
|
||||||
|
- daymonth: '*'
|
||||||
|
- month: '*'
|
||||||
|
- dayweek: '*'
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
{{sls}}_state_not_allowed:
|
||||||
|
test.fail_without_changes:
|
||||||
|
- name: {{sls}}_state_not_allowed
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -24,9 +24,142 @@ fi
|
|||||||
# Define a banner to separate sections
|
# Define a banner to separate sections
|
||||||
banner="========================================================================="
|
banner="========================================================================="
|
||||||
|
|
||||||
|
add_interface_bond0() {
|
||||||
|
local BNIC=$1
|
||||||
|
if [[ -z $MTU ]]; then
|
||||||
|
local MTU
|
||||||
|
MTU=$(lookup_pillar "mtu" "sensor")
|
||||||
|
fi
|
||||||
|
local nic_error=0
|
||||||
|
|
||||||
|
# Check if specific offload features are able to be disabled
|
||||||
|
for string in "generic-segmentation-offload" "generic-receive-offload" "tcp-segmentation-offload"; do
|
||||||
|
if ethtool -k "$BNIC" | grep $string | grep -q "on [fixed]"; then
|
||||||
|
echo "The hardware or driver for interface ${BNIC} is not supported, packet capture may not work as expected."
|
||||||
|
((nic_error++))
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
case "$2" in
|
||||||
|
-v|--verbose)
|
||||||
|
local verbose=true
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
for i in rx tx sg tso ufo gso gro lro; do
|
||||||
|
if [[ $verbose == true ]]; then
|
||||||
|
ethtool -K "$BNIC" $i off
|
||||||
|
else
|
||||||
|
ethtool -K "$BNIC" $i off &>/dev/null
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
# Check if the bond slave connection has already been created
|
||||||
|
nmcli -f name,uuid -p con | grep -q "bond0-slave-$BNIC"
|
||||||
|
local found_int=$?
|
||||||
|
|
||||||
|
if [[ $found_int != 0 ]]; then
|
||||||
|
# Create the slave interface and assign it to the bond
|
||||||
|
nmcli con add type ethernet ifname "$BNIC" con-name "bond0-slave-$BNIC" master bond0 -- \
|
||||||
|
ethernet.mtu "$MTU" \
|
||||||
|
connection.autoconnect "yes"
|
||||||
|
else
|
||||||
|
local int_uuid
|
||||||
|
int_uuid=$(nmcli -f name,uuid -p con | sed -n "s/bond0-slave-$BNIC //p" | tr -d ' ')
|
||||||
|
|
||||||
|
nmcli con mod "$int_uuid" \
|
||||||
|
ethernet.mtu "$MTU" \
|
||||||
|
connection.autoconnect "yes"
|
||||||
|
fi
|
||||||
|
|
||||||
|
ip link set dev "$BNIC" arp off multicast off allmulticast off promisc on
|
||||||
|
|
||||||
|
# Bring the slave interface up
|
||||||
|
if [[ $verbose == true ]]; then
|
||||||
|
nmcli con up "bond0-slave-$BNIC"
|
||||||
|
else
|
||||||
|
nmcli con up "bond0-slave-$BNIC" &>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$nic_error" != 0 ]; then
|
||||||
|
return "$nic_error"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_container() {
|
||||||
|
docker ps | grep "$1:" > /dev/null 2>&1
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
check_password() {
|
||||||
|
local password=$1
|
||||||
|
echo "$password" | egrep -v "'|\"|\\$|\\\\" > /dev/null 2>&1
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
fail() {
|
||||||
|
msg=$1
|
||||||
|
echo "ERROR: $msg"
|
||||||
|
echo "Exiting."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
get_random_value() {
|
||||||
|
length=${1:-20}
|
||||||
|
head -c 5000 /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w $length | head -n 1
|
||||||
|
}
|
||||||
|
|
||||||
header() {
|
header() {
|
||||||
echo
|
printf '%s\n' "" "$banner" " $*" "$banner"
|
||||||
printf '%s\n' "$banner" "$*" "$banner"
|
}
|
||||||
|
|
||||||
|
init_monitor() {
|
||||||
|
MONITORNIC=$1
|
||||||
|
|
||||||
|
if [[ $MONITORNIC == "bond0" ]]; then
|
||||||
|
BIFACES=$(lookup_bond_interfaces)
|
||||||
|
else
|
||||||
|
BIFACES=$MONITORNIC
|
||||||
|
fi
|
||||||
|
|
||||||
|
for DEVICE_IFACE in $BIFACES; do
|
||||||
|
for i in rx tx sg tso ufo gso gro lro; do
|
||||||
|
ethtool -K "$DEVICE_IFACE" "$i" off;
|
||||||
|
done
|
||||||
|
ip link set dev "$DEVICE_IFACE" arp off multicast off allmulticast off promisc on
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
is_manager_node() {
|
||||||
|
# Check to see if this is a manager node
|
||||||
|
role=$(lookup_role)
|
||||||
|
is_single_node_grid && return 0
|
||||||
|
[ $role == 'manager' ] && return 0
|
||||||
|
[ $role == 'managersearch' ] && return 0
|
||||||
|
[ $role == 'helix' ] && return 0
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
is_sensor_node() {
|
||||||
|
# Check to see if this is a sensor (forward) node
|
||||||
|
role=$(lookup_role)
|
||||||
|
is_single_node_grid && return 0
|
||||||
|
[ $role == 'sensor' ] && return 0
|
||||||
|
[ $role == 'heavynode' ] && return 0
|
||||||
|
[ $role == 'helix' ] && return 0
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
is_single_node_grid() {
|
||||||
|
role=$(lookup_role)
|
||||||
|
[ $role == 'eval' ] && return 0
|
||||||
|
[ $role == 'standalone' ] && return 0
|
||||||
|
[ $role == 'import' ] && return 0
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
lookup_bond_interfaces() {
|
||||||
|
cat /proc/net/bonding/bond0 | grep "Slave Interface:" | sed -e "s/Slave Interface: //g"
|
||||||
}
|
}
|
||||||
|
|
||||||
lookup_salt_value() {
|
lookup_salt_value() {
|
||||||
@@ -68,15 +201,41 @@ lookup_role() {
|
|||||||
echo ${pieces[1]}
|
echo ${pieces[1]}
|
||||||
}
|
}
|
||||||
|
|
||||||
check_container() {
|
require_manager() {
|
||||||
docker ps | grep "$1:" > /dev/null 2>&1
|
if is_manager_node; then
|
||||||
return $?
|
echo "This is a manager, We can proceed."
|
||||||
|
else
|
||||||
|
echo "Please run this command on the manager; the manager controls the grid."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
check_password() {
|
retry() {
|
||||||
local password=$1
|
maxAttempts=$1
|
||||||
echo "$password" | egrep -v "'|\"|\\$|\\\\" > /dev/null 2>&1
|
sleepDelay=$2
|
||||||
return $?
|
cmd=$3
|
||||||
|
expectedOutput=$4
|
||||||
|
attempt=0
|
||||||
|
while [[ $attempt -lt $maxAttempts ]]; do
|
||||||
|
attempt=$((attempt+1))
|
||||||
|
echo "Executing command with retry support: $cmd"
|
||||||
|
output=$(eval "$cmd")
|
||||||
|
exitcode=$?
|
||||||
|
echo "Results: $output ($exitcode)"
|
||||||
|
if [ -n "$expectedOutput" ]; then
|
||||||
|
if [[ "$output" =~ "$expectedOutput" ]]; then
|
||||||
|
return $exitCode
|
||||||
|
else
|
||||||
|
echo "Expected '$expectedOutput' but got '$output'"
|
||||||
|
fi
|
||||||
|
elif [[ $exitcode -eq 0 ]]; then
|
||||||
|
return $exitCode
|
||||||
|
fi
|
||||||
|
echo "Command failed with exit code $exitcode; will retry in $sleepDelay seconds ($attempt / $maxAttempts)..."
|
||||||
|
sleep $sleepDelay
|
||||||
|
done
|
||||||
|
echo "Command continues to fail; giving up."
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
set_os() {
|
set_os() {
|
||||||
@@ -110,33 +269,118 @@ set_version() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
require_manager() {
|
valid_cidr() {
|
||||||
# Check to see if this is a manager
|
# Verify there is a backslash in the string
|
||||||
MANAGERCHECK=$(cat /etc/salt/grains | grep role | awk '{print $2}')
|
echo "$1" | grep -qP "^[^/]+/[^/]+$" || return 1
|
||||||
if [ $MANAGERCHECK == 'so-eval' ] || [ $MANAGERCHECK == 'so-manager' ] || [ $MANAGERCHECK == 'so-managersearch' ] || [ $MANAGERCHECK == 'so-standalone' ] || [ $MANAGERCHECK == 'so-helix' ] || [ $MANAGERCHECK == 'so-import' ]; then
|
|
||||||
echo "This is a manager, We can proceed."
|
|
||||||
else
|
|
||||||
echo "Please run this command on the manager; the manager controls the grid."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
is_single_node_grid() {
|
local cidr
|
||||||
role=$(lookup_role)
|
local ip
|
||||||
if [ "$role" != "eval" ] && [ "$role" != "standalone" ] && [ "$role" != "import" ]; then
|
|
||||||
|
cidr=$(echo "$1" | sed 's/.*\///')
|
||||||
|
ip=$(echo "$1" | sed 's/\/.*//' )
|
||||||
|
|
||||||
|
if valid_ip4 "$ip"; then
|
||||||
|
[[ $cidr =~ ([0-9]|[1-2][0-9]|3[0-2]) ]] && return 0 || return 1
|
||||||
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
valid_cidr_list() {
|
||||||
|
local all_valid=0
|
||||||
|
|
||||||
|
IFS="," read -r -a net_arr <<< "$1"
|
||||||
|
|
||||||
|
for net in "${net_arr[@]}"; do
|
||||||
|
valid_cidr "$net" || all_valid=1
|
||||||
|
done
|
||||||
|
|
||||||
|
return $all_valid
|
||||||
|
}
|
||||||
|
|
||||||
|
valid_dns_list() {
|
||||||
|
local all_valid=0
|
||||||
|
|
||||||
|
IFS="," read -r -a dns_arr <<< "$1"
|
||||||
|
|
||||||
|
for addr in "${dns_arr[@]}"; do
|
||||||
|
valid_ip4 "$addr" || all_valid=1
|
||||||
|
done
|
||||||
|
|
||||||
|
return $all_valid
|
||||||
|
}
|
||||||
|
|
||||||
|
valid_fqdn() {
|
||||||
|
local fqdn=$1
|
||||||
|
|
||||||
|
echo "$fqdn" | grep -qP '(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{0,62}[a-zA-Z0-9]\.)+[a-zA-Z]{2,63}$)' \
|
||||||
|
&& return 0 \
|
||||||
|
|| return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
valid_hostname() {
|
||||||
|
local hostname=$1
|
||||||
|
|
||||||
|
[[ $hostname =~ ^[a-zA-Z0-9\-]+$ ]] && [[ $hostname != 'localhost' ]] && return 0 || return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
valid_ip4() {
|
||||||
|
local ip=$1
|
||||||
|
|
||||||
|
echo "$ip" | grep -qP '^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$' && return 0 || return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
valid_int() {
|
||||||
|
local num=$1
|
||||||
|
local min=${2:-1}
|
||||||
|
local max=${3:-1000000000}
|
||||||
|
|
||||||
|
[[ $num =~ ^[0-9]*$ ]] && [[ $num -ge $min ]] && [[ $num -le $max ]] && return 0 || return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# {% raw %}
|
||||||
|
|
||||||
|
valid_string() {
|
||||||
|
local str=$1
|
||||||
|
local min_length=${2:-1}
|
||||||
|
local max_length=${3:-64}
|
||||||
|
|
||||||
|
echo "$str" | grep -qP '^\S+$' && [[ ${#str} -ge $min_length ]] && [[ ${#str} -le $max_length ]] && return 0 || return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# {% endraw %}
|
||||||
|
|
||||||
|
valid_username() {
|
||||||
|
local user=$1
|
||||||
|
|
||||||
|
echo "$user" | grep -qP '^[a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}\$)$' && return 0 || return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
wait_for_web_response() {
|
||||||
|
url=$1
|
||||||
|
expected=$2
|
||||||
|
maxAttempts=${3:-300}
|
||||||
|
logfile=/root/wait_for_web_response.log
|
||||||
|
attempt=0
|
||||||
|
while [[ $attempt -lt $maxAttempts ]]; do
|
||||||
|
attempt=$((attempt+1))
|
||||||
|
echo "Waiting for value '$expected' at '$url' ($attempt/$maxAttempts)"
|
||||||
|
result=$(curl -ks -L $url)
|
||||||
|
exitcode=$?
|
||||||
|
|
||||||
|
echo "--------------------------------------------------" >> $logfile
|
||||||
|
echo "$(date) - Checking web URL: $url ($attempt/$maxAttempts)" >> $logfile
|
||||||
|
echo "$result" >> $logfile
|
||||||
|
echo "exit code=$exitcode" >> $logfile
|
||||||
|
echo "" >> $logfile
|
||||||
|
|
||||||
|
if [[ $exitcode -eq 0 && "$result" =~ $expected ]]; then
|
||||||
|
echo "Received expected response; proceeding."
|
||||||
return 0
|
return 0
|
||||||
}
|
fi
|
||||||
|
echo "Server is not ready"
|
||||||
fail() {
|
sleep 1
|
||||||
msg=$1
|
done
|
||||||
echo "ERROR: $msg"
|
echo "Server still not ready after $maxAttempts attempts; giving up."
|
||||||
echo "Exiting."
|
return 1
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
get_random_value() {
|
|
||||||
length=${1:-20}
|
|
||||||
head -c 5000 /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w $length | head -n 1
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -33,12 +33,15 @@ if [ ! -f $BACKUPFILE ]; then
|
|||||||
{%- for LOCATION in BACKUPLOCATIONS %}
|
{%- for LOCATION in BACKUPLOCATIONS %}
|
||||||
tar -rf $BACKUPFILE {{ LOCATION }}
|
tar -rf $BACKUPFILE {{ LOCATION }}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
tar -rf $BACKUPFILE /etc/pki
|
||||||
|
tar -rf $BACKUPFILE /etc/salt
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Find oldest backup file and remove it
|
# Find oldest backup files and remove them
|
||||||
NUMBACKUPS=$(find /nsm/backup/ -type f -name "so-config-backup*" | wc -l)
|
NUMBACKUPS=$(find /nsm/backup/ -type f -name "so-config-backup*" | wc -l)
|
||||||
OLDESTBACKUP=$(find /nsm/backup/ -type f -name "so-config-backup*" | ls -1t | tail -1)
|
while [ "$NUMBACKUPS" -gt "$MAXBACKUPS" ]; do
|
||||||
if [ "$NUMBACKUPS" -gt "$MAXBACKUPS" ]; then
|
OLDESTBACKUP=$(find /nsm/backup/ -type f -name "so-config-backup*" -type f -printf '%T+ %p\n' | sort | head -n 1 | awk -F" " '{print $2}')
|
||||||
rm -f /nsm/backup/$OLDESTBACKUP
|
rm -f $OLDESTBACKUP
|
||||||
fi
|
NUMBACKUPS=$(find /nsm/backup/ -type f -name "so-config-backup*" | wc -l)
|
||||||
|
done
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ rule_prompt(){
|
|||||||
echo "-----------------------------------"
|
echo "-----------------------------------"
|
||||||
echo
|
echo
|
||||||
while [ -z "$RULE_NAME" ]; do
|
while [ -z "$RULE_NAME" ]; do
|
||||||
read -p "Please enter the rule filename you want to test (filename only, no path): " -e RULE_NAME
|
read -p "Choose a rule to test from the list above (must be typed exactly as shown above): " -e RULE_NAME
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,27 +15,38 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import time
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
lockFile = "/tmp/so-firewall.lock"
|
||||||
hostgroupsFilename = "/opt/so/saltstack/local/salt/firewall/hostgroups.local.yaml"
|
hostgroupsFilename = "/opt/so/saltstack/local/salt/firewall/hostgroups.local.yaml"
|
||||||
portgroupsFilename = "/opt/so/saltstack/local/salt/firewall/portgroups.local.yaml"
|
portgroupsFilename = "/opt/so/saltstack/local/salt/firewall/portgroups.local.yaml"
|
||||||
|
defaultPortgroupsFilename = "/opt/so/saltstack/default/salt/firewall/portgroups.yaml"
|
||||||
supportedProtocols = ['tcp', 'udp']
|
supportedProtocols = ['tcp', 'udp']
|
||||||
|
|
||||||
def showUsage(args):
|
def showUsage(options, args):
|
||||||
print('Usage: {} [OPTIONS] <COMMAND> [ARGS...]'.format(sys.argv[0]))
|
print('Usage: {} [OPTIONS] <COMMAND> [ARGS...]'.format(sys.argv[0]))
|
||||||
print(' Options:')
|
print(' Options:')
|
||||||
print(' --apply - After updating the firewall configuration files, apply the new firewall state')
|
print(' --apply - After updating the firewall configuration files, apply the new firewall state')
|
||||||
|
print(' --defaultports - Read port groups from default configuration files instead of local configuration.')
|
||||||
print('')
|
print('')
|
||||||
print(' Available commands:')
|
print(' General commands:')
|
||||||
print(' help - Prints this usage information.')
|
print(' help - Prints this usage information.')
|
||||||
|
print('')
|
||||||
|
print(' Host commands:')
|
||||||
|
print(' listhostgroups - Lists the known host groups.')
|
||||||
print(' includedhosts - Lists the IPs included in the given group. Args: <GROUP_NAME>')
|
print(' includedhosts - Lists the IPs included in the given group. Args: <GROUP_NAME>')
|
||||||
print(' excludedhosts - Lists the IPs excluded from the given group. Args: <GROUP_NAME>')
|
print(' excludedhosts - Lists the IPs excluded from the given group. Args: <GROUP_NAME>')
|
||||||
print(' includehost - Includes the given IP in the given group. Args: <GROUP_NAME> <IP>')
|
print(' includehost - Includes the given IP in the given group. Args: <GROUP_NAME> <IP>')
|
||||||
print(' excludehost - Excludes the given IP from the given group. Args: <GROUP_NAME> <IP>')
|
print(' excludehost - Excludes the given IP from the given group. Args: <GROUP_NAME> <IP>')
|
||||||
print(' removehost - Removes an excluded IP from the given group. Args: <GROUP_NAME> <IP>')
|
print(' removehost - Removes an excluded IP from the given group. Args: <GROUP_NAME> <IP>')
|
||||||
print(' addhostgroup - Adds a new, custom host group. Args: <GROUP_NAME>')
|
print(' addhostgroup - Adds a new, custom host group. Args: <GROUP_NAME>')
|
||||||
|
print('')
|
||||||
|
print(' Port commands:')
|
||||||
|
print(' listportgroups - Lists the known port groups.')
|
||||||
print(' listports - Lists ports in the given group and protocol. Args: <GROUP_NAME> <PORT_PROTOCOL>')
|
print(' listports - Lists ports in the given group and protocol. Args: <GROUP_NAME> <PORT_PROTOCOL>')
|
||||||
print(' addport - Adds a PORT to the given group. Args: <GROUP_NAME> <PORT_PROTOCOL> <PORT>')
|
print(' addport - Adds a PORT to the given group. Args: <GROUP_NAME> <PORT_PROTOCOL> <PORT>')
|
||||||
print(' removeport - Removes a PORT from the given group. Args: <GROUP_NAME> <PORT_PROTOCOL> <PORT>')
|
print(' removeport - Removes a PORT from the given group. Args: <GROUP_NAME> <PORT_PROTOCOL> <PORT>')
|
||||||
@@ -48,6 +59,15 @@ def showUsage(args):
|
|||||||
print(' PORT - Either a single numeric port (Ex: 443), or a port range (Ex: 8000:8002).')
|
print(' PORT - Either a single numeric port (Ex: 443), or a port range (Ex: 8000:8002).')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
def checkDefaultPortsOption(options):
|
||||||
|
global portgroupsFilename
|
||||||
|
if "--defaultports" in options:
|
||||||
|
portgroupsFilename = defaultPortgroupsFilename
|
||||||
|
|
||||||
|
def checkApplyOption(options):
|
||||||
|
if "--apply" in options:
|
||||||
|
return apply()
|
||||||
|
|
||||||
def loadYaml(filename):
|
def loadYaml(filename):
|
||||||
file = open(filename, "r")
|
file = open(filename, "r")
|
||||||
return yaml.load(file.read())
|
return yaml.load(file.read())
|
||||||
@@ -56,6 +76,14 @@ def writeYaml(filename, content):
|
|||||||
file = open(filename, "w")
|
file = open(filename, "w")
|
||||||
return yaml.dump(content, file)
|
return yaml.dump(content, file)
|
||||||
|
|
||||||
|
def listHostGroups():
|
||||||
|
content = loadYaml(hostgroupsFilename)
|
||||||
|
hostgroups = content['firewall']['hostgroups']
|
||||||
|
if hostgroups is not None:
|
||||||
|
for group in hostgroups:
|
||||||
|
print(group)
|
||||||
|
return 0
|
||||||
|
|
||||||
def listIps(name, mode):
|
def listIps(name, mode):
|
||||||
content = loadYaml(hostgroupsFilename)
|
content = loadYaml(hostgroupsFilename)
|
||||||
if name not in content['firewall']['hostgroups']:
|
if name not in content['firewall']['hostgroups']:
|
||||||
@@ -111,10 +139,18 @@ def createProtocolMap():
|
|||||||
map[protocol] = []
|
map[protocol] = []
|
||||||
return map
|
return map
|
||||||
|
|
||||||
def addhostgroup(args):
|
def listPortGroups():
|
||||||
|
content = loadYaml(portgroupsFilename)
|
||||||
|
portgroups = content['firewall']['aliases']['ports']
|
||||||
|
if portgroups is not None:
|
||||||
|
for group in portgroups:
|
||||||
|
print(group)
|
||||||
|
return 0
|
||||||
|
|
||||||
|
def addhostgroup(options, args):
|
||||||
if len(args) != 1:
|
if len(args) != 1:
|
||||||
print('Missing host group name argument', file=sys.stderr)
|
print('Missing host group name argument', file=sys.stderr)
|
||||||
showUsage(args)
|
showUsage(options, args)
|
||||||
|
|
||||||
name = args[0]
|
name = args[0]
|
||||||
content = loadYaml(hostgroupsFilename)
|
content = loadYaml(hostgroupsFilename)
|
||||||
@@ -125,10 +161,17 @@ def addhostgroup(args):
|
|||||||
writeYaml(hostgroupsFilename, content)
|
writeYaml(hostgroupsFilename, content)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def addportgroup(args):
|
def listportgroups(options, args):
|
||||||
|
if len(args) != 0:
|
||||||
|
print('Unexpected arguments', file=sys.stderr)
|
||||||
|
showUsage(options, args)
|
||||||
|
checkDefaultPortsOption(options)
|
||||||
|
return listPortGroups()
|
||||||
|
|
||||||
|
def addportgroup(options, args):
|
||||||
if len(args) != 1:
|
if len(args) != 1:
|
||||||
print('Missing port group name argument', file=sys.stderr)
|
print('Missing port group name argument', file=sys.stderr)
|
||||||
showUsage(args)
|
showUsage(options, args)
|
||||||
|
|
||||||
name = args[0]
|
name = args[0]
|
||||||
content = loadYaml(portgroupsFilename)
|
content = loadYaml(portgroupsFilename)
|
||||||
@@ -143,11 +186,12 @@ def addportgroup(args):
|
|||||||
writeYaml(portgroupsFilename, content)
|
writeYaml(portgroupsFilename, content)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def listports(args):
|
def listports(options, args):
|
||||||
if len(args) != 2:
|
if len(args) != 2:
|
||||||
print('Missing port group name or port protocol', file=sys.stderr)
|
print('Missing port group name or port protocol', file=sys.stderr)
|
||||||
showUsage(args)
|
showUsage(options, args)
|
||||||
|
|
||||||
|
checkDefaultPortsOption(options)
|
||||||
name = args[0]
|
name = args[0]
|
||||||
protocol = args[1]
|
protocol = args[1]
|
||||||
if protocol not in supportedProtocols:
|
if protocol not in supportedProtocols:
|
||||||
@@ -162,16 +206,19 @@ def listports(args):
|
|||||||
if name not in ports:
|
if name not in ports:
|
||||||
print('Port group does not exist', file=sys.stderr)
|
print('Port group does not exist', file=sys.stderr)
|
||||||
return 3
|
return 3
|
||||||
|
if protocol not in ports[name]:
|
||||||
|
print('Port group does not contain protocol', file=sys.stderr)
|
||||||
|
return 3
|
||||||
ports = ports[name][protocol]
|
ports = ports[name][protocol]
|
||||||
if ports is not None:
|
if ports is not None:
|
||||||
for port in ports:
|
for port in ports:
|
||||||
print(port)
|
print(port)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def addport(args):
|
def addport(options, args):
|
||||||
if len(args) != 3:
|
if len(args) != 3:
|
||||||
print('Missing port group name or port protocol, or port argument', file=sys.stderr)
|
print('Missing port group name or port protocol, or port argument', file=sys.stderr)
|
||||||
showUsage(args)
|
showUsage(options, args)
|
||||||
|
|
||||||
name = args[0]
|
name = args[0]
|
||||||
protocol = args[1]
|
protocol = args[1]
|
||||||
@@ -197,12 +244,13 @@ def addport(args):
|
|||||||
return 3
|
return 3
|
||||||
ports.append(port)
|
ports.append(port)
|
||||||
writeYaml(portgroupsFilename, content)
|
writeYaml(portgroupsFilename, content)
|
||||||
return 0
|
code = checkApplyOption(options)
|
||||||
|
return code
|
||||||
|
|
||||||
def removeport(args):
|
def removeport(options, args):
|
||||||
if len(args) != 3:
|
if len(args) != 3:
|
||||||
print('Missing port group name or port protocol, or port argument', file=sys.stderr)
|
print('Missing port group name or port protocol, or port argument', file=sys.stderr)
|
||||||
showUsage(args)
|
showUsage(options, args)
|
||||||
|
|
||||||
name = args[0]
|
name = args[0]
|
||||||
protocol = args[1]
|
protocol = args[1]
|
||||||
@@ -225,43 +273,60 @@ def removeport(args):
|
|||||||
return 3
|
return 3
|
||||||
ports.remove(port)
|
ports.remove(port)
|
||||||
writeYaml(portgroupsFilename, content)
|
writeYaml(portgroupsFilename, content)
|
||||||
return 0
|
code = checkApplyOption(options)
|
||||||
|
return code
|
||||||
|
|
||||||
def includedhosts(args):
|
|
||||||
|
def listhostgroups(options, args):
|
||||||
|
if len(args) != 0:
|
||||||
|
print('Unexpected arguments', file=sys.stderr)
|
||||||
|
showUsage(options, args)
|
||||||
|
return listHostGroups()
|
||||||
|
|
||||||
|
def includedhosts(options, args):
|
||||||
if len(args) != 1:
|
if len(args) != 1:
|
||||||
print('Missing host group name argument', file=sys.stderr)
|
print('Missing host group name argument', file=sys.stderr)
|
||||||
showUsage(args)
|
showUsage(options, args)
|
||||||
return listIps(args[0], 'insert')
|
return listIps(args[0], 'insert')
|
||||||
|
|
||||||
def excludedhosts(args):
|
def excludedhosts(options, args):
|
||||||
if len(args) != 1:
|
if len(args) != 1:
|
||||||
print('Missing host group name argument', file=sys.stderr)
|
print('Missing host group name argument', file=sys.stderr)
|
||||||
showUsage(args)
|
showUsage(options, args)
|
||||||
return listIps(args[0], 'delete')
|
return listIps(args[0], 'delete')
|
||||||
|
|
||||||
def includehost(args):
|
def includehost(options, args):
|
||||||
if len(args) != 2:
|
if len(args) != 2:
|
||||||
print('Missing host group name or ip argument', file=sys.stderr)
|
print('Missing host group name or ip argument', file=sys.stderr)
|
||||||
showUsage(args)
|
showUsage(options, args)
|
||||||
result = addIp(args[0], args[1], 'insert')
|
result = addIp(args[0], args[1], 'insert')
|
||||||
if result == 0:
|
if result == 0:
|
||||||
removeIp(args[0], args[1], 'delete', True)
|
removeIp(args[0], args[1], 'delete', True)
|
||||||
return result
|
code = result
|
||||||
|
if code == 0:
|
||||||
|
code = checkApplyOption(options)
|
||||||
|
return code
|
||||||
|
|
||||||
def excludehost(args):
|
def excludehost(options, args):
|
||||||
if len(args) != 2:
|
if len(args) != 2:
|
||||||
print('Missing host group name or ip argument', file=sys.stderr)
|
print('Missing host group name or ip argument', file=sys.stderr)
|
||||||
showUsage(args)
|
showUsage(options, args)
|
||||||
result = addIp(args[0], args[1], 'delete')
|
result = addIp(args[0], args[1], 'delete')
|
||||||
if result == 0:
|
if result == 0:
|
||||||
removeIp(args[0], args[1], 'insert', True)
|
removeIp(args[0], args[1], 'insert', True)
|
||||||
return result
|
code = result
|
||||||
|
if code == 0:
|
||||||
|
code = checkApplyOption(options)
|
||||||
|
return code
|
||||||
|
|
||||||
def removehost(args):
|
def removehost(options, args):
|
||||||
if len(args) != 2:
|
if len(args) != 2:
|
||||||
print('Missing host group name or ip argument', file=sys.stderr)
|
print('Missing host group name or ip argument', file=sys.stderr)
|
||||||
showUsage(args)
|
showUsage(options, args)
|
||||||
return removeIp(args[0], args[1], 'delete')
|
code = removeIp(args[0], args[1], 'delete')
|
||||||
|
if code == 0:
|
||||||
|
code = checkApplyOption(options)
|
||||||
|
return code
|
||||||
|
|
||||||
def apply():
|
def apply():
|
||||||
proc = subprocess.run(['salt-call', 'state.apply', 'firewall', 'queue=True'])
|
proc = subprocess.run(['salt-call', 'state.apply', 'firewall', 'queue=True'])
|
||||||
@@ -276,15 +341,17 @@ def main():
|
|||||||
args.remove(option)
|
args.remove(option)
|
||||||
|
|
||||||
if len(args) == 0:
|
if len(args) == 0:
|
||||||
showUsage(None)
|
showUsage(options, None)
|
||||||
|
|
||||||
commands = {
|
commands = {
|
||||||
"help": showUsage,
|
"help": showUsage,
|
||||||
|
"listhostgroups": listhostgroups,
|
||||||
"includedhosts": includedhosts,
|
"includedhosts": includedhosts,
|
||||||
"excludedhosts": excludedhosts,
|
"excludedhosts": excludedhosts,
|
||||||
"includehost": includehost,
|
"includehost": includehost,
|
||||||
"excludehost": excludehost,
|
"excludehost": excludehost,
|
||||||
"removehost": removehost,
|
"removehost": removehost,
|
||||||
|
"listportgroups": listportgroups,
|
||||||
"listports": listports,
|
"listports": listports,
|
||||||
"addport": addport,
|
"addport": addport,
|
||||||
"removeport": removeport,
|
"removeport": removeport,
|
||||||
@@ -292,12 +359,30 @@ def main():
|
|||||||
"addportgroup": addportgroup
|
"addportgroup": addportgroup
|
||||||
}
|
}
|
||||||
|
|
||||||
|
code=1
|
||||||
|
|
||||||
|
try:
|
||||||
|
lockAttempts = 0
|
||||||
|
maxAttempts = 30
|
||||||
|
while lockAttempts < maxAttempts:
|
||||||
|
lockAttempts = lockAttempts + 1
|
||||||
|
try:
|
||||||
|
f = open(lockFile, "x")
|
||||||
|
f.close()
|
||||||
|
break
|
||||||
|
except:
|
||||||
|
time.sleep(2)
|
||||||
|
|
||||||
|
if lockAttempts == maxAttempts:
|
||||||
|
print("Lock file (" + lockFile + ") could not be created; proceeding without lock.")
|
||||||
|
|
||||||
cmd = commands.get(args[0], showUsage)
|
cmd = commands.get(args[0], showUsage)
|
||||||
code = cmd(args[1:])
|
code = cmd(options, args[1:])
|
||||||
|
finally:
|
||||||
|
try:
|
||||||
if code == 0 and "--apply" in options:
|
os.remove(lockFile)
|
||||||
code = apply()
|
except:
|
||||||
|
print("Lock file (" + lockFile + ") already removed")
|
||||||
|
|
||||||
sys.exit(code)
|
sys.exit(code)
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ if [ ! "$(docker ps -q -f name=so-fleet)" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
docker exec so-fleet fleetctl config set --address https://127.0.0.1:8080 --tls-skip-verify --url-prefix /fleet
|
docker exec so-fleet fleetctl config set --address https://127.0.0.1:8080 --tls-skip-verify --url-prefix /fleet
|
||||||
docker exec -it so-fleet bash -c 'while [[ "$(curl -s -o /dev/null --insecure -w ''%{http_code}'' https://127.0.0.1:8080/fleet)" != "301" ]]; do sleep 5; done'
|
docker exec so-fleet bash -c 'while [[ "$(curl -s -o /dev/null --insecure -w ''%{http_code}'' https://127.0.0.1:8080/fleet)" != "301" ]]; do sleep 5; done'
|
||||||
docker exec so-fleet fleetctl setup --email $1 --password $2
|
docker exec so-fleet fleetctl setup --email $1 --password $2
|
||||||
|
|
||||||
docker exec so-fleet fleetctl apply -f /packs/palantir/Fleet/Endpoints/MacOS/osquery.yaml
|
docker exec so-fleet fleetctl apply -f /packs/palantir/Fleet/Endpoints/MacOS/osquery.yaml
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# NOTE: This script depends on so-common
|
# NOTE: This script depends on so-common
|
||||||
IMAGEREPO=securityonion
|
IMAGEREPO=security-onion-solutions
|
||||||
|
|
||||||
container_list() {
|
container_list() {
|
||||||
MANAGERCHECK=$1
|
MANAGERCHECK=$1
|
||||||
@@ -30,6 +30,7 @@ container_list() {
|
|||||||
|
|
||||||
if [ $MANAGERCHECK == 'so-import' ]; then
|
if [ $MANAGERCHECK == 'so-import' ]; then
|
||||||
TRUSTED_CONTAINERS=(
|
TRUSTED_CONTAINERS=(
|
||||||
|
"so-acng"
|
||||||
"so-elasticsearch"
|
"so-elasticsearch"
|
||||||
"so-filebeat"
|
"so-filebeat"
|
||||||
"so-idstools"
|
"so-idstools"
|
||||||
@@ -103,7 +104,7 @@ update_docker_containers() {
|
|||||||
local PROGRESS_CALLBACK=$3
|
local PROGRESS_CALLBACK=$3
|
||||||
local LOG_FILE=$4
|
local LOG_FILE=$4
|
||||||
|
|
||||||
local CONTAINER_REGISTRY=quay.io
|
local CONTAINER_REGISTRY=ghcr.io
|
||||||
local SIGNPATH=/root/sosigs
|
local SIGNPATH=/root/sosigs
|
||||||
|
|
||||||
if [ -z "$CURLTYPE" ]; then
|
if [ -z "$CURLTYPE" ]; then
|
||||||
@@ -126,12 +127,19 @@ update_docker_containers() {
|
|||||||
container_list
|
container_list
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Let's make sure we have the public key
|
|
||||||
curl -sSL https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/master/KEYS | gpg --import - >> "$LOG_FILE" 2>&1
|
|
||||||
|
|
||||||
rm -rf $SIGNPATH >> "$LOG_FILE" 2>&1
|
rm -rf $SIGNPATH >> "$LOG_FILE" 2>&1
|
||||||
mkdir -p $SIGNPATH >> "$LOG_FILE" 2>&1
|
mkdir -p $SIGNPATH >> "$LOG_FILE" 2>&1
|
||||||
|
|
||||||
|
# Let's make sure we have the public key
|
||||||
|
retry 50 10 "curl -sSL https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/master/KEYS -o $SIGNPATH/KEYS" >> "$LOG_FILE" 2>&1
|
||||||
|
result=$?
|
||||||
|
if [[ $result -eq 0 ]]; then
|
||||||
|
cat $SIGNPATH/KEYS | gpg --import - >> "$LOG_FILE" 2>&1
|
||||||
|
else
|
||||||
|
echo "Failed to pull signature key file: $result"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Download the containers from the interwebs
|
# Download the containers from the interwebs
|
||||||
for i in "${TRUSTED_CONTAINERS[@]}"
|
for i in "${TRUSTED_CONTAINERS[@]}"
|
||||||
do
|
do
|
||||||
@@ -143,10 +151,10 @@ update_docker_containers() {
|
|||||||
|
|
||||||
# Pull down the trusted docker image
|
# Pull down the trusted docker image
|
||||||
local image=$i:$VERSION$IMAGE_TAG_SUFFIX
|
local image=$i:$VERSION$IMAGE_TAG_SUFFIX
|
||||||
docker pull $CONTAINER_REGISTRY/$IMAGEREPO/$image >> "$LOG_FILE" 2>&1
|
retry 50 10 "docker pull $CONTAINER_REGISTRY/$IMAGEREPO/$image" >> "$LOG_FILE" 2>&1
|
||||||
|
|
||||||
# Get signature
|
# Get signature
|
||||||
curl -A "$CURLTYPE/$CURRENTVERSION/$OS/$(uname -r)" https://sigs.securityonion.net/$VERSION/$i:$VERSION$IMAGE_TAG_SUFFIX.sig --output $SIGNPATH/$image.sig >> "$LOG_FILE" 2>&1
|
retry 50 10 "curl -A '$CURLTYPE/$CURRENTVERSION/$OS/$(uname -r)' https://sigs.securityonion.net/$VERSION/$i:$VERSION$IMAGE_TAG_SUFFIX.sig --output $SIGNPATH/$image.sig" >> "$LOG_FILE" 2>&1
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
echo "Unable to pull signature file for $image" >> "$LOG_FILE" 2>&1
|
echo "Unable to pull signature file for $image" >> "$LOG_FILE" 2>&1
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
# {%- set FLEET_IP = salt['pillar.get']('global:fleet_ip', '') %}
|
# {%- set FLEET_IP = salt['pillar.get']('global:fleet_ip', '') %}
|
||||||
# {%- set MANAGER = salt['pillar.get']('global:url_base', '') %}
|
# {%- set MANAGER = salt['pillar.get']('global:url_base', '') %}
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
23
salt/common/tools/sbin/so-monitor-add
Normal file
23
salt/common/tools/sbin/so-monitor-add
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
read -r -d '' message <<- EOM
|
||||||
|
usage: so-monitor-add [-h] NIC
|
||||||
|
|
||||||
|
positional arguments:
|
||||||
|
NIC The interface to add to the monitor bond (ex: eth2)
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
-h, --help Show this help message and exit
|
||||||
|
EOM
|
||||||
|
echo "$message"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ $# -eq 0 || $# -gt 1 ]] || [[ $1 == '-h' || $1 == '--help' ]]; then
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
|
add_interface_bond0 "$1"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
27
salt/common/tools/sbin/so-playbook-sigma-refresh
Normal file
27
salt/common/tools/sbin/so-playbook-sigma-refresh
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
|
|
||||||
|
# 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
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
81
salt/common/tools/sbin/so-raid-status
Normal file
81
salt/common/tools/sbin/so-raid-status
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
|
|
||||||
|
#check_boss_raid() {
|
||||||
|
# BOSSBIN=/opt/boss/mvcli
|
||||||
|
# BOSSRC=$($BOSSBIN info -o vd | grep functional)
|
||||||
|
#
|
||||||
|
# if [[ $BOSSRC ]]; then
|
||||||
|
# # Raid is good
|
||||||
|
# BOSSRAID=0
|
||||||
|
# else
|
||||||
|
# BOSSRAID=1
|
||||||
|
# fi
|
||||||
|
#}
|
||||||
|
|
||||||
|
check_lsi_raid() {
|
||||||
|
# For use for LSI on Ubuntu
|
||||||
|
#MEGA=/opt/MegaRAID/MegeCli/MegaCli64
|
||||||
|
#LSIRC=$($MEGA -LDInfo -Lall -aALL | grep Optimal)
|
||||||
|
# Open Source Centos
|
||||||
|
MEGA=/opt/mega/megasasctl
|
||||||
|
LSIRC=$($MEGA | grep optimal)
|
||||||
|
|
||||||
|
if [[ $LSIRC ]]; then
|
||||||
|
# Raid is good
|
||||||
|
LSIRAID=0
|
||||||
|
else
|
||||||
|
LSIRAID=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
check_software_raid() {
|
||||||
|
SWRC=$(grep "_" /proc/mdstat)
|
||||||
|
|
||||||
|
if [[ $SWRC ]]; then
|
||||||
|
# RAID is failed in some way
|
||||||
|
SWRAID=1
|
||||||
|
else
|
||||||
|
SWRAID=0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# This script checks raid status if you use SO appliances
|
||||||
|
|
||||||
|
# See if this is an appliance
|
||||||
|
|
||||||
|
{%- if salt['grains.get']('sosmodel', '') %}
|
||||||
|
mkdir -p /opt/so/log/raid
|
||||||
|
{%- if grains['sosmodel'] in ['SOSMN', 'SOSSNNV'] %}
|
||||||
|
#check_boss_raid
|
||||||
|
check_software_raid
|
||||||
|
echo "osraid=$BOSSRAID nsmraid=$SWRAID" > /opt/so/log/raid/status.log
|
||||||
|
{%- elif grains['sosmodel'] in ['SOS1000F', 'SOS1000', 'SOSSN7200', 'SOS10K', 'SOS4000'] %}
|
||||||
|
#check_boss_raid
|
||||||
|
check_lsi_raid
|
||||||
|
echo "osraid=$BOSSRAID nsmraid=$LSIRAID" > /opt/so/log/raid/status.log
|
||||||
|
{%- else %}
|
||||||
|
exit 0
|
||||||
|
{%- endif %}
|
||||||
|
{%- else %}
|
||||||
|
exit 0
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC
|
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 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
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user