mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-08 02:02:50 +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
|
||||
def get_learn_modules():
|
||||
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.' }
|
||||
]
|
||||
return {
|
||||
'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):
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{% from 'allowed_states.map.jinja' import 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 %}}
|
||||
include:
|
||||
{% for module in module_list %}
|
||||
- .{{ module }}
|
||||
{% for module, _ in module_dict %}
|
||||
- 'learn.{{ module }}'
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user