Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit f8a9455

Browse files
[backend] Adapt UI, support relationships (#11707)
1 parent 856b785 commit f8a9455

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pycti/entities/opencti_stix_core_relationship.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@ def create(self, **kwargs):
624624
granted_refs = kwargs.get("objectOrganization", None)
625625
x_opencti_workflow_id = kwargs.get("x_opencti_workflow_id", None)
626626
x_opencti_stix_ids = kwargs.get("x_opencti_stix_ids", None)
627+
coverage_information = kwargs.get("coverage_information", None)
627628
update = kwargs.get("update", False)
628629

629630
self.opencti.app_logger.info(
@@ -668,6 +669,7 @@ def create(self, **kwargs):
668669
"killChainPhases": kill_chain_phases,
669670
"x_opencti_workflow_id": x_opencti_workflow_id,
670671
"x_opencti_stix_ids": x_opencti_stix_ids,
672+
"coverage_information": coverage_information,
671673
"update": update,
672674
}
673675
},
@@ -1175,6 +1177,19 @@ def import_from_stix2(self, **kwargs):
11751177
)
11761178
)
11771179

1180+
raw_coverages = (
1181+
stix_relation["coverage"] if "coverage" in stix_relation else []
1182+
)
1183+
coverage_information = list(
1184+
map(
1185+
lambda cov: {
1186+
"coverage_name": cov["name"],
1187+
"coverage_score": cov["score"],
1188+
},
1189+
raw_coverages,
1190+
)
1191+
)
1192+
11781193
source_ref = stix_relation["source_ref"]
11791194
target_ref = stix_relation["target_ref"]
11801195
return self.create(
@@ -1197,6 +1212,7 @@ def import_from_stix2(self, **kwargs):
11971212
if "stop_time" in stix_relation
11981213
else default_date
11991214
),
1215+
coverage_information=coverage_information,
12001216
revoked=(
12011217
stix_relation["revoked"] if "revoked" in stix_relation else None
12021218
),

0 commit comments

Comments
 (0)