island: Replace config "filter" for "manipulator" as file names/constants/functions

This commit is contained in:
Shreya 2021-07-20 16:31:28 +05:30
parent af86cb088f
commit 7b79c297b9
2 changed files with 6 additions and 6 deletions

View File

@ -3,7 +3,7 @@ from typing import Dict
import dpath.util import dpath.util
import monkey_island.cc.services.config as config_service 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 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: def _set_default_config_values_per_mode(mode: str, config: Dict) -> Dict:
config_filter = FILTER_PER_MODE[mode] config_manipulator = MANIPULATOR_PER_MODE[mode]
config = _apply_config_filter(config, config_filter) config = _apply_config_manipulator(config, config_manipulator)
return config return config
def _apply_config_filter(config: Dict, config_filter: Dict): def _apply_config_manipulator(config: Dict, config_manipulator: Dict):
for path, value in config_filter.items(): for path, value in config_manipulator.items():
dpath.util.set(config, path, value, ".") dpath.util.set(config, path, value, ".")
return config return config

View File

@ -1,6 +1,6 @@
from monkey_island.cc.services.mode.mode_enum import IslandModeEnum from monkey_island.cc.services.mode.mode_enum import IslandModeEnum
FILTER_PER_MODE = { MANIPULATOR_PER_MODE = {
IslandModeEnum.ADVANCED.value: {}, IslandModeEnum.ADVANCED.value: {},
IslandModeEnum.RANSOMWARE.value: {"monkey.post_breach.post_breach_actions": []}, IslandModeEnum.RANSOMWARE.value: {"monkey.post_breach.post_breach_actions": []},
} }