mal-toolbox 1.1.2__tar.gz → 1.1.3__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_toolbox-1.1.2/mal_toolbox.egg-info → mal_toolbox-1.1.3}/PKG-INFO +1 -1
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3/mal_toolbox.egg-info}/PKG-INFO +1 -1
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/__init__.py +2 -2
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/language/languagegraph.py +8 -15
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/model.py +0 -21
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/pyproject.toml +1 -1
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/AUTHORS +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/LICENSE +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/README.md +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/mal_toolbox.egg-info/SOURCES.txt +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/mal_toolbox.egg-info/dependency_links.txt +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/mal_toolbox.egg-info/entry_points.txt +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/mal_toolbox.egg-info/requires.txt +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/mal_toolbox.egg-info/top_level.txt +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/__main__.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/attackgraph/__init__.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/attackgraph/analyzers/__init__.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/attackgraph/attackgraph.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/attackgraph/node.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/exceptions.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/file_utils.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/language/__init__.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/language/compiler/__init__.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/language/compiler/mal_lexer.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/language/compiler/mal_parser.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/patternfinder/__init__.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/patternfinder/attackgraph_patterns.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/py.typed +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/translators/__init__.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/translators/networkx.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/translators/updater.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/visualization/__init__.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/visualization/draw_io_utils.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/visualization/graphviz_utils.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/visualization/neo4j_utils.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/maltoolbox/visualization/utils.py +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/setup.cfg +0 -0
- {mal_toolbox-1.1.2 → mal_toolbox-1.1.3}/tests/test_model.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mal-toolbox
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.3
|
|
4
4
|
Summary: A collection of tools used to create MAL models and attack graphs.
|
|
5
5
|
Author-email: Andrei Buhaiu <buhaiu@kth.se>, Joakim Loxdal <loxdal@kth.se>, Nikolaos Kakouros <nkak@kth.se>, Jakob Nyberg <jaknyb@kth.se>, Giuseppe Nebbione <nebbione@kth.se>, Sandor Berglund <sandor@kth.se>
|
|
6
6
|
License: Apache Software License
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mal-toolbox
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.3
|
|
4
4
|
Summary: A collection of tools used to create MAL models and attack graphs.
|
|
5
5
|
Author-email: Andrei Buhaiu <buhaiu@kth.se>, Joakim Loxdal <loxdal@kth.se>, Nikolaos Kakouros <nkak@kth.se>, Jakob Nyberg <jaknyb@kth.se>, Giuseppe Nebbione <nebbione@kth.se>, Sandor Berglund <sandor@kth.se>
|
|
6
6
|
License: Apache Software License
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# MAL Toolbox v1.1.
|
|
1
|
+
# MAL Toolbox v1.1.3
|
|
2
2
|
# Copyright 2025, Andrei Buhaiu.
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
21
|
__title__ = "maltoolbox"
|
|
22
|
-
__version__ = "1.1.
|
|
22
|
+
__version__ = "1.1.3"
|
|
23
23
|
__authors__ = [
|
|
24
24
|
"Andrei Buhaiu",
|
|
25
25
|
"Giuseppe Nebbione",
|
|
@@ -80,7 +80,7 @@ class LanguageGraphAsset:
|
|
|
80
80
|
field(default_factory=dict)
|
|
81
81
|
info: dict = field(default_factory=dict)
|
|
82
82
|
own_super_asset: LanguageGraphAsset | None = None
|
|
83
|
-
own_sub_assets:
|
|
83
|
+
own_sub_assets: list[LanguageGraphAsset] = field(default_factory=list)
|
|
84
84
|
own_variables: dict = field(default_factory=dict)
|
|
85
85
|
is_abstract: bool | None = None
|
|
86
86
|
|
|
@@ -115,7 +115,7 @@ class LanguageGraphAsset:
|
|
|
115
115
|
return f'LanguageGraphAsset(name: "{self.name}")'
|
|
116
116
|
|
|
117
117
|
def __hash__(self):
|
|
118
|
-
return
|
|
118
|
+
return id(self)
|
|
119
119
|
|
|
120
120
|
def is_subasset_of(self, target_asset: LanguageGraphAsset) -> bool:
|
|
121
121
|
"""Check if an asset extends the target asset through inheritance.
|
|
@@ -383,7 +383,7 @@ class LanguageGraphAttackStep:
|
|
|
383
383
|
detectors: dict = field(default_factory=dict)
|
|
384
384
|
|
|
385
385
|
def __hash__(self):
|
|
386
|
-
return
|
|
386
|
+
return id(self)
|
|
387
387
|
|
|
388
388
|
@property
|
|
389
389
|
def children(self) -> dict[
|
|
@@ -773,7 +773,7 @@ class LanguageGraph:
|
|
|
773
773
|
attack_steps={},
|
|
774
774
|
info=asset['info'],
|
|
775
775
|
own_super_asset=None,
|
|
776
|
-
own_sub_assets=
|
|
776
|
+
own_sub_assets=list(),
|
|
777
777
|
own_variables={},
|
|
778
778
|
is_abstract=asset['is_abstract']
|
|
779
779
|
)
|
|
@@ -788,7 +788,8 @@ class LanguageGraph:
|
|
|
788
788
|
msg = f'Super asset "{super_name}" for "{asset["name"]}" not found'
|
|
789
789
|
logger.error(msg)
|
|
790
790
|
raise LanguageGraphSuperAssetNotFoundError(msg)
|
|
791
|
-
|
|
791
|
+
|
|
792
|
+
super_asset.own_sub_assets.append(asset_node)
|
|
792
793
|
asset_node.own_super_asset = super_asset
|
|
793
794
|
|
|
794
795
|
# Associations
|
|
@@ -1454,7 +1455,7 @@ class LanguageGraph:
|
|
|
1454
1455
|
raise LanguageGraphSuperAssetNotFoundError(
|
|
1455
1456
|
msg % (asset_dict["superAsset"], asset_dict["name"]))
|
|
1456
1457
|
|
|
1457
|
-
super_asset.own_sub_assets.
|
|
1458
|
+
super_asset.own_sub_assets.append(asset)
|
|
1458
1459
|
asset.own_super_asset = super_asset
|
|
1459
1460
|
|
|
1460
1461
|
def _set_variables_for_assets(
|
|
@@ -1625,7 +1626,7 @@ class LanguageGraph:
|
|
|
1625
1626
|
attack_steps={},
|
|
1626
1627
|
info=asset_dict['meta'],
|
|
1627
1628
|
own_super_asset=None,
|
|
1628
|
-
own_sub_assets=
|
|
1629
|
+
own_sub_assets=list(),
|
|
1629
1630
|
own_variables={},
|
|
1630
1631
|
is_abstract=asset_dict['isAbstract']
|
|
1631
1632
|
)
|
|
@@ -1781,11 +1782,3 @@ class LanguageGraph:
|
|
|
1781
1782
|
"""
|
|
1782
1783
|
self.assets = {}
|
|
1783
1784
|
self._generate_graph()
|
|
1784
|
-
|
|
1785
|
-
def __getstate__(self):
|
|
1786
|
-
return self._to_dict()
|
|
1787
|
-
|
|
1788
|
-
def __setstate__(self, state):
|
|
1789
|
-
temp_lang_graph = self._from_dict(state)
|
|
1790
|
-
self.assets = temp_lang_graph.assets
|
|
1791
|
-
self.metadata = temp_lang_graph.metadata
|
|
@@ -310,27 +310,6 @@ class Model:
|
|
|
310
310
|
"Try to upgrade it with 'maltoolbox upgrade-model'"
|
|
311
311
|
) from e
|
|
312
312
|
|
|
313
|
-
def __getstate__(self):
|
|
314
|
-
lang_state = self.lang_graph.__getstate__()
|
|
315
|
-
state = self._to_dict()
|
|
316
|
-
return {
|
|
317
|
-
'model_state': state,
|
|
318
|
-
'lang_graph': lang_state
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
def __setstate__(self, state):
|
|
322
|
-
# Restore the language graph first
|
|
323
|
-
lang_graph = LanguageGraph.__new__(LanguageGraph)
|
|
324
|
-
lang_graph.__setstate__(state['lang_graph'])
|
|
325
|
-
self.lang_graph = lang_graph
|
|
326
|
-
|
|
327
|
-
# Restore the model state by creating a temporary model and copying attributes
|
|
328
|
-
temp_model = self._from_dict(state['model_state'], self.lang_graph)
|
|
329
|
-
self.name = temp_model.name
|
|
330
|
-
self.assets = temp_model.assets
|
|
331
|
-
self._name_to_asset = temp_model._name_to_asset
|
|
332
|
-
self.maltoolbox_version = temp_model.maltoolbox_version
|
|
333
|
-
self.next_id = temp_model.next_id
|
|
334
313
|
|
|
335
314
|
class ModelAsset:
|
|
336
315
|
def __init__(
|
|
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
|