mal-simulator 2.0.0__tar.gz → 2.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mal_simulator-2.0.0/mal_simulator.egg-info → mal_simulator-2.0.1}/PKG-INFO +1 -1
- {mal_simulator-2.0.0 → mal_simulator-2.0.1/mal_simulator.egg-info}/PKG-INFO +1 -1
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/mal_simulator.egg-info/SOURCES.txt +3 -1
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/__init__.py +5 -5
- mal_simulator-2.0.1/malsim/config/__init__.py +12 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/config/agent_settings.py +0 -76
- mal_simulator-2.0.1/malsim/config/agent_settings_factories.py +80 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/attacker_state.py +1 -1
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/defender_state.py +1 -1
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/defender_step.py +1 -1
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/register_agent.py +1 -1
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/reset_agent.py +1 -1
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/run_simulation.py +1 -1
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/simulator.py +1 -1
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/state_query.py +1 -1
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/scenario/scenario.py +2 -2
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/pyproject.toml +1 -1
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/AUTHORS +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/LICENSE +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/README.md +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/mal_simulator.egg-info/dependency_links.txt +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/mal_simulator.egg-info/entry_points.txt +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/mal_simulator.egg-info/requires.txt +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/mal_simulator.egg-info/top_level.txt +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/__main__.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/config/node_property_rule.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/config/sim_settings.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/envs/__init__.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/envs/base_classes.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/envs/graph/__init__.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/envs/graph/graph_env.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/envs/graph/mal_spaces.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/envs/graph/serialization.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/envs/graph/utils.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/envs/graph/wrapper.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/envs/legacy/__init__.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/envs/legacy/gym_envs.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/envs/legacy/malsim_vectorized_obs_env.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/__init__.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/agent_state.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/attack_surface.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/attacker_state_factories.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/attacker_step.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/defender_state_factories.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/defense_surface.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/false_alerts.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/graph_processing.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/graph_state.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/graph_utils.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/node_getters.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/observability.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/rewards.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/simulator_state.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/ttc_utils.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/policies/__init__.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/policies/attackers/__init__.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/policies/attackers/searchers.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/policies/attackers/shortest_path.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/policies/attackers/ttc_soft_min.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/policies/decision_agent.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/policies/defenders/__init__.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/policies/defenders/heuristic_agent.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/policies/keyboard_input.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/policies/passive_agent.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/policies/random_agent.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/policies/utils/path_finding.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/scenario/__init__.py +0 -0
- {mal_simulator-2.0.0/malsim/mal_simulator → mal_simulator-2.0.1/malsim}/types.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/visualization/malsim_gui_client.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/setup.cfg +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/tests/test_graph_processing.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/tests/test_main.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/tests/test_mal_simulator.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/tests/test_scenario.py +0 -0
- {mal_simulator-2.0.0 → mal_simulator-2.0.1}/tests/test_ttc_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mal-simulator
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.1
|
|
4
4
|
Summary: A MAL compliant simulator.
|
|
5
5
|
Author-email: Andrei Buhaiu <buhaiu@kth.se>, Joakim Loxdal <loxdal@kth.se>, Jakob Nyberg <jaknyb@kth.se>, Nikolaos Kakouros <nkak@kth.se>, Sandor Berglund <sandorb@kth.se>
|
|
6
6
|
License: Apache Software License
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mal-simulator
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.1
|
|
4
4
|
Summary: A MAL compliant simulator.
|
|
5
5
|
Author-email: Andrei Buhaiu <buhaiu@kth.se>, Joakim Loxdal <loxdal@kth.se>, Jakob Nyberg <jaknyb@kth.se>, Nikolaos Kakouros <nkak@kth.se>, Sandor Berglund <sandorb@kth.se>
|
|
6
6
|
License: Apache Software License
|
|
@@ -10,7 +10,10 @@ mal_simulator.egg-info/requires.txt
|
|
|
10
10
|
mal_simulator.egg-info/top_level.txt
|
|
11
11
|
malsim/__init__.py
|
|
12
12
|
malsim/__main__.py
|
|
13
|
+
malsim/types.py
|
|
14
|
+
malsim/config/__init__.py
|
|
13
15
|
malsim/config/agent_settings.py
|
|
16
|
+
malsim/config/agent_settings_factories.py
|
|
14
17
|
malsim/config/node_property_rule.py
|
|
15
18
|
malsim/config/sim_settings.py
|
|
16
19
|
malsim/envs/__init__.py
|
|
@@ -48,7 +51,6 @@ malsim/mal_simulator/simulator.py
|
|
|
48
51
|
malsim/mal_simulator/simulator_state.py
|
|
49
52
|
malsim/mal_simulator/state_query.py
|
|
50
53
|
malsim/mal_simulator/ttc_utils.py
|
|
51
|
-
malsim/mal_simulator/types.py
|
|
52
54
|
malsim/policies/__init__.py
|
|
53
55
|
malsim/policies/decision_agent.py
|
|
54
56
|
malsim/policies/keyboard_input.py
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
|
-
# MAL Simulator v2.0.
|
|
2
|
+
# MAL Simulator v2.0.1
|
|
3
3
|
# Copyright 2025, Andrei Buhaiu.
|
|
4
4
|
#
|
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -23,12 +23,12 @@ from malsim.mal_simulator import (
|
|
|
23
23
|
run_simulation,
|
|
24
24
|
)
|
|
25
25
|
|
|
26
|
-
from malsim.scenario
|
|
27
|
-
from malsim.config
|
|
26
|
+
from malsim.scenario import Scenario
|
|
27
|
+
from malsim.config import AttackerSettings, DefenderSettings
|
|
28
28
|
|
|
29
29
|
__title__ = 'malsim'
|
|
30
|
-
__version__ = '2.0.
|
|
31
|
-
__authors__ = ['Andrei Buhaiu', 'Joakim Loxdal', 'Jakob Nyberg', 'Nikolaos Kakouros']
|
|
30
|
+
__version__ = '2.0.1'
|
|
31
|
+
__authors__ = ['Andrei Buhaiu', 'Joakim Loxdal', 'Jakob Nyberg', 'Nikolaos Kakouros', 'Sandor Berglund']
|
|
32
32
|
__license__ = 'Apache 2.0'
|
|
33
33
|
__docformat__ = 'restructuredtext en'
|
|
34
34
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from .agent_settings import AttackerSettings, DefenderSettings
|
|
2
|
+
from .sim_settings import MalSimulatorSettings, TTCMode, RewardMode
|
|
3
|
+
from .node_property_rule import NodePropertyRule
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
'AttackerSettings',
|
|
7
|
+
'DefenderSettings',
|
|
8
|
+
'MalSimulatorSettings',
|
|
9
|
+
'NodePropertyRule',
|
|
10
|
+
'RewardMode',
|
|
11
|
+
'TTCMode',
|
|
12
|
+
]
|
|
@@ -7,30 +7,6 @@ from typing import Any, Optional
|
|
|
7
7
|
from maltoolbox.attackgraph import AttackGraphNode
|
|
8
8
|
from malsim.config.node_property_rule import NodePropertyRule
|
|
9
9
|
|
|
10
|
-
from malsim.policies import (
|
|
11
|
-
BreadthFirstAttacker,
|
|
12
|
-
DepthFirstAttacker,
|
|
13
|
-
KeyboardAgent,
|
|
14
|
-
PassiveAgent,
|
|
15
|
-
DefendCompromisedDefender,
|
|
16
|
-
DefendFutureCompromisedDefender,
|
|
17
|
-
RandomAgent,
|
|
18
|
-
TTCSoftMinAttacker,
|
|
19
|
-
ShortestPathAttacker,
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
policy_name_to_class = {
|
|
23
|
-
'KeyboardAgent': KeyboardAgent,
|
|
24
|
-
'PassiveAgent': PassiveAgent,
|
|
25
|
-
'DepthFirstAttacker': DepthFirstAttacker,
|
|
26
|
-
'BreadthFirstAttacker': BreadthFirstAttacker,
|
|
27
|
-
'TTCSoftMinAttacker': TTCSoftMinAttacker,
|
|
28
|
-
'ShortestPathAttacker': ShortestPathAttacker,
|
|
29
|
-
'DefendCompromisedDefender': DefendCompromisedDefender,
|
|
30
|
-
'DefendFutureCompromisedDefender': DefendFutureCompromisedDefender,
|
|
31
|
-
'RandomAgent': RandomAgent,
|
|
32
|
-
}
|
|
33
|
-
|
|
34
10
|
|
|
35
11
|
class AgentType(Enum):
|
|
36
12
|
"""Enum for agent types"""
|
|
@@ -138,58 +114,6 @@ class DefenderSettings(AgentRuntimeMixin):
|
|
|
138
114
|
return d
|
|
139
115
|
|
|
140
116
|
|
|
141
|
-
def agent_settings_from_dict(
|
|
142
|
-
name: str,
|
|
143
|
-
d: dict[str, Any],
|
|
144
|
-
) -> AttackerSettings | DefenderSettings:
|
|
145
|
-
"""Load agent settings from a dict"""
|
|
146
|
-
|
|
147
|
-
agent_type = AgentType(d['type'])
|
|
148
|
-
|
|
149
|
-
# Resolve policy class if provided
|
|
150
|
-
policy = None
|
|
151
|
-
policy_name = d.get('policy') or d.get('agent_class')
|
|
152
|
-
if policy_name:
|
|
153
|
-
if policy_name not in policy_name_to_class:
|
|
154
|
-
raise LookupError(
|
|
155
|
-
f"Policy class '{policy_name}' not supported. "
|
|
156
|
-
f'Must be one of: {list(policy_name_to_class.keys())}'
|
|
157
|
-
)
|
|
158
|
-
policy = policy_name_to_class[policy_name]
|
|
159
|
-
|
|
160
|
-
config = d.get('config', {})
|
|
161
|
-
|
|
162
|
-
if agent_type == AgentType.ATTACKER:
|
|
163
|
-
return AttackerSettings(
|
|
164
|
-
name=name,
|
|
165
|
-
entry_points=set(d['entry_points']),
|
|
166
|
-
goals=set(d.get('goals', [])),
|
|
167
|
-
ttc_overrides=NodePropertyRule.from_optional_dict(d.get('ttc_overrides')),
|
|
168
|
-
policy=policy,
|
|
169
|
-
actionable_steps=NodePropertyRule.from_optional_dict(
|
|
170
|
-
d.get('actionable_steps')
|
|
171
|
-
),
|
|
172
|
-
rewards=NodePropertyRule.from_optional_dict(d.get('rewards')),
|
|
173
|
-
config=config,
|
|
174
|
-
)
|
|
175
|
-
|
|
176
|
-
# Defender
|
|
177
|
-
return DefenderSettings(
|
|
178
|
-
name=name,
|
|
179
|
-
policy=policy,
|
|
180
|
-
observable_steps=NodePropertyRule.from_optional_dict(d.get('observable_steps')),
|
|
181
|
-
actionable_steps=NodePropertyRule.from_optional_dict(d.get('actionable_steps')),
|
|
182
|
-
rewards=NodePropertyRule.from_optional_dict(d.get('rewards')),
|
|
183
|
-
false_positive_rates=NodePropertyRule.from_optional_dict(
|
|
184
|
-
d.get('false_positive_rates')
|
|
185
|
-
),
|
|
186
|
-
false_negative_rates=NodePropertyRule.from_optional_dict(
|
|
187
|
-
d.get('false_negative_rates')
|
|
188
|
-
),
|
|
189
|
-
config=config,
|
|
190
|
-
)
|
|
191
|
-
|
|
192
|
-
|
|
193
117
|
def get_defender_settings(
|
|
194
118
|
agent_settings: dict[str, DefenderSettings | AttackerSettings],
|
|
195
119
|
) -> dict[str, DefenderSettings]:
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
from malsim.config.agent_settings import AgentType, AttackerSettings, DefenderSettings
|
|
4
|
+
|
|
5
|
+
from malsim.config.node_property_rule import NodePropertyRule
|
|
6
|
+
from malsim.policies import (
|
|
7
|
+
BreadthFirstAttacker,
|
|
8
|
+
DepthFirstAttacker,
|
|
9
|
+
KeyboardAgent,
|
|
10
|
+
PassiveAgent,
|
|
11
|
+
DefendCompromisedDefender,
|
|
12
|
+
DefendFutureCompromisedDefender,
|
|
13
|
+
RandomAgent,
|
|
14
|
+
TTCSoftMinAttacker,
|
|
15
|
+
ShortestPathAttacker,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
policy_name_to_class = {
|
|
19
|
+
'KeyboardAgent': KeyboardAgent,
|
|
20
|
+
'PassiveAgent': PassiveAgent,
|
|
21
|
+
'DepthFirstAttacker': DepthFirstAttacker,
|
|
22
|
+
'BreadthFirstAttacker': BreadthFirstAttacker,
|
|
23
|
+
'TTCSoftMinAttacker': TTCSoftMinAttacker,
|
|
24
|
+
'ShortestPathAttacker': ShortestPathAttacker,
|
|
25
|
+
'DefendCompromisedDefender': DefendCompromisedDefender,
|
|
26
|
+
'DefendFutureCompromisedDefender': DefendFutureCompromisedDefender,
|
|
27
|
+
'RandomAgent': RandomAgent,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def agent_settings_from_dict(
|
|
32
|
+
name: str,
|
|
33
|
+
d: dict[str, Any],
|
|
34
|
+
) -> AttackerSettings | DefenderSettings:
|
|
35
|
+
"""Load agent settings from a dict"""
|
|
36
|
+
|
|
37
|
+
agent_type = AgentType(d['type'])
|
|
38
|
+
|
|
39
|
+
# Resolve policy class if provided
|
|
40
|
+
policy = None
|
|
41
|
+
policy_name = d.get('policy') or d.get('agent_class')
|
|
42
|
+
if policy_name:
|
|
43
|
+
if policy_name not in policy_name_to_class:
|
|
44
|
+
raise LookupError(
|
|
45
|
+
f"Policy class '{policy_name}' not supported. "
|
|
46
|
+
f'Must be one of: {list(policy_name_to_class.keys())}'
|
|
47
|
+
)
|
|
48
|
+
policy = policy_name_to_class[policy_name]
|
|
49
|
+
|
|
50
|
+
config = d.get('config', {})
|
|
51
|
+
|
|
52
|
+
if agent_type == AgentType.ATTACKER:
|
|
53
|
+
return AttackerSettings(
|
|
54
|
+
name=name,
|
|
55
|
+
entry_points=set(d['entry_points']),
|
|
56
|
+
goals=set(d.get('goals', [])),
|
|
57
|
+
ttc_overrides=NodePropertyRule.from_optional_dict(d.get('ttc_overrides')),
|
|
58
|
+
policy=policy,
|
|
59
|
+
actionable_steps=NodePropertyRule.from_optional_dict(
|
|
60
|
+
d.get('actionable_steps')
|
|
61
|
+
),
|
|
62
|
+
rewards=NodePropertyRule.from_optional_dict(d.get('rewards')),
|
|
63
|
+
config=config,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
# Defender
|
|
67
|
+
return DefenderSettings(
|
|
68
|
+
name=name,
|
|
69
|
+
policy=policy,
|
|
70
|
+
observable_steps=NodePropertyRule.from_optional_dict(d.get('observable_steps')),
|
|
71
|
+
actionable_steps=NodePropertyRule.from_optional_dict(d.get('actionable_steps')),
|
|
72
|
+
rewards=NodePropertyRule.from_optional_dict(d.get('rewards')),
|
|
73
|
+
false_positive_rates=NodePropertyRule.from_optional_dict(
|
|
74
|
+
d.get('false_positive_rates')
|
|
75
|
+
),
|
|
76
|
+
false_negative_rates=NodePropertyRule.from_optional_dict(
|
|
77
|
+
d.get('false_negative_rates')
|
|
78
|
+
),
|
|
79
|
+
config=config,
|
|
80
|
+
)
|
|
@@ -5,7 +5,7 @@ from maltoolbox.attackgraph import AttackGraphNode
|
|
|
5
5
|
from malsim.config.node_property_rule import NodePropertyRule
|
|
6
6
|
from malsim.mal_simulator.agent_state import MalSimAgentState
|
|
7
7
|
from malsim.mal_simulator.ttc_utils import TTCDist
|
|
8
|
-
from malsim.
|
|
8
|
+
from malsim.types import AgentStates
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
@dataclass(frozen=True)
|
|
@@ -4,7 +4,7 @@ from typing import Any, Optional
|
|
|
4
4
|
from maltoolbox.attackgraph import AttackGraphNode
|
|
5
5
|
from malsim.config.node_property_rule import NodePropertyRule
|
|
6
6
|
from malsim.mal_simulator.agent_state import MalSimAgentState
|
|
7
|
-
from malsim.
|
|
7
|
+
from malsim.types import AgentStates
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
@dataclass(frozen=True)
|
|
@@ -10,7 +10,7 @@ from malsim.mal_simulator.graph_utils import node_reward
|
|
|
10
10
|
from malsim.mal_simulator.simulator_state import MalSimulatorState
|
|
11
11
|
|
|
12
12
|
if TYPE_CHECKING:
|
|
13
|
-
from malsim.
|
|
13
|
+
from malsim.types import AgentStates
|
|
14
14
|
from malsim.mal_simulator.defender_state import MalSimDefenderState
|
|
15
15
|
|
|
16
16
|
logger = logging.getLogger(__name__)
|
|
@@ -12,7 +12,7 @@ from malsim.mal_simulator.reset_agent import reset_agents
|
|
|
12
12
|
from malsim.mal_simulator.rewards import attacker_step_reward, defender_step_reward
|
|
13
13
|
from malsim.mal_simulator.simulator_state import MalSimulatorState
|
|
14
14
|
from malsim.config.agent_settings import AttackerSettings, DefenderSettings
|
|
15
|
-
from malsim.
|
|
15
|
+
from malsim.types import AgentRewards, AgentStates, AgentSettings
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
def register_attacker_settings(
|
|
@@ -10,7 +10,7 @@ from malsim.mal_simulator.defender_state_factories import initial_defender_state
|
|
|
10
10
|
from malsim.mal_simulator.rewards import attacker_step_reward, defender_step_reward
|
|
11
11
|
from malsim.mal_simulator.simulator_state import MalSimulatorState
|
|
12
12
|
from malsim.config.agent_settings import get_defender_settings, get_attacker_settings
|
|
13
|
-
from malsim.
|
|
13
|
+
from malsim.types import AgentRewards, AgentStates, AgentSettings
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
def reset_attackers(
|
|
@@ -4,7 +4,7 @@ from maltoolbox.attackgraph import AttackGraphNode
|
|
|
4
4
|
|
|
5
5
|
from malsim.policies.decision_agent import DecisionAgent
|
|
6
6
|
from malsim.mal_simulator.simulator import MalSimulator
|
|
7
|
-
from malsim.
|
|
7
|
+
from malsim.types import AgentSettings
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
def run_simulation(
|
|
@@ -38,7 +38,7 @@ from malsim.mal_simulator.false_alerts import (
|
|
|
38
38
|
node_false_positive_rate,
|
|
39
39
|
)
|
|
40
40
|
from malsim.config.agent_settings import AttackerSettings, DefenderSettings
|
|
41
|
-
from malsim.
|
|
41
|
+
from malsim.types import (
|
|
42
42
|
AgentRewards,
|
|
43
43
|
AgentStates,
|
|
44
44
|
AgentSettings,
|
|
@@ -9,7 +9,7 @@ from malsim.mal_simulator.attacker_state import MalSimAttackerState, get_attacke
|
|
|
9
9
|
from malsim.mal_simulator.defender_state import get_defender_agents
|
|
10
10
|
from malsim.mal_simulator.node_getters import full_name_or_node_to_node
|
|
11
11
|
from malsim.config.sim_settings import TTCMode
|
|
12
|
-
from malsim.
|
|
12
|
+
from malsim.types import AgentStates
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
def node_is_enabled_defense(
|
|
@@ -23,11 +23,11 @@ from maltoolbox.model import Model
|
|
|
23
23
|
from maltoolbox.language import LanguageGraph
|
|
24
24
|
from maltoolbox.attackgraph import create_attack_graph
|
|
25
25
|
|
|
26
|
-
from malsim.config
|
|
26
|
+
from malsim.config import (
|
|
27
27
|
DefenderSettings,
|
|
28
28
|
AttackerSettings,
|
|
29
|
-
agent_settings_from_dict,
|
|
30
29
|
)
|
|
30
|
+
from malsim.config.agent_settings_factories import agent_settings_from_dict
|
|
31
31
|
from malsim.config.node_property_rule import NodePropertyRule
|
|
32
32
|
|
|
33
33
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/attacker_state_factories.py
RENAMED
|
File without changes
|
|
File without changes
|
{mal_simulator-2.0.0 → mal_simulator-2.0.1}/malsim/mal_simulator/defender_state_factories.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|