mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-06-14 14:18:40 +02:00
Merge branch '2.4/dev' into TOoSmOotH-patch-3
This commit is contained in:
@@ -1113,7 +1113,7 @@ suricata_idstools_removal_pre() {
|
|||||||
install -d -o 939 -g 939 -m 755 /opt/so/conf/soc/fingerprints
|
install -d -o 939 -g 939 -m 755 /opt/so/conf/soc/fingerprints
|
||||||
install -o 939 -g 939 -m 644 /dev/null /opt/so/conf/soc/fingerprints/suricataengine.syncBlock
|
install -o 939 -g 939 -m 644 /dev/null /opt/so/conf/soc/fingerprints/suricataengine.syncBlock
|
||||||
cat > /opt/so/conf/soc/fingerprints/suricataengine.syncBlock << EOF
|
cat > /opt/so/conf/soc/fingerprints/suricataengine.syncBlock << EOF
|
||||||
Suricata ruleset sync is blocked until this file is removed. Make sure that you have manually added any custom Suricata rulesets via SOC config - review the documentation for more details: securityonion.net/docs
|
Suricata ruleset sync is blocked until this file is removed. **CRITICAL** Make sure that you have manually added any custom Suricata rulesets via SOC config before removing this file - review the documentation for more details: https://docs.securityonion.net/en/2.4/nids.html#sync-block
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Remove possible symlink & create salt local rules dir
|
# Remove possible symlink & create salt local rules dir
|
||||||
@@ -1131,6 +1131,7 @@ if [[ -f /opt/so/conf/soc/so-detections-backup.py ]]; then
|
|||||||
# Verify backup by comparing counts
|
# Verify backup by comparing counts
|
||||||
echo "Verifying detection overrides backup..."
|
echo "Verifying detection overrides backup..."
|
||||||
es_override_count=$(/sbin/so-elasticsearch-query 'so-detection/_count' \
|
es_override_count=$(/sbin/so-elasticsearch-query 'so-detection/_count' \
|
||||||
|
--retry 5 --retry-delay 10 --retry-all-errors \
|
||||||
-d '{"query": {"bool": {"must": [{"exists": {"field": "so_detection.overrides"}}]}}}' | jq -r '.count') || {
|
-d '{"query": {"bool": {"must": [{"exists": {"field": "so_detection.overrides"}}]}}}' | jq -r '.count') || {
|
||||||
echo " Error: Failed to query Elasticsearch for override count"
|
echo " Error: Failed to query Elasticsearch for override count"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -2652,13 +2652,6 @@ soc:
|
|||||||
thresholdColorRatioMed: 0.75
|
thresholdColorRatioMed: 0.75
|
||||||
thresholdColorRatioMax: 1
|
thresholdColorRatioMax: 1
|
||||||
availableModels:
|
availableModels:
|
||||||
- id: sonnet-4
|
|
||||||
displayName: Claude Sonnet 4 ($$$)
|
|
||||||
origin: USA
|
|
||||||
contextLimitSmall: 200000
|
|
||||||
contextLimitLarge: 1000000
|
|
||||||
lowBalanceColorAlert: 500000
|
|
||||||
enabled: true
|
|
||||||
- id: sonnet-4.5
|
- id: sonnet-4.5
|
||||||
displayName: Claude Sonnet 4.5 ($$$)
|
displayName: Claude Sonnet 4.5 ($$$)
|
||||||
origin: USA
|
origin: USA
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
|
|
||||||
{# Define the Detections custom ruleset that should always be present #}
|
{# Define the Detections custom ruleset that should always be present #}
|
||||||
{% set CUSTOM_RULESET = {
|
{% set CUSTOM_RULESET = {
|
||||||
'name': 'custom',
|
'name': '__custom__',
|
||||||
'description': 'User-created custom rules created via the Detections module in the SOC UI',
|
'description': 'User-created custom rules created via the Detections module in the SOC UI',
|
||||||
'sourceType': 'elasticsearch',
|
'sourceType': 'elasticsearch',
|
||||||
'sourcePath': 'so_detection.ruleset:__custom__',
|
'sourcePath': 'so_detection.ruleset:__custom__',
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
{# Always append the custom ruleset to suricataengine.rulesetSources if not already present #}
|
{# Always append the custom ruleset to suricataengine.rulesetSources if not already present #}
|
||||||
{% if SOCMERGED.config.server.modules.suricataengine is defined and SOCMERGED.config.server.modules.suricataengine.rulesetSources is defined %}
|
{% if SOCMERGED.config.server.modules.suricataengine is defined and SOCMERGED.config.server.modules.suricataengine.rulesetSources is defined %}
|
||||||
{% if SOCMERGED.config.server.modules.suricataengine.rulesetSources is not mapping %}
|
{% if SOCMERGED.config.server.modules.suricataengine.rulesetSources is not mapping %}
|
||||||
{% set custom_names = SOCMERGED.config.server.modules.suricataengine.rulesetSources | selectattr('name', 'equalto', 'custom') | list %}
|
{% set custom_names = SOCMERGED.config.server.modules.suricataengine.rulesetSources | selectattr('name', 'equalto', '__custom__') | list %}
|
||||||
{% if custom_names | length == 0 %}
|
{% if custom_names | length == 0 %}
|
||||||
{% do SOCMERGED.config.server.modules.suricataengine.rulesetSources.append(CUSTOM_RULESET) %}
|
{% do SOCMERGED.config.server.modules.suricataengine.rulesetSources.append(CUSTOM_RULESET) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -608,6 +608,18 @@ soc:
|
|||||||
label: Delete Unreferenced (Deletes rules that are no longer referenced by ruleset source)
|
label: Delete Unreferenced (Deletes rules that are no longer referenced by ruleset source)
|
||||||
forcedType: bool
|
forcedType: bool
|
||||||
required: False
|
required: False
|
||||||
|
- field: proxyURL
|
||||||
|
label: HTTP/HTTPS proxy URL for downloading the ruleset.
|
||||||
|
required: False
|
||||||
|
- field: proxyUsername
|
||||||
|
label: Proxy authentication username.
|
||||||
|
required: False
|
||||||
|
- field: proxyPassword
|
||||||
|
label: Proxy authentication password.
|
||||||
|
required: False
|
||||||
|
- field: proxyCACert
|
||||||
|
label: Path to CA certificate file for MITM proxy verification.
|
||||||
|
required: False
|
||||||
airgap: *serulesetSources
|
airgap: *serulesetSources
|
||||||
navigator:
|
navigator:
|
||||||
intervalMinutes:
|
intervalMinutes:
|
||||||
|
|||||||
@@ -17,14 +17,23 @@ query() {
|
|||||||
|
|
||||||
STATS=$(query "ruleset-stats")
|
STATS=$(query "ruleset-stats")
|
||||||
RELOAD=$(query "ruleset-reload-time")
|
RELOAD=$(query "ruleset-reload-time")
|
||||||
|
[ -z "$RELOAD" ] && RELOAD='{}'
|
||||||
|
|
||||||
if echo "$STATS" | jq -e '.return == "OK"' > /dev/null 2>&1; then
|
# Outputs valid JSON on success, empty on failure
|
||||||
LOADED=$(echo "$STATS" | jq -r '.message[0].rules_loaded')
|
OUTPUT=$(jq -n \
|
||||||
FAILED=$(echo "$STATS" | jq -r '.message[0].rules_failed')
|
--argjson stats "$STATS" \
|
||||||
LAST_RELOAD=$(echo "$RELOAD" | jq -r '.message[0].last_reload')
|
--argjson reload "$RELOAD" \
|
||||||
|
'if $stats.return == "OK" and ($stats.message[0].rules_loaded | type) == "number" and ($stats.message[0].rules_failed | type) == "number" then
|
||||||
|
{
|
||||||
|
rules_loaded: $stats.message[0].rules_loaded,
|
||||||
|
rules_failed: $stats.message[0].rules_failed,
|
||||||
|
last_reload: ($reload.message[0].last_reload // ""),
|
||||||
|
return: "OK"
|
||||||
|
}
|
||||||
|
else empty end' 2>/dev/null)
|
||||||
|
|
||||||
jq -n --argjson loaded "$LOADED" --argjson failed "$FAILED" --arg reload "$LAST_RELOAD" \
|
if [ -n "$OUTPUT" ]; then
|
||||||
'{rules_loaded: $loaded, rules_failed: $failed, last_reload: $reload, return: "OK"}' > "$OUTFILE"
|
echo "$OUTPUT" > "$OUTFILE"
|
||||||
else
|
else
|
||||||
echo '{"return":"FAIL"}' > "$OUTFILE"
|
echo '{"return":"FAIL"}' > "$OUTFILE"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -18,11 +18,15 @@ if [[ ! "`pidof -x $(basename $0) -o %PPID`" ]]; then
|
|||||||
if [ -f "$STATSFILE" ] && [ $(($(date +%s) - $(stat -c %Y "$STATSFILE"))) -lt 90 ] && jq -e '.return == "OK" and .rules_loaded != null and .rules_failed != null' "$STATSFILE" > /dev/null 2>&1; then
|
if [ -f "$STATSFILE" ] && [ $(($(date +%s) - $(stat -c %Y "$STATSFILE"))) -lt 90 ] && jq -e '.return == "OK" and .rules_loaded != null and .rules_failed != null' "$STATSFILE" > /dev/null 2>&1; then
|
||||||
LOADED=$(jq -r '.rules_loaded' "$STATSFILE")
|
LOADED=$(jq -r '.rules_loaded' "$STATSFILE")
|
||||||
FAILED=$(jq -r '.rules_failed' "$STATSFILE")
|
FAILED=$(jq -r '.rules_failed' "$STATSFILE")
|
||||||
RELOAD_TIME=$(jq -r '.last_reload // ""' "$STATSFILE")
|
RELOAD_TIME=$(jq -r 'if .last_reload then .last_reload else "" end' "$STATSFILE")
|
||||||
|
|
||||||
echo "surirules loaded=${LOADED}i,failed=${FAILED}i,reload_time=\"${RELOAD_TIME}\",status=\"ok\""
|
if [ -n "$RELOAD_TIME" ]; then
|
||||||
|
echo "surirules loaded=${LOADED}i,failed=${FAILED}i,reload_time=\"${RELOAD_TIME}\",status=\"ok\""
|
||||||
|
else
|
||||||
|
echo "surirules loaded=${LOADED}i,failed=${FAILED}i,status=\"ok\""
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "surirules loaded=0i,failed=0i,reload_time=\"\",status=\"unknown\""
|
echo "surirules loaded=0i,failed=0i,status=\"unknown\""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user