forked from p15670423/monkey
island: Replace config "filter" for "manipulator" as file names/constants/functions
This commit is contained in:
parent
af86cb088f
commit
7b79c297b9
|
@ -3,7 +3,7 @@ from typing import Dict
|
|||
import dpath.util
|
||||
|
||||
import monkey_island.cc.services.config as config_service
|
||||
from monkey_island.cc.services.config_filters import FILTER_PER_MODE
|
||||
from monkey_island.cc.services.config_manipulators import MANIPULATOR_PER_MODE
|
||||
from monkey_island.cc.services.mode.mode_enum import IslandModeEnum
|
||||
|
||||
|
||||
|
@ -20,12 +20,12 @@ def update_config_per_mode(mode: str, config: Dict, should_encrypt: bool) -> boo
|
|||
|
||||
|
||||
def _set_default_config_values_per_mode(mode: str, config: Dict) -> Dict:
|
||||
config_filter = FILTER_PER_MODE[mode]
|
||||
config = _apply_config_filter(config, config_filter)
|
||||
config_manipulator = MANIPULATOR_PER_MODE[mode]
|
||||
config = _apply_config_manipulator(config, config_manipulator)
|
||||
return config
|
||||
|
||||
|
||||
def _apply_config_filter(config: Dict, config_filter: Dict):
|
||||
for path, value in config_filter.items():
|
||||
def _apply_config_manipulator(config: Dict, config_manipulator: Dict):
|
||||
for path, value in config_manipulator.items():
|
||||
dpath.util.set(config, path, value, ".")
|
||||
return config
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from monkey_island.cc.services.mode.mode_enum import IslandModeEnum
|
||||
|
||||
FILTER_PER_MODE = {
|
||||
MANIPULATOR_PER_MODE = {
|
||||
IslandModeEnum.ADVANCED.value: {},
|
||||
IslandModeEnum.RANSOMWARE.value: {"monkey.post_breach.post_breach_actions": []},
|
||||
}
|
Loading…
Reference in New Issue