mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-12-01 16:16:14 +01:00
Compare commits
31
Commits
reyesj2/610
..
3/dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2bbb211484 | ||
|
|
79ec4f81cc | ||
|
|
7f1d60d366 | ||
|
|
1ce378cc1b | ||
|
|
d6ac9d6989 | ||
|
|
df650478b2 | ||
|
|
8c899ef367 | ||
|
|
ad0c0f454b | ||
|
|
ba3282a963 | ||
|
|
462a5d9cd1 | ||
|
|
7d8edebf0e | ||
|
|
26d503cb1e | ||
|
|
e79b61f7ab | ||
|
|
5c77862e65 | ||
|
|
5c70f097dc | ||
|
|
1b4a9d2a3f | ||
|
|
9a0e88f8d2 | ||
|
|
d37241376a | ||
|
|
3d8e6d0c6e | ||
|
|
ddf168f062 | ||
|
|
693f7917ae | ||
|
|
3682e0fde6 | ||
|
|
161d0d145f | ||
|
|
c04f06af1e | ||
|
|
7b2c44e965 | ||
|
|
9895dfbe7f | ||
|
|
a21d4b5f1b | ||
|
|
f5edb1f6a4 | ||
|
|
708b872583 | ||
|
|
844ca33aed | ||
|
|
45046b946e |
No files matched your search
@@ -41,6 +41,7 @@
|
||||
'logstash.node': 'logstash.stack_monitoring.node',
|
||||
'logstash.node_cel': 'logstash.node',
|
||||
'logstash.node_stats': 'logstash.stack_monitoring.node_stats',
|
||||
'mqtt.traces': 'traces-mqtt.traces',
|
||||
'synthetics.browser': 'synthetics-browser',
|
||||
'synthetics.browser_network': 'synthetics-browser.network',
|
||||
'synthetics.browser_screenshot': 'synthetics-browser.screenshot',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
elasticsearch:
|
||||
enabled: false
|
||||
esheap: '600m'
|
||||
version: 9.4.8
|
||||
version: 9.4.10
|
||||
index_clean: true
|
||||
data_retention_method: DLM
|
||||
vm:
|
||||
|
||||
@@ -140,7 +140,23 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"dynamic_templates": [
|
||||
{
|
||||
"event_data_scalars_as_keyword": {
|
||||
"path_match": "event_data.*",
|
||||
"match_mapping_type": [
|
||||
"long",
|
||||
"double",
|
||||
"boolean"
|
||||
],
|
||||
"mapping": {
|
||||
"type": "keyword",
|
||||
"ignore_above": 1024
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"_meta": {
|
||||
|
||||
@@ -8,10 +8,10 @@ influxdb:
|
||||
flux-log-enabled: false
|
||||
hardening-enabled: true
|
||||
http-bind-address: :8086
|
||||
http-idle-timeout: 0
|
||||
http-idle-timeout: 0s
|
||||
http-read-header-timeout: 10s
|
||||
http-read-timeout: 0
|
||||
http-write-timeout: 0
|
||||
http-read-timeout: 0s
|
||||
http-write-timeout: 0s
|
||||
influxql-max-select-buckets: 0
|
||||
influxql-max-select-point: 0
|
||||
influxql-max-select-series: 0
|
||||
|
||||
@@ -42,17 +42,17 @@ influxdb:
|
||||
advanced: True
|
||||
helpLink: influxdb
|
||||
http-idle-timeout:
|
||||
description: Keep-alive timeout while a connection waits for new requests. A value of 0 is the same as no timeout enforced.
|
||||
description: Keep-alive timeout while a connection waits for new requests. A value of 0s is the same as no timeout enforced.
|
||||
global: True
|
||||
advanced: True
|
||||
helpLink: influxdb
|
||||
http-read-header-timeout:
|
||||
description: The duration to wait for a request header before closing the connection. A value of 0 is the same as no timeout enforced.
|
||||
description: The duration to wait for a request header before closing the connection. A value of 0s is the same as no timeout enforced.
|
||||
global: True
|
||||
advanced: True
|
||||
helpLink: influxdb
|
||||
http-read-timeout:
|
||||
description: The duration to wait for the request to be fully read before closing the connection. A value of 0 is the same as no timeout enforced.
|
||||
description: The duration to wait for the request to be fully read before closing the connection. A value of 0s is the same as no timeout enforced.
|
||||
global: True
|
||||
advanced: True
|
||||
helpLink: influxdb
|
||||
|
||||
@@ -128,7 +128,7 @@ lookup_org_id_with_wait() {
|
||||
wait=10
|
||||
while [[ $attempts -lt $max_attempts ]]; do
|
||||
response=$(request orgs?org=Security+Onion)
|
||||
oid=$(echo "$response" | jq -r ".orgs[] | select(.name == \"Security Onion\").id")
|
||||
oid=$(echo "$response" | jq -r ".orgs[]? | select(.name == \"Security Onion\").id")
|
||||
if [[ -z $oid ]]; then
|
||||
attempts=$((attempts+1))
|
||||
log "Server does not appear to be running or fully initialized - will try again in $wait seconds ($attempts / $max_attempts)"
|
||||
|
||||
@@ -22,7 +22,7 @@ kibana:
|
||||
- default
|
||||
- file
|
||||
migrations:
|
||||
discardCorruptObjects: "9.4.8"
|
||||
discardCorruptObjects: "9.4.10"
|
||||
telemetry:
|
||||
enabled: False
|
||||
xpack:
|
||||
|
||||
@@ -1108,9 +1108,6 @@ post_to_3.3.0() {
|
||||
|
||||
### 3.4.0 Scripts ###
|
||||
up_to_3.4.0() {
|
||||
# download 9.4.8 elastic agent packages
|
||||
determine_elastic_agent_upgrade
|
||||
|
||||
set_soauth_range
|
||||
|
||||
echo "Removing so-kratos, so-hydra and so-soc so they are recreated on the soauth network."
|
||||
@@ -1188,10 +1185,6 @@ valid_soauth_range() {
|
||||
}
|
||||
|
||||
post_to_3.4.0() {
|
||||
# Generate 9.4.8 elastic agent installers
|
||||
echo "Regenerating Elastic Agent Installers"
|
||||
/sbin/so-elastic-agent-gen-installers
|
||||
|
||||
for idx in "metrics-logstash.node-default" "metrics-logstash.stack_monitoring.node-default"; do
|
||||
rollover_index "$idx"
|
||||
done
|
||||
@@ -1221,6 +1214,9 @@ add_detection_runtime_fields() {
|
||||
|
||||
### 3.5.0 Scripts ###
|
||||
up_to_3.5.0() {
|
||||
# download 9.4.10 elastic agent packages
|
||||
determine_elastic_agent_upgrade
|
||||
|
||||
remove_localrules_portgroup
|
||||
|
||||
INSTALLEDVERSION=3.5.0
|
||||
@@ -1239,8 +1235,14 @@ remove_localrules_portgroup() {
|
||||
}
|
||||
|
||||
post_to_3.5.0() {
|
||||
# Generate 9.4.10 elastic agent installers
|
||||
echo "Regenerating Elastic Agent Installers"
|
||||
/sbin/so-elastic-agent-gen-installers
|
||||
|
||||
telegraf_repair
|
||||
|
||||
rollover_index "logs-detections.alerts-so"
|
||||
|
||||
set_postversion 3.5.0
|
||||
}
|
||||
### 3.5.0 End ###
|
||||
@@ -1517,10 +1519,11 @@ verify_es_version_compatibility() {
|
||||
["8.18.4"]="8.18.6 8.18.8 9.0.8"
|
||||
["8.18.6"]="8.18.8 9.0.8"
|
||||
["8.18.8"]="9.0.8"
|
||||
["9.0.8"]="9.3.3 9.3.7 9.4.5 9.4.8"
|
||||
["9.3.3"]="9.3.7 9.4.5 9.4.8"
|
||||
["9.3.7"]="9.4.5 9.4.8"
|
||||
["9.4.5"]="9.4.8"
|
||||
["9.0.8"]="9.3.3 9.3.7 9.4.5 9.4.8 9.4.10"
|
||||
["9.3.3"]="9.3.7 9.4.5 9.4.8 9.4.10"
|
||||
["9.3.7"]="9.4.5 9.4.8 9.4.10"
|
||||
["9.4.5"]="9.4.8 9.4.10"
|
||||
["9.4.8"]="9.4.10"
|
||||
)
|
||||
|
||||
# Elasticsearch MUST upgrade through these versions
|
||||
|
||||
@@ -20,8 +20,6 @@ CRITICAL_AGENTS_FILE="/opt/so/conf/agents/critical-agents.txt"
|
||||
OFFLINE_THRESHOLD_HOURS={{ OFFLINE_THRESHOLD_HOURS }}
|
||||
REALERT_THRESHOLD={{ REALERT_THRESHOLD }}
|
||||
PAGE_SIZE="{{ PAGE_SIZE }}"
|
||||
# Safety limit on pagination loops. Very large fleets should raise page_size instead.
|
||||
MAX_PAGES=100
|
||||
|
||||
log_message() {
|
||||
local level="$1"
|
||||
@@ -137,16 +135,14 @@ main() {
|
||||
local page=1
|
||||
local total_agents=0
|
||||
local processed_agents=0
|
||||
local agents_in_page=0
|
||||
local agents=()
|
||||
local current_timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
||||
|
||||
{%- if CUSTOM_KQUERY != None and CUSTOM_KQUERY | length > 0 %}
|
||||
log_message "INFO" "Using custom kquery: {{ CUSTOM_KQUERY }}"
|
||||
FLEET_QUERY="${FLEET_API}?kuery={{ CUSTOM_KQUERY | urlencode }}&perPage=${PAGE_SIZE}"
|
||||
FLEET_QUERY="${FLEET_API}?kuery={{ CUSTOM_KQUERY | urlencode }}&perPage=${PAGE_SIZE}&page=${page}"
|
||||
{%- else %}
|
||||
log_message "INFO" "Using default query (all offline or degraded agents)"
|
||||
FLEET_QUERY="${FLEET_API}?kuery=status%3Aoffline%20OR%20status%3Adegraded&perPage=${PAGE_SIZE}"
|
||||
FLEET_QUERY="${FLEET_API}?kuery=status%3Aoffline%20OR%20status%3Adegraded&perPage=${PAGE_SIZE}&page=${page}"
|
||||
{%- endif %}
|
||||
|
||||
while true; do
|
||||
@@ -154,48 +150,27 @@ main() {
|
||||
|
||||
if ! response_body=$(curl -K "$CURL_CONFIG" \
|
||||
-s --fail \
|
||||
"${FLEET_QUERY}&page=${page}" \
|
||||
"$FLEET_QUERY" \
|
||||
-H 'kbn-xsrf: true' 2>/dev/null); then
|
||||
log_message "ERROR" "Failed to query Fleet API (page $page)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Validate the response before parsing it so a bad response can never be
|
||||
# mistaken for an empty page.
|
||||
if ! echo "$response_body" | jq -e 'type == "object"' >/dev/null 2>&1; then
|
||||
log_message "ERROR" "Malformed Fleet API response on page $page: not a valid JSON object"
|
||||
exit 1
|
||||
fi
|
||||
# pagination info
|
||||
current_total=$(echo "$response_body" | jq -r '.total // 0')
|
||||
current_page=$(echo "$response_body" | jq -r '.page // 1')
|
||||
agents_in_page=$(echo "$response_body" | jq -r '.list | length')
|
||||
|
||||
if ! current_total=$(echo "$response_body" | jq -e '.total | select(type == "number" and . >= 0 and . == floor)' 2>/dev/null); then
|
||||
log_message "ERROR" "Malformed Fleet API response on page $page: missing or invalid total"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Fleet 9.x returns agents under "items"; older responses used "list".
|
||||
if ! agents_json=$(echo "$response_body" | jq -c '(.items // .list) | if type == "array" then .[] else error("no agent array") end' 2>/dev/null); then
|
||||
log_message "ERROR" "Malformed Fleet API response on page $page: missing or invalid agent collection (items/list)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Use the latest page's total: agents changing status between pages
|
||||
# (e.g. coming back online) shrink the offline/degraded result set.
|
||||
total_agents="$current_total"
|
||||
# Update total
|
||||
if [ "$page" -eq 1 ]; then
|
||||
total_agents="$current_total"
|
||||
log_message "INFO" "Found $total_agents total agents across all pages"
|
||||
fi
|
||||
|
||||
# Process agents from current page
|
||||
agents=()
|
||||
agents_in_page=0
|
||||
if [ -n "$agents_json" ]; then
|
||||
while IFS= read -r agent; do
|
||||
agents+=("$agent")
|
||||
agents_in_page=$((agents_in_page + 1))
|
||||
done <<< "$agents_json"
|
||||
fi
|
||||
log_message "INFO" "Processing page $current_page with $agents_in_page agents"
|
||||
|
||||
log_message "INFO" "Processing page $page with $agents_in_page agents"
|
||||
# Process agents from current page
|
||||
mapfile -t agents < <(echo "$response_body" | jq -c '.list[]')
|
||||
|
||||
for agent in "${agents[@]}"; do
|
||||
# Grab agent details
|
||||
@@ -259,28 +234,20 @@ main() {
|
||||
|
||||
processed_agents=$((processed_agents + agents_in_page))
|
||||
|
||||
if [ "$processed_agents" -ge "$total_agents" ]; then
|
||||
if [ "$agents_in_page" -eq 0 ] || [ "$processed_agents" -ge "$total_agents" ]; then
|
||||
log_message "INFO" "Completed processing all pages. Total processed: $processed_agents agents"
|
||||
break
|
||||
fi
|
||||
|
||||
if [ "$agents_in_page" -eq 0 ]; then
|
||||
log_message "ERROR" "Incomplete agent scan: page $page was empty after $processed_agents of $total_agents agents"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
page=$((page + 1))
|
||||
|
||||
if [ "$page" -gt "$MAX_PAGES" ]; then
|
||||
log_message "ERROR" "Reached maximum page limit ($MAX_PAGES) after $processed_agents of $total_agents agents. Issue with script or extremely large fleet deployment. Consider increasing page_size under Administration -> Configuration -> manager -> agent_monitoring -> config -> page_size (enable 'Show advanced settings')."
|
||||
exit 1
|
||||
# Limit pagination loops incase of any issues. If agent count is high enough increase page_size in SOC manager.agent_monitoring.config.page_size
|
||||
if [ "$page" -gt 100 ]; then
|
||||
log_message "ERROR" "Reached maximum page limit (100). Issue with script or extremely large fleet deployment. Consider increasing page_size in SOC -> manager.agent_monitoring.config.page_size"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$total_agents" -gt 0 ] && [ "$processed_agents" -eq 0 ]; then
|
||||
log_message "ERROR" "Incomplete agent scan: Fleet reported $total_agents agents but none were examined"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log_message "INFO" "Fleet agent status check completed. Processed $processed_agents out of $total_agents agents"
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ include:
|
||||
# Install the registry container
|
||||
so-dockerregistry:
|
||||
docker_container.running:
|
||||
- image: ghcr.io/security-onion-solutions/registry:3.1.1
|
||||
- image: ghcr.io/security-onion-solutions/registry:3.1.2
|
||||
# Intentionally `always`-- registry is critical and must
|
||||
# come back up even if it was manually stopped.
|
||||
- restart_policy: always
|
||||
|
||||
@@ -1638,6 +1638,12 @@ soc:
|
||||
- "user.effective.name"
|
||||
- "weird.name"
|
||||
- "tags"
|
||||
queryNotifications:
|
||||
defaultLimit: 10
|
||||
maxLimit: 50
|
||||
summaryMaxLength: 1000
|
||||
fieldValueMaxLength: 200
|
||||
maxEntries: 25
|
||||
onionconfig:
|
||||
saltstackDir: /opt/so/saltstack
|
||||
bypassEnabled: false
|
||||
|
||||
@@ -1112,6 +1112,32 @@ soc:
|
||||
description: A whitelist of fields to return when OnionAI uses the query_events tool. All other fields are removed. One field per line.
|
||||
global: True
|
||||
multiline: True
|
||||
queryNotifications:
|
||||
defaultLimit:
|
||||
description: Number of notifications Onion AI reads with the query_notifications tool when it doesn't ask for a specific number. Must be greater than 0. Values above maxLimit use maxLimit.
|
||||
global: True
|
||||
advanced: True
|
||||
forcedType: int
|
||||
maxLimit:
|
||||
description: Maximum number of notifications Onion AI may read with one query_notifications call. Must be greater than 0. Higher values put more notification text into the model's context.
|
||||
global: True
|
||||
advanced: True
|
||||
forcedType: int
|
||||
summaryMaxLength:
|
||||
description: Maximum number of characters of each notification summary that query_notifications returns to Onion AI. Must be greater than 0. Longer summaries are shortened.
|
||||
global: True
|
||||
advanced: True
|
||||
forcedType: int
|
||||
fieldValueMaxLength:
|
||||
description: Maximum number of characters of each notification field value that query_notifications returns to Onion AI. Must be greater than 0. Longer values are shortened. Link values are never shortened.
|
||||
global: True
|
||||
advanced: True
|
||||
forcedType: int
|
||||
maxEntries:
|
||||
description: Maximum number of fields, of links, and of attachment names, each counted separately, per notification that query_notifications returns to Onion AI. Must be greater than 0. The result tells Onion AI how many were left out.
|
||||
global: True
|
||||
advanced: True
|
||||
forcedType: int
|
||||
client:
|
||||
assistant:
|
||||
enabled:
|
||||
|
||||
@@ -24,6 +24,8 @@ so-telegraf:
|
||||
- environment:
|
||||
- HOST_ETC=/host/etc
|
||||
- HOST_SYS=/host/sys
|
||||
- HOST_PROC=/host/proc
|
||||
- HOST_PROC_MOUNTINFO=/proc/1
|
||||
- HOST_MOUNT_PREFIX=/host
|
||||
- GODEBUG=x509ignoreCN=0
|
||||
{% if DOCKERMERGED.containers['so-telegraf'].extra_env %}
|
||||
|
||||
Reference in new issue
Block a user