mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-07-29 12:13:26 +02:00
Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57d629683d | ||
|
|
b109ca4e9b | ||
|
|
e5969a12aa | ||
|
|
4d97b562eb | ||
|
|
f2d81cea3f | ||
|
|
6bd3c414bb | ||
|
|
16f958dac0 | ||
|
|
a57ff5f89e | ||
|
|
01a873b2d9 |
@@ -25,7 +25,7 @@ LAST_HIGHSTATE_END=$([ -e "/opt/so/log/salt/lasthighstate" ] && date -r /opt/so/
|
|||||||
LAST_HEALTHCHECK_STATE_APPLY=$([ -e "/opt/so/log/salt/state-apply-test" ] && date -r /opt/so/log/salt/state-apply-test +%s || echo 0)
|
LAST_HEALTHCHECK_STATE_APPLY=$([ -e "/opt/so/log/salt/state-apply-test" ] && date -r /opt/so/log/salt/state-apply-test +%s || echo 0)
|
||||||
# SETTING THRESHOLD TO ANYTHING UNDER 600 seconds may cause a lot of salt-minion restarts since the job to touch the file occurs every 5-8 minutes by default
|
# SETTING THRESHOLD TO ANYTHING UNDER 600 seconds may cause a lot of salt-minion restarts since the job to touch the file occurs every 5-8 minutes by default
|
||||||
# THRESHOLD is derived from the salt schedule highstate interval + 1 hour, so the minion-check grace period tracks the schedule automatically.
|
# THRESHOLD is derived from the salt schedule highstate interval + 1 hour, so the minion-check grace period tracks the schedule automatically.
|
||||||
THRESHOLD=$(( ({{ SCHEDULEMERGED.highstate_interval_hours }} + 1) * 3600 )) #within how many seconds the file /opt/so/log/salt/state-apply-test must have been touched/modified before the salt minion is restarted
|
THRESHOLD=$(( ({{ SCHEDULEMERGED.highstate_interval_minutes }} + 60) * 60 )) #within how many seconds the file /opt/so/log/salt/state-apply-test must have been touched/modified before the salt minion is restarted
|
||||||
THRESHOLD_DATE=$((LAST_HEALTHCHECK_STATE_APPLY+THRESHOLD))
|
THRESHOLD_DATE=$((LAST_HEALTHCHECK_STATE_APPLY+THRESHOLD))
|
||||||
|
|
||||||
logCmd() {
|
logCmd() {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
elasticsearch:
|
elasticsearch:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
esheap: '600m'
|
||||||
version: 9.3.7
|
version: 9.3.7
|
||||||
index_clean: true
|
index_clean: true
|
||||||
data_retention_method: DLM
|
data_retention_method: DLM
|
||||||
|
|||||||
@@ -442,7 +442,13 @@ get_soup_script_hashes() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
highstate() {
|
highstate() {
|
||||||
# Run a highstate.
|
# Run a highstate with a retry attempt.
|
||||||
|
if salt-call state.highstate -l info queue=True; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Initial highstate attempt had a problem; retrying in 30 seconds."
|
||||||
|
sleep 30
|
||||||
salt-call state.highstate -l info queue=True
|
salt-call state.highstate -l info queue=True
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ versionlock:
|
|||||||
# grain (compound supports nested grain matching via G@<key>:<subkey>:<value>).
|
# grain (compound supports nested grain matching via G@<key>:<subkey>:<value>).
|
||||||
# pillar/vm/soc_vm.sls write path is referenced at salt/_runners/setup_hypervisor.py:856.
|
# pillar/vm/soc_vm.sls write path is referenced at salt/_runners/setup_hypervisor.py:856.
|
||||||
vm:
|
vm:
|
||||||
- state: vm
|
- state: vm.user
|
||||||
tgt: 'G@salt-cloud:driver:libvirt'
|
tgt: 'G@salt-cloud:driver:libvirt'
|
||||||
|
|
||||||
# zeek: sensor_roles + so-import (5 roles).
|
# zeek: sensor_roles + so-import (5 roles).
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ salt:
|
|||||||
batch: '25%'
|
batch: '25%'
|
||||||
batch_wait: 15
|
batch_wait: 15
|
||||||
schedule:
|
schedule:
|
||||||
highstate_interval_hours: 2
|
highstate_interval_minutes: 120
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% from 'salt/schedule.map.jinja' import SCHEDULEMERGED %}
|
{% from 'salt/schedule.map.jinja' import SCHEDULEMERGED %}
|
||||||
|
|
||||||
|
{# splay a quarter of the interval, clamped to [5 min, 30 min], so short intervals
|
||||||
|
don't get jitter larger than the interval itself #}
|
||||||
|
{% set SPLAY = [[(SCHEDULEMERGED.highstate_interval_minutes * 60 // 4) | int, 300] | max, 1800] | min %}
|
||||||
|
|
||||||
highstate_schedule:
|
highstate_schedule:
|
||||||
schedule.present:
|
schedule.present:
|
||||||
- function: state.highstate
|
- function: state.highstate
|
||||||
- hours: {{ SCHEDULEMERGED.highstate_interval_hours }}
|
- minutes: {{ SCHEDULEMERGED.highstate_interval_minutes }}
|
||||||
- maxrunning: 1
|
- maxrunning: 1
|
||||||
{% if not GLOBALS.is_manager %}
|
{% if not GLOBALS.is_manager %}
|
||||||
- splay: 1800
|
- splay: {{ SPLAY }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -31,9 +31,11 @@ salt:
|
|||||||
global: True
|
global: True
|
||||||
advanced: True
|
advanced: True
|
||||||
schedule:
|
schedule:
|
||||||
highstate_interval_hours:
|
highstate_interval_minutes:
|
||||||
description: How often every minion in the grid runs a scheduled state.highstate, in hours. Lower values keep minions closer in sync at the cost of more load; higher values reduce load but increase worst-case latency for non-pushed changes. The salt-minion health check restarts a minion if its last highstate is older than this value plus one hour.
|
description: How often every minion in the grid runs a scheduled state.highstate, in minutes. Minimum 15 minutes. Lower values keep minions closer in sync at the cost of more load; higher values reduce load but increase worst-case latency for non-pushed changes. If Auto Apply is disabled, set this to the 15-minute minimum so changes are still picked up promptly. The salt-minion health check restarts a minion if its last state apply is older than this value plus one hour.
|
||||||
forcedType: int
|
forcedType: int
|
||||||
helpLink: push
|
helpLink: push
|
||||||
global: True
|
global: True
|
||||||
advanced: True
|
advanced: True
|
||||||
|
regex: '^(1[5-9]|[2-9][0-9]|[1-9][0-9]{2,4})$'
|
||||||
|
regexFailureMessage: The value must be an integer of at least 15 minutes (maximum 99999).
|
||||||
|
|||||||
@@ -46,20 +46,24 @@ transformations:
|
|||||||
- type: logsource
|
- type: logsource
|
||||||
product: opencanary
|
product: opencanary
|
||||||
# Maps "antivirus" category to Windows Defender logs shipped by Elastic Agent Winlog Integration
|
# Maps "antivirus" category to Windows Defender logs shipped by Elastic Agent Winlog Integration
|
||||||
|
# and to Elastic Defend malware alerts
|
||||||
# winlog.event_data.threat_name has to be renamed prior to ingestion, it is originally winlog.event_data.Threat Name
|
# winlog.event_data.threat_name has to be renamed prior to ingestion, it is originally winlog.event_data.Threat Name
|
||||||
- id: antivirus_field-mappings_windows-defender
|
- id: antivirus_field-mappings
|
||||||
type: field_name_mapping
|
type: field_name_mapping
|
||||||
mapping:
|
mapping:
|
||||||
Signature: winlog.event_data.threat_name
|
Signature:
|
||||||
|
- winlog.event_data.threat_name
|
||||||
|
- rule.name
|
||||||
rule_conditions:
|
rule_conditions:
|
||||||
- type: logsource
|
- type: logsource
|
||||||
category: antivirus
|
category: antivirus
|
||||||
- id: antivirus_add-fields_windows-defender
|
- id: antivirus_add-fields
|
||||||
type: add_condition
|
type: add_condition
|
||||||
conditions:
|
conditions:
|
||||||
winlog.channel: 'Microsoft-Windows-Windows Defender/Operational'
|
event.code:
|
||||||
winlog.provider_name: 'Microsoft-Windows-Windows Defender'
|
- "1116"
|
||||||
event.code: "1116"
|
- "malicious_file"
|
||||||
|
- "memory_signature"
|
||||||
rule_conditions:
|
rule_conditions:
|
||||||
- type: logsource
|
- type: logsource
|
||||||
category: antivirus
|
category: antivirus
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
{% import 'vars/init.map.jinja' as INIT %}
|
{% import 'vars/init.map.jinja' as INIT %}
|
||||||
|
{% import_yaml 'elasticsearch/defaults.yaml' as ELASTICSEARCHDEFAULTS %}
|
||||||
|
|
||||||
{%
|
{%
|
||||||
set ELASTICSEARCH_GLOBALS = {
|
set ELASTICSEARCH_GLOBALS = {
|
||||||
'elasticsearch': {
|
'elasticsearch': {
|
||||||
'es_cluster_name': INIT.PILLAR.elasticsearch.config.cluster.name,
|
'es_cluster_name': INIT.PILLAR.elasticsearch.config.cluster.name,
|
||||||
'es_heap': INIT.PILLAR.elasticsearch.esheap
|
'es_heap': INIT.PILLAR.elasticsearch.get('esheap', ELASTICSEARCHDEFAULTS.elasticsearch.esheap)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
%}
|
%}
|
||||||
|
|||||||
Reference in New Issue
Block a user