mal-toolbox 0.1.10__tar.gz → 0.1.11__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.
Files changed (39) hide show
  1. {mal_toolbox-0.1.10/mal_toolbox.egg-info → mal_toolbox-0.1.11}/PKG-INFO +1 -1
  2. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11/mal_toolbox.egg-info}/PKG-INFO +1 -1
  3. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/__init__.py +2 -2
  4. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/model.py +5 -1
  5. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/pyproject.toml +1 -1
  6. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/tests/test_model.py +22 -0
  7. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/AUTHORS +0 -0
  8. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/LICENSE +0 -0
  9. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/README.md +0 -0
  10. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/mal_toolbox.egg-info/SOURCES.txt +0 -0
  11. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/mal_toolbox.egg-info/dependency_links.txt +0 -0
  12. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/mal_toolbox.egg-info/requires.txt +0 -0
  13. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/mal_toolbox.egg-info/top_level.txt +0 -0
  14. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/__main__.py +0 -0
  15. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/attackgraph/__init__.py +0 -0
  16. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/attackgraph/analyzers/__init__.py +0 -0
  17. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/attackgraph/analyzers/apriori.py +0 -0
  18. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/attackgraph/attacker.py +0 -0
  19. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/attackgraph/attackgraph.py +0 -0
  20. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/attackgraph/node.py +0 -0
  21. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/attackgraph/query.py +0 -0
  22. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/default.conf +0 -0
  23. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/exceptions.py +0 -0
  24. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/file_utils.py +0 -0
  25. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/ingestors/__init__.py +0 -0
  26. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/ingestors/neo4j.py +0 -0
  27. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/language/__init__.py +0 -0
  28. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/language/classes_factory.py +0 -0
  29. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/language/compiler/__init__.py +0 -0
  30. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/language/compiler/mal_lexer.py +0 -0
  31. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/language/compiler/mal_parser.py +0 -0
  32. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/language/compiler/mal_visitor.py +0 -0
  33. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/language/languagegraph.py +0 -0
  34. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/translators/__init__.py +0 -0
  35. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/translators/securicad.py +0 -0
  36. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/translators/updater.py +0 -0
  37. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/maltoolbox/wrappers.py +0 -0
  38. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/setup.cfg +0 -0
  39. {mal_toolbox-0.1.10 → mal_toolbox-0.1.11}/tests/test_wrappers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mal-toolbox
3
- Version: 0.1.10
3
+ Version: 0.1.11
4
4
  Summary: A collection of tools used to create MAL models and attack graphs.
5
5
  Author-email: Andrei Buhaiu <buhaiu@kth.se>, Giuseppe Nebbione <nebbione@kth.se>, Nikolaos Kakouros <nkak@kth.se>, Jakob Nyberg <jaknyb@kth.se>, Joakim Loxdal <loxdal@kth.se>
6
6
  License: Apache Software License
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mal-toolbox
3
- Version: 0.1.10
3
+ Version: 0.1.11
4
4
  Summary: A collection of tools used to create MAL models and attack graphs.
5
5
  Author-email: Andrei Buhaiu <buhaiu@kth.se>, Giuseppe Nebbione <nebbione@kth.se>, Nikolaos Kakouros <nkak@kth.se>, Jakob Nyberg <jaknyb@kth.se>, Joakim Loxdal <loxdal@kth.se>
6
6
  License: Apache Software License
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # MAL Toolbox v0.1.10
2
+ # MAL Toolbox v0.1.11
3
3
  # Copyright 2024, Andrei Buhaiu.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@ MAL-Toolbox Framework
21
21
  """
22
22
 
23
23
  __title__ = 'maltoolbox'
24
- __version__ = '0.1.10'
24
+ __version__ = '0.1.11'
25
25
  __authors__ = ['Andrei Buhaiu',
26
26
  'Giuseppe Nebbione',
27
27
  'Nikolaos Kakouros',
@@ -207,6 +207,10 @@ class Model():
207
207
  )
208
208
  self.assets.append(asset)
209
209
 
210
+ def remove_attacker(self, attacker: AttackerAttachment) -> None:
211
+ """Remove attacker"""
212
+ self.attackers.remove(attacker)
213
+
210
214
  def remove_asset(self, asset: SchemaGeneratedClass) -> None:
211
215
  """Remove an asset from the model.
212
216
 
@@ -659,7 +663,7 @@ class Model():
659
663
 
660
664
  if asset.extras:
661
665
  # Add optional metadata to dict
662
- asset_dict['extras'] = asset.extras
666
+ asset_dict['extras'] = asset.extras.as_dict()
663
667
 
664
668
  return (asset.id, asset_dict)
665
669
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mal-toolbox"
3
- version = "0.1.10"
3
+ version = "0.1.11"
4
4
  authors = [
5
5
  { name="Andrei Buhaiu", email="buhaiu@kth.se" },
6
6
  { name="Giuseppe Nebbione", email="nebbione@kth.se" },
@@ -195,6 +195,27 @@ def test_attacker_attachment_remove_asset(model: Model):
195
195
  assert attacker2.entry_points[0][1] == ['read']
196
196
 
197
197
 
198
+ def test_add_remove_attacker(model: Model):
199
+ """"""
200
+
201
+ asset1 = create_application_asset(model, "Asset1")
202
+ model.add_asset(asset1)
203
+
204
+ attacker1 = AttackerAttachment()
205
+ model.add_attacker(attacker1)
206
+ attacker2 = AttackerAttachment()
207
+ model.add_attacker(attacker2)
208
+
209
+ attacker1.add_entry_point(asset1, 'read')
210
+ attacker1.add_entry_point(asset1, 'access')
211
+ attacker2.add_entry_point(asset1, 'read')
212
+
213
+ assert len(model.attackers) == 2
214
+ model.remove_attacker(attacker1)
215
+ assert len(model.attackers) == 1
216
+ model.remove_attacker(attacker2)
217
+ assert len(model.attackers) == 0
218
+
198
219
  def test_model_add_asset(model: Model):
199
220
  """Make sure assets are added correctly"""
200
221
 
@@ -815,6 +836,7 @@ def test_model_save_and_load_model_from_scratch(model: Model):
815
836
 
816
837
  # Create and add 3 applications
817
838
  p1 = create_application_asset(model, "Program 1")
839
+ p1.extras = {"testing": "testing"}
818
840
  p2 = create_application_asset(model, "Program 2")
819
841
  p3 = create_application_asset(model, "Program 3")
820
842
  model.add_asset(p1)
File without changes
File without changes
File without changes
File without changes