From 5e74eab276ff1b0f642acb558023bd72cffc2739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Antol=C3=ADn?= <99404665+dantolin-iriusrisk@users.noreply.github.com> Date: Tue, 16 Jul 2024 15:14:22 +0200 Subject: [PATCH] [feature/BLAZ-202] to dev (#381) * [BLAZ-202] Only first MTMT is processed and representation is calculated for line boundaries * [BLAZ-202] Fixed wrong import * [BLAZ-202] Fixed wrong parent calculation in complex nesting scenarios * [BLAZ-202] Fixed setuptools-scm problem with last git version --- .github/actions/install-startleft/action.yml | 2 +- .../trustzone_representation_calculator.py | 4 +- ...est_trustzone_representation_calculator.py | 3 +- setup.py | 2 +- slp_mtmt/slp_mtmt/mtmt_loader.py | 10 +- slp_mtmt/slp_mtmt/mtmt_parser.py | 6 +- .../slp_mtmt/parse/mtmt_general_parser.py | 6 +- .../slp_mtmt/parse/mtmt_trustzone_parser.py | 2 +- .../component_representation_calculator.py | 6 +- .../trustzone_representation_calculator.py | 12 +- ...T_example_coordinates_1_line_trustzone.otm | 130 ++++++++++++++++ .../MTMT_example_coordinates_1_orphan.otm | 143 ++++++++++++++++++ slp_mtmt/tests/resources/otm/nested_tz.otm | 93 +++++++++++- .../tests/resources/otm/nested_tz_line.otm | 93 +++++++++++- 14 files changed, 488 insertions(+), 24 deletions(-) diff --git a/.github/actions/install-startleft/action.yml b/.github/actions/install-startleft/action.yml index eb8c75a6..a27a7d2f 100644 --- a/.github/actions/install-startleft/action.yml +++ b/.github/actions/install-startleft/action.yml @@ -15,7 +15,7 @@ runs: python-version: ${{ inputs.python-version }} - name: Update pip version to 23.0.1 - run: python -m pip install --upgrade pip==23.0.1 + run: python -m pip install --use-pep517 --upgrade pip==23.0.1 shell: bash - name: Setup Graphviz diff --git a/otm/otm/trustzone_representation_calculator.py b/otm/otm/trustzone_representation_calculator.py index 2b7386f8..eeafcdf8 100644 --- a/otm/otm/trustzone_representation_calculator.py +++ b/otm/otm/trustzone_representation_calculator.py @@ -9,7 +9,7 @@ TZ_PADDING = 30 -def _get_trustzone_components(trustzone_id: str, components: List[Component]): +def _get_trustzone_components(trustzone_id: str, components: List[Union[Component, Trustzone]]): return list(filter(lambda component: component.parent == trustzone_id, components)) @@ -20,7 +20,7 @@ def _get_first_representation(component: Component): def calculate_missing_trustzones_representations(otm: OTM, representation_id): for trustzone in otm.trustzones: if not trustzone.representations: - tz_components = _get_trustzone_components(trustzone.id, otm.components) + tz_components = _get_trustzone_components(trustzone.id, otm.trustzones + otm.components) TrustZoneRepresentationCalculator(representation_id, trustzone, tz_components).calculate() diff --git a/otm/tests/unit/test_trustzone_representation_calculator.py b/otm/tests/unit/test_trustzone_representation_calculator.py index 16008c74..52ef276e 100644 --- a/otm/tests/unit/test_trustzone_representation_calculator.py +++ b/otm/tests/unit/test_trustzone_representation_calculator.py @@ -70,7 +70,8 @@ def test_calculate_missing_trustzones_representations(self, trustzone_calculator calculate_missing_trustzones_representations(otm, REPRESENTATION_ID) # THEN the components are retrieved for the trustzone_without_representation - get_trustzone_components_mock.assert_called_with(trustzone_without_representation.id, trustzone_components) + get_trustzone_components_mock.assert_called_with( + trustzone_without_representation.id, otm.trustzones + trustzone_components) # AND the trustzone representation is calculated for the trustzone_without_representation trustzone_calculator_mock.assert_called_with(REPRESENTATION_ID, diff --git a/setup.py b/setup.py index 77ff3cdc..8ae2aa7a 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ 'vsdx==0.5.13', 'python-magic==0.4.27', 'setuptools==67.8.0', - 'setuptools-scm==8.0.2', + 'setuptools-scm==8.1.0', 'defusedxml==0.7.1', 'networkx==3.1', 'dependency-injector==4.41.0', diff --git a/slp_mtmt/slp_mtmt/mtmt_loader.py b/slp_mtmt/slp_mtmt/mtmt_loader.py index 64df924d..873c9791 100644 --- a/slp_mtmt/slp_mtmt/mtmt_loader.py +++ b/slp_mtmt/slp_mtmt/mtmt_loader.py @@ -38,12 +38,12 @@ def __read(self): model_ = json_['ThreatModel'] list_ = model_['DrawingSurfaceList'] surface_model_ = list_['DrawingSurfaceModel'] - surface_model_array \ - = surface_model_ if isinstance(surface_model_, collections.abc.Sequence) else [surface_model_] + surface_model_ \ + = surface_model_[0] if isinstance(surface_model_, collections.abc.Sequence) else surface_model_ - for surface_model in surface_model_array: - self.add_borders(surface_model) - self.add_lines(surface_model) + # Only the first tab of the MTMT file is processed + self.add_borders(surface_model_) + self.add_lines(surface_model_) self.add_threats(model_) self.know_base = MTMKnowledge(model_['KnowledgeBase']) diff --git a/slp_mtmt/slp_mtmt/mtmt_parser.py b/slp_mtmt/slp_mtmt/mtmt_parser.py index adc80064..dadc39ba 100644 --- a/slp_mtmt/slp_mtmt/mtmt_parser.py +++ b/slp_mtmt/slp_mtmt/mtmt_parser.py @@ -11,6 +11,7 @@ from slp_mtmt.slp_mtmt.parse.mtmt_connector_parser import MTMTConnectorParser from slp_mtmt.slp_mtmt.parse.mtmt_threat_parser import MTMThreatParser from slp_mtmt.slp_mtmt.parse.mtmt_trustzone_parser import MTMTTrustzoneParser +from otm.otm.trustzone_representation_calculator import calculate_missing_trustzones_representations class MTMTParser(ProviderParser): @@ -62,9 +63,10 @@ def __get_mtmt_representations(self) -> list: def build_otm(self) -> OTM: threats, mitigations = self.__get_mtmt_threats_and_mitigations(self.__get_mtmt_components()) + otm_representations = self.__get_mtmt_representations() otm = OTMBuilder(self.project_id, self.project_name, EtmType.MTMT) \ - .add_representations(self.__get_mtmt_representations()) \ + .add_representations(otm_representations) \ .add_trustzones(self.__get_mtmt_trustzones()) \ .add_components(self.__get_mtmt_components()) \ .add_dataflows(self.__get_mtmt_dataflows()) \ @@ -72,4 +74,6 @@ def build_otm(self) -> OTM: .add_mitigations(mitigations) \ .build() + calculate_missing_trustzones_representations(otm, otm_representations[0].id) + return otm diff --git a/slp_mtmt/slp_mtmt/parse/mtmt_general_parser.py b/slp_mtmt/slp_mtmt/parse/mtmt_general_parser.py index fc6e8b00..6564ab51 100644 --- a/slp_mtmt/slp_mtmt/parse/mtmt_general_parser.py +++ b/slp_mtmt/slp_mtmt/parse/mtmt_general_parser.py @@ -1,3 +1,5 @@ +from typing import Union + from slp_mtmt.slp_mtmt.entity.mtmt_entity_border import MTMBorder from slp_mtmt.slp_mtmt.entity.mtmt_entity_line import MTMLine from slp_mtmt.slp_mtmt.mtmt_entity import MTMT @@ -16,7 +18,7 @@ def is_parent(parent, child): return False -def get_the_child(parents): +def get_the_child(parents) -> Union[MTMBorder, MTMLine, None]: if len(parents) == 0: return None if len(parents) == 1: @@ -43,7 +45,7 @@ def __init__(self, source: MTMT, mapping: MTMTMapping, diagram_representation: s self.mapping = mapping self.diagram_representation = diagram_representation - def _get_parent(self, border: MTMBorder): + def _get_parent(self, border: MTMBorder) -> Union[MTMBorder, MTMLine, None]: parents = [] for candidate in self.source.borders + self.source.lines: if is_parent(candidate, border): diff --git a/slp_mtmt/slp_mtmt/parse/mtmt_trustzone_parser.py b/slp_mtmt/slp_mtmt/parse/mtmt_trustzone_parser.py index 8095f2e7..f670401b 100644 --- a/slp_mtmt/slp_mtmt/parse/mtmt_trustzone_parser.py +++ b/slp_mtmt/slp_mtmt/parse/mtmt_trustzone_parser.py @@ -45,7 +45,7 @@ def create_trustzone(self, border) -> Trustzone: parent_id, parent_type = None, None mtmt_type = self.__calculate_otm_type(border) if mtmt_type is not None: - calculator = TrustzoneRepresentationCalculator(self.diagram_representation, border) + calculator = TrustzoneRepresentationCalculator(self.diagram_representation, border, parent) representations = calculator.calculate_representation() tz = Trustzone(trustzone_id=border.id, name=border.name or border.stencil_name, diff --git a/slp_mtmt/slp_mtmt/util/component_representation_calculator.py b/slp_mtmt/slp_mtmt/util/component_representation_calculator.py index d1742581..4caff3af 100644 --- a/slp_mtmt/slp_mtmt/util/component_representation_calculator.py +++ b/slp_mtmt/slp_mtmt/util/component_representation_calculator.py @@ -5,15 +5,13 @@ class ComponentRepresentationCalculator(RepresentationCalculator): def get_position(self) -> (int, int): - if isinstance(self.parent, MTMBorder): - return self.__get_border_position() - return None, None + return self.__get_border_position() def get_size(self) -> (int, int): return self.element.width, self.element.height def __get_border_position(self): - if self.parent: + if isinstance(self.parent, MTMBorder): x = self.element.left - self.parent.left y = self.element.top - self.parent.top else: diff --git a/slp_mtmt/slp_mtmt/util/trustzone_representation_calculator.py b/slp_mtmt/slp_mtmt/util/trustzone_representation_calculator.py index bee850fd..26ae547d 100644 --- a/slp_mtmt/slp_mtmt/util/trustzone_representation_calculator.py +++ b/slp_mtmt/slp_mtmt/util/trustzone_representation_calculator.py @@ -5,14 +5,18 @@ class TrustzoneRepresentationCalculator(RepresentationCalculator): def get_position(self) -> (int, int): - if isinstance(self.element, MTMBorder): - return self.__get_border_position() - return None, None + if not isinstance(self.element, MTMBorder): + return None, None + + return self.__get_relative_position() if isinstance(self.parent, MTMBorder) else self.__get_absolute_position() def get_size(self) -> (int, int): if isinstance(self.element, MTMBorder): return self.element.width, self.element.height return None, None - def __get_border_position(self): + def __get_absolute_position(self): return self.element.left, self.element.top + + def __get_relative_position(self): + return self.element.left - self.parent.left, self.element.top - self.parent.top diff --git a/slp_mtmt/tests/resources/mtmt/MTMT_example_coordinates_1_line_trustzone.otm b/slp_mtmt/tests/resources/mtmt/MTMT_example_coordinates_1_line_trustzone.otm index 45a16ace..9245858a 100644 --- a/slp_mtmt/tests/resources/mtmt/MTMT_example_coordinates_1_line_trustzone.otm +++ b/slp_mtmt/tests/resources/mtmt/MTMT_example_coordinates_1_line_trustzone.otm @@ -25,6 +25,19 @@ "id": "acafa4b0-f94d-4077-8a42-74b959bd0796", "type": "b61d6911-338d-46a8-9f39-8dcd24abfe91", "name": "Cloud", + "representations": [{ + "id": "acafa4b0-f94d-4077-8a42-74b959bd0796-representation", + "name": "Cloud Representation", + "position": { + "x": 734, + "y": 88 + }, + "representation": "example-project-diagram", + "size": { + "height": 488, + "width": 535 + } + }], "risk": { "trustRating": 10 }, @@ -37,6 +50,19 @@ "id": "c99b79b6-a658-4096-9919-27946d92e23f", "type": "6376d53e-6461-412b-8e04-7b3fe2b397de", "name": "Generic Trust Line Boundary", + "representations": [{ + "id": "c99b79b6-a658-4096-9919-27946d92e23f-representation", + "name": "Generic Trust Line Boundary Representation", + "position": { + "x": 86, + "y": 109 + }, + "representation": "example-project-diagram", + "size": { + "height": 445, + "width": 432 + } + }], "risk": { "trustRating": 10 }, @@ -54,6 +80,19 @@ "parent": { "trustZone": "acafa4b0-f94d-4077-8a42-74b959bd0796" }, + "representations": [{ + "id": "53245f54-0656-4ede-a393-357aeaa2e20f-representation", + "name": "Accounting PostgreSQL Representation", + "position": { + "x": 334, + "y": 45 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "attributes": { "Name": "Accounting PostgreSQL", "Out Of Scope": "false", @@ -100,6 +139,19 @@ "parent": { "trustZone": "c99b79b6-a658-4096-9919-27946d92e23f" }, + "representations": [{ + "id": "6183b7fa-eba5-4bf8-a0af-c3e30d144a10-representation", + "name": "Android Representation", + "position": { + "x": 320, + "y": 30 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "attributes": { "Name": "Android", "Out Of Scope": "false", @@ -135,6 +187,19 @@ "parent": { "trustZone": "acafa4b0-f94d-4077-8a42-74b959bd0796" }, + "representations": [{ + "id": "5d15323e-3729-4694-87b1-181c90af5045-representation", + "name": "Public API v2 Representation", + "position": { + "x": 31, + "y": 155 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "attributes": { "Name": "Public API v2", "Out Of Scope": "false", @@ -812,6 +877,19 @@ "parent": { "trustZone": "acafa4b0-f94d-4077-8a42-74b959bd0796" }, + "representations": [{ + "id": "91882aca-8249-49a7-96f0-164b68411b48-representation", + "name": "Azure File Storage Representation", + "position": { + "x": 300, + "y": 161 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "attributes": { "Name": "Azure File Storage", "Out Of Scope": "false", @@ -900,6 +978,19 @@ "parent": { "trustZone": "c99b79b6-a658-4096-9919-27946d92e23f" }, + "representations": [{ + "id": "91c41c08-87c3-4740-a9fa-a37975717e93-representation", + "name": "iOS Representation", + "position": { + "x": 30, + "y": 155 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "attributes": { "Name": "iOS", "Out Of Scope": "false", @@ -935,6 +1026,19 @@ "parent": { "trustZone": "c99b79b6-a658-4096-9919-27946d92e23f" }, + "representations": [{ + "id": "40560275-0a84-4e52-b67f-f9008519e608-representation", + "name": "Browser Representation", + "position": { + "x": 313, + "y": 333 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "attributes": { "Name": "Browser", "Out Of Scope": "false" @@ -969,6 +1073,19 @@ "parent": { "trustZone": "acafa4b0-f94d-4077-8a42-74b959bd0796" }, + "representations": [{ + "id": "b56070fb-682d-4af7-8262-a31064d85ba1-representation", + "name": "Web API Representation", + "position": { + "x": 155, + "y": 297 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "attributes": { "Name": "Web API", "Out Of Scope": "false", @@ -1146,6 +1263,19 @@ "parent": { "trustZone": "acafa4b0-f94d-4077-8a42-74b959bd0796" }, + "representations": [{ + "id": "07d453bf-8157-4623-a0e9-5107cc3ca0a5-representation", + "name": "Azure Storage Representation", + "position": { + "x": 341, + "y": 293 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "attributes": { "Name": "Azure Storage", "Out Of Scope": "false", diff --git a/slp_mtmt/tests/resources/mtmt/MTMT_example_coordinates_1_orphan.otm b/slp_mtmt/tests/resources/mtmt/MTMT_example_coordinates_1_orphan.otm index 9b2fbdc8..be57c71d 100644 --- a/slp_mtmt/tests/resources/mtmt/MTMT_example_coordinates_1_orphan.otm +++ b/slp_mtmt/tests/resources/mtmt/MTMT_example_coordinates_1_orphan.otm @@ -25,6 +25,19 @@ "id": "13ffd9d9-53ea-4b63-afab-07b730697ddd", "type": "6376d53e-6461-412b-8e04-7b3fe2b397de", "name": "Internet", + "representations": [{ + "id": "13ffd9d9-53ea-4b63-afab-07b730697ddd-representation", + "name": "Internet Representation", + "position": { + "x": 342, + "y": 83 + }, + "representation": "example-project-diagram", + "size": { + "height": 497, + "width": 327 + } + }], "risk": { "trustRating": 10 }, @@ -37,6 +50,19 @@ "id": "acafa4b0-f94d-4077-8a42-74b959bd0796", "type": "b61d6911-338d-46a8-9f39-8dcd24abfe91", "name": "Cloud", + "representations": [{ + "id": "acafa4b0-f94d-4077-8a42-74b959bd0796-representation", + "name": "Cloud Representation", + "position": { + "x": 734, + "y": 88 + }, + "representation": "example-project-diagram", + "size": { + "height": 488, + "width": 535 + } + }], "risk": { "trustRating": 10 }, @@ -49,6 +75,19 @@ "id": "185f1c6f-3879-464c-89c9-dc6f0b0c2b21", "type": "b61d6911-338d-46a8-9f39-8dcd24abfe91", "name": "Default trustzone", + "representations": [{ + "id": "185f1c6f-3879-464c-89c9-dc6f0b0c2b21-representation", + "name": "Default trustzone Representation", + "position": { + "x": 86, + "y": 234 + }, + "representation": "example-project-diagram", + "size": { + "height": 142, + "width": 142 + } + }], "risk": { "trustRating": 10 } @@ -62,6 +101,19 @@ "parent": { "trustZone": "acafa4b0-f94d-4077-8a42-74b959bd0796" }, + "representations": [{ + "id": "53245f54-0656-4ede-a393-357aeaa2e20f-representation", + "name": "Accounting PostgreSQL Representation", + "position": { + "x": 334, + "y": 45 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "attributes": { "Name": "Accounting PostgreSQL", "Out Of Scope": "false", @@ -76,6 +128,19 @@ "parent": { "trustZone": "13ffd9d9-53ea-4b63-afab-07b730697ddd" }, + "representations": [{ + "id": "6183b7fa-eba5-4bf8-a0af-c3e30d144a10-representation", + "name": "Android Representation", + "position": { + "x": 64, + "y": 56 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "attributes": { "Name": "Android", "Out Of Scope": "false", @@ -89,6 +154,19 @@ "parent": { "trustZone": "acafa4b0-f94d-4077-8a42-74b959bd0796" }, + "representations": [{ + "id": "5d15323e-3729-4694-87b1-181c90af5045-representation", + "name": "Public API v2 Representation", + "position": { + "x": 31, + "y": 155 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "attributes": { "Name": "Public API v2", "Out Of Scope": "false", @@ -104,6 +182,19 @@ "parent": { "trustZone": "acafa4b0-f94d-4077-8a42-74b959bd0796" }, + "representations": [{ + "id": "91882aca-8249-49a7-96f0-164b68411b48-representation", + "name": "Azure File Storage Representation", + "position": { + "x": 300, + "y": 161 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "attributes": { "Name": "Azure File Storage", "Out Of Scope": "false", @@ -120,6 +211,19 @@ "parent": { "trustZone": "185f1c6f-3879-464c-89c9-dc6f0b0c2b21" }, + "representations": [{ + "id": "91c41c08-87c3-4740-a9fa-a37975717e93-representation", + "name": "iOS Representation", + "position": { + "x": 30, + "y": 30 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "attributes": { "Name": "iOS", "Out Of Scope": "false", @@ -133,6 +237,19 @@ "parent": { "trustZone": "13ffd9d9-53ea-4b63-afab-07b730697ddd" }, + "representations": [{ + "id": "40560275-0a84-4e52-b67f-f9008519e608-representation", + "name": "Browser Representation", + "position": { + "x": 57, + "y": 359 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "attributes": { "Name": "Browser", "Out Of Scope": "false" @@ -145,6 +262,19 @@ "parent": { "trustZone": "acafa4b0-f94d-4077-8a42-74b959bd0796" }, + "representations": [{ + "id": "b56070fb-682d-4af7-8262-a31064d85ba1-representation", + "name": "Web API Representation", + "position": { + "x": 155, + "y": 297 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "attributes": { "Name": "Web API", "Out Of Scope": "false", @@ -160,6 +290,19 @@ "parent": { "trustZone": "acafa4b0-f94d-4077-8a42-74b959bd0796" }, + "representations": [{ + "id": "07d453bf-8157-4623-a0e9-5107cc3ca0a5-representation", + "name": "Azure Storage Representation", + "position": { + "x": 341, + "y": 293 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "attributes": { "Name": "Azure Storage", "Out Of Scope": "false", diff --git a/slp_mtmt/tests/resources/otm/nested_tz.otm b/slp_mtmt/tests/resources/otm/nested_tz.otm index c4fe4a12..c6b7d422 100644 --- a/slp_mtmt/tests/resources/otm/nested_tz.otm +++ b/slp_mtmt/tests/resources/otm/nested_tz.otm @@ -40,6 +40,19 @@ "parent": { "trustZone": "26e6fdb8-013f-4d59-bb11-208eec4d6bc9" }, + "representations": [{ + "id": "a38c22eb-fee8-4abd-b92c-457d6822ee86-representation", + "name": "Customer web client Representation", + "position": { + "x": 30, + "y": 30 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "type": "web-client" }, { @@ -61,6 +74,19 @@ "parent": { "trustZone": "351f4038-244d-4de5-bfa0-00c17f2a1fa2" }, + "representations": [{ + "id": "eef31b72-49b3-4d5f-9452-7ae178344c6b-representation", + "name": "Main Application Representation", + "position": { + "x": 291, + "y": 171 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "type": "web-application-server-side" }, { @@ -82,6 +108,19 @@ "parent": { "trustZone": "9cbb5581-99cc-463b-a77a-c0dcae3b96d7" }, + "representations": [{ + "id": "4820ec3a-9841-4baf-a38c-2fa596014274-representation", + "name": "Sandbox Mongo Representation", + "position": { + "x": 29, + "y": 40 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "type": "other-nosql-key-value-store" }, { @@ -103,6 +142,19 @@ "parent": { "trustZone": "351f4038-244d-4de5-bfa0-00c17f2a1fa2" }, + "representations": [{ + "id": "9668ae2e-403f-4182-8c4c-d83948ffc31b-representation", + "name": "Production Mongo Representation", + "position": { + "x": 82, + "y": 263 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "type": "other-nosql-key-value-store" } ], @@ -115,6 +167,19 @@ "id": "351f4038-244d-4de5-bfa0-00c17f2a1fa2", "type": "6376d53e-6461-412b-8e04-7b3fe2b397de", "name": "Generic Trust Border Boundary", + "representations": [{ + "id": "351f4038-244d-4de5-bfa0-00c17f2a1fa2-representation", + "name": "Generic Trust Border Boundary Representation", + "position": { + "x": 76, + "y": 82 + }, + "representation": "example-project-diagram", + "size": { + "height": 445, + "width": 435 + } + }], "risk": { "trustRating": 10 } @@ -132,7 +197,20 @@ }, "parent": { "trustZone": "351f4038-244d-4de5-bfa0-00c17f2a1fa2" - } + }, + "representations": [{ + "id": "9cbb5581-99cc-463b-a77a-c0dcae3b96d7-representation", + "name": "Sandbox environment Representation", + "position": { + "x": 55, + "y": 39 + }, + "representation": "example-project-diagram", + "size": { + "height": 168, + "width": 174 + } + }] }, { "attributes": { @@ -144,6 +222,19 @@ "id": "26e6fdb8-013f-4d59-bb11-208eec4d6bc9", "type": "f0ba7722-39b6-4c81-8290-a30a248bb8d9", "name": "Internet Boundary", + "representations": [{ + "id": "26e6fdb8-013f-4d59-bb11-208eec4d6bc9-representation", + "name": "Internet Boundary Representation", + "position": { + "x": 710, + "y": 227 + }, + "representation": "example-project-diagram", + "size": { + "height": 142, + "width": 142 + } + }], "risk": { "trustRating": 10 } diff --git a/slp_mtmt/tests/resources/otm/nested_tz_line.otm b/slp_mtmt/tests/resources/otm/nested_tz_line.otm index e83c9e2e..cd063c83 100644 --- a/slp_mtmt/tests/resources/otm/nested_tz_line.otm +++ b/slp_mtmt/tests/resources/otm/nested_tz_line.otm @@ -40,6 +40,19 @@ "parent": { "trustZone": "26e6fdb8-013f-4d59-bb11-208eec4d6bc9" }, + "representations": [{ + "id": "a38c22eb-fee8-4abd-b92c-457d6822ee86-representation", + "name": "Customer web client Representation", + "position": { + "x": 30, + "y": 30 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "type": "web-client" }, { @@ -61,6 +74,19 @@ "parent": { "trustZone": "e3ddc2c6-83d5-4363-9acb-52655317dafd" }, + "representations": [{ + "id": "eef31b72-49b3-4d5f-9452-7ae178344c6b-representation", + "name": "Main Application Representation", + "position": { + "x": 266, + "y": 162 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "type": "web-application-server-side" }, { @@ -82,6 +108,19 @@ "parent": { "trustZone": "9cbb5581-99cc-463b-a77a-c0dcae3b96d7" }, + "representations": [{ + "id": "4820ec3a-9841-4baf-a38c-2fa596014274-representation", + "name": "Sandbox Mongo Representation", + "position": { + "x": 29, + "y": 40 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "type": "other-nosql-key-value-store" }, { @@ -103,6 +142,19 @@ "parent": { "trustZone": "e3ddc2c6-83d5-4363-9acb-52655317dafd" }, + "representations": [{ + "id": "9668ae2e-403f-4182-8c4c-d83948ffc31b-representation", + "name": "Production Mongo Representation", + "position": { + "x": 57, + "y": 254 + }, + "representation": "example-project-diagram", + "size": { + "height": 82, + "width": 82 + } + }], "type": "other-nosql-key-value-store" } ], @@ -120,7 +172,20 @@ }, "parent": { "trustZone": "e3ddc2c6-83d5-4363-9acb-52655317dafd" - } + }, + "representations": [{ + "id": "9cbb5581-99cc-463b-a77a-c0dcae3b96d7-representation", + "name": "Sandbox environment Representation", + "position": { + "x": 30, + "y": 30 + }, + "representation": "example-project-diagram", + "size": { + "height": 168, + "width": 174 + } + }] }, { "attributes": { @@ -132,6 +197,19 @@ "id": "26e6fdb8-013f-4d59-bb11-208eec4d6bc9", "type": "f0ba7722-39b6-4c81-8290-a30a248bb8d9", "name": "Internet Boundary", + "representations": [{ + "id": "26e6fdb8-013f-4d59-bb11-208eec4d6bc9-representation", + "name": "Internet Boundary Representation", + "position": { + "x": 710, + "y": 227 + }, + "representation": "example-project-diagram", + "size": { + "height": 142, + "width": 142 + } + }], "risk": { "trustRating": 10 } @@ -144,6 +222,19 @@ "id": "e3ddc2c6-83d5-4363-9acb-52655317dafd", "type": "6376d53e-6461-412b-8e04-7b3fe2b397de", "name": "Generic Trust Line Boundary", + "representations": [{ + "id": "e3ddc2c6-83d5-4363-9acb-52655317dafd-representation", + "name": "Generic Trust Line Boundary Representation", + "position": { + "x": 101, + "y": 91 + }, + "representation": "example-project-diagram", + "size": { + "height": 366, + "width": 378 + } + }], "risk": { "trustRating": 10 }