mal-simulator 3.1.0__tar.gz → 3.2.0__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-3.1.0/mal_simulator.egg-info → mal_simulator-3.2.0}/PKG-INFO +1 -1
- {mal_simulator-3.1.0 → mal_simulator-3.2.0/mal_simulator.egg-info}/PKG-INFO +1 -1
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/__init__.py +2 -2
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/scenario/scenario.py +5 -2
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/pyproject.toml +1 -1
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/tests/test_scenario.py +33 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/AUTHORS +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/LICENSE +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/README.md +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/mal_simulator.egg-info/SOURCES.txt +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/mal_simulator.egg-info/dependency_links.txt +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/mal_simulator.egg-info/entry_points.txt +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/mal_simulator.egg-info/requires.txt +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/mal_simulator.egg-info/top_level.txt +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/__main__.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/config/__init__.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/config/agent_settings.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/config/agent_settings_factories.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/config/node_property_rule.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/config/sim_settings.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/envs/__init__.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/envs/base_classes.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/envs/graph/__init__.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/envs/graph/graph_env.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/envs/graph/mal_spaces.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/envs/graph/serialization.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/envs/graph/utils.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/envs/graph/wrapper.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/__init__.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/agent_state.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/agent_states.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/attack_surface.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/attacker_state.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/attacker_state_factories.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/attacker_step.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/defender_state.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/defender_state_factories.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/defender_step.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/defense_surface.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/event_logger.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/false_alerts.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/graph_processing.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/graph_state.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/graph_utils.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/node_getters.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/observability.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/reset_agent.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/rewards.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/run_simulation.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/simulator.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/simulator_state.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/simulator_static_data.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/state_query.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/ttc_utils.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/policies/__init__.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/policies/attackers/__init__.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/policies/attackers/searchers.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/policies/attackers/shortest_path.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/policies/attackers/ttc_soft_min.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/policies/decision_agent.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/policies/defenders/__init__.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/policies/defenders/heuristic_agent.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/policies/keyboard_input.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/policies/passive_agent.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/policies/random_agent.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/policies/utils/path_finding.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/scenario/__init__.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/types.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/visualization/malsim_gui_client.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/setup.cfg +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/tests/test_attacker.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/tests/test_attacker_settings.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/tests/test_defender.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/tests/test_event_logger.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/tests/test_graph_processing.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/tests/test_main.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/tests/test_mal_simulator.py +0 -0
- {mal_simulator-3.1.0 → mal_simulator-3.2.0}/tests/test_ttc_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mal-simulator
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.2.0
|
|
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: 3.
|
|
3
|
+
Version: 3.2.0
|
|
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,4 +1,4 @@
|
|
|
1
|
-
# MAL Simulator v3.
|
|
1
|
+
# MAL Simulator v3.2.0
|
|
2
2
|
# Copyright 2025, Andrei Buhaiu.
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -26,7 +26,7 @@ from malsim.scenario import Scenario
|
|
|
26
26
|
from malsim.config import AttackerSettings, DefenderSettings
|
|
27
27
|
|
|
28
28
|
__title__ = 'malsim'
|
|
29
|
-
__version__ = '3.
|
|
29
|
+
__version__ = '3.2.0'
|
|
30
30
|
__authors__ = [
|
|
31
31
|
'Andrei Buhaiu',
|
|
32
32
|
'Joakim Loxdal',
|
|
@@ -273,8 +273,11 @@ def load_scenario_dict(scenario_file: str) -> Mapping[str, Any]:
|
|
|
273
273
|
)
|
|
274
274
|
scenario = dict(_extend_scenario(original_scenario_path, scenario))
|
|
275
275
|
|
|
276
|
-
# Convert path relative to scenario file
|
|
277
|
-
scenario['lang_file']
|
|
276
|
+
# Convert path relative to scenario file if lang_file is a local file
|
|
277
|
+
if not scenario['lang_file'].startswith('git@'):
|
|
278
|
+
scenario['lang_file'] = path_relative_to_file_dir(
|
|
279
|
+
scenario['lang_file'], s_file
|
|
280
|
+
)
|
|
278
281
|
|
|
279
282
|
if 'model_file' in scenario:
|
|
280
283
|
scenario['model_file'] = path_relative_to_file_dir(
|
|
@@ -56,6 +56,39 @@ def test_load_scenario() -> None:
|
|
|
56
56
|
assert scenario.defender_settings['Defender1'].policy == PassiveAgent
|
|
57
57
|
|
|
58
58
|
|
|
59
|
+
@pytest.mark.integration
|
|
60
|
+
def test_load_scenario_git_url_as_lang() -> None:
|
|
61
|
+
"""Make sure we can load a scenario with git url as lang file"""
|
|
62
|
+
|
|
63
|
+
# Load the scenario
|
|
64
|
+
scenario = Scenario.load_from_file(
|
|
65
|
+
path_relative_to_tests('./testdata/scenarios/simple_scenario_git_url.yml')
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
# Results should be the same as loading the scenario with a local lang file
|
|
69
|
+
assert scenario.defender_settings['Defender1'].rewards
|
|
70
|
+
rewards_per_node = scenario.defender_settings['Defender1'].rewards
|
|
71
|
+
assert rewards_per_node.by_asset_name
|
|
72
|
+
# Verify rewards were added as defined in './testdata/simple_scenario_git_url.yml'
|
|
73
|
+
assert rewards_per_node.by_asset_name['OS App']['notPresent'] == 2
|
|
74
|
+
assert rewards_per_node.by_asset_name['OS App']['supplyChainAuditing'] == 7
|
|
75
|
+
assert rewards_per_node.by_asset_name['Program 1']['notPresent'] == 3
|
|
76
|
+
assert rewards_per_node.by_asset_name['Program 1']['supplyChainAuditing'] == 7
|
|
77
|
+
assert rewards_per_node.by_asset_name['SoftwareVulnerability:4']['notPresent'] == 4
|
|
78
|
+
assert rewards_per_node.by_asset_name['Data:5']['notPresent'] == 1
|
|
79
|
+
assert rewards_per_node.by_asset_name['Credentials:6']['notPhishable'] == 7
|
|
80
|
+
assert rewards_per_node.by_asset_name['Identity:11']['notPresent'] == 3.5
|
|
81
|
+
|
|
82
|
+
# Verify attacker entrypoint was added
|
|
83
|
+
attack_step = get_node(scenario.attack_graph, 'OS App:fullAccess')
|
|
84
|
+
attacker1 = scenario.attacker_settings['Attacker1']
|
|
85
|
+
assert isinstance(attacker1, AttackerSettings)
|
|
86
|
+
assert attack_step in attacker1.entry_points
|
|
87
|
+
|
|
88
|
+
assert scenario.attacker_settings['Attacker1'].policy == BreadthFirstAttacker
|
|
89
|
+
assert scenario.defender_settings['Defender1'].policy == PassiveAgent
|
|
90
|
+
|
|
91
|
+
|
|
59
92
|
def test_save_scenario(model: Model, tmp_path: Any) -> None:
|
|
60
93
|
"""Make sure we can load and save a scenario"""
|
|
61
94
|
|
|
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
|
{mal_simulator-3.1.0 → mal_simulator-3.2.0}/malsim/mal_simulator/attacker_state_factories.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mal_simulator-3.1.0 → mal_simulator-3.2.0}/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
|
|
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
|