mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-08 18:22:47 +01:00
[wip] Change learn:modules to dictionary
This commit is contained in:
@@ -32,9 +32,9 @@ salt_proc: subprocess.CompletedProcess = None
|
|||||||
|
|
||||||
# Temp store of modules, will likely be broken out into salt
|
# Temp store of modules, will likely be broken out into salt
|
||||||
def get_learn_modules():
|
def get_learn_modules():
|
||||||
return [
|
return {
|
||||||
{ 'name': 'logscan', 'cpu_period': get_cpu_period(fraction=0.25), 'enabled': False, 'description': 'Scan log files against pre-trained models to alert on anomalies.' }
|
'logscan': { 'cpu_period': get_cpu_period(fraction=0.25), 'enabled': False, 'description': 'Scan log files against pre-trained models to alert on anomalies.' }
|
||||||
]
|
}
|
||||||
|
|
||||||
|
|
||||||
def get_cpu_period(fraction: float):
|
def get_cpu_period(fraction: float):
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||||
{% if sls in allowed_states %}
|
{% if sls in allowed_states %}
|
||||||
|
|
||||||
{% set module_list = salt['pillar.get']('learn:modules', [] ) %}
|
{% set module_dict = salt['pillar.get']('learn:modules', [] ) %}
|
||||||
|
|
||||||
{% if module_list|length != 0 %}}
|
{% if module_list|length != 0 %}}
|
||||||
include:
|
include:
|
||||||
{% for module in module_list %}
|
{% for module, _ in module_dict %}
|
||||||
- .{{ module }}
|
- 'learn.{{ module }}'
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user