From e80ea38f0cc633a2de58ccafa829f25fd45e3663 Mon Sep 17 00:00:00 2001 From: Edoardo Rosa <6991986+notdodo@users.noreply.github.com> Date: Fri, 20 Mar 2026 14:11:49 +0100 Subject: [PATCH] fix: lint --- dep_connector/converter_to_stix.py | 44 +++++++++++++++++++----------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/dep_connector/converter_to_stix.py b/dep_connector/converter_to_stix.py index 2133426..bb23ed7 100644 --- a/dep_connector/converter_to_stix.py +++ b/dep_connector/converter_to_stix.py @@ -280,24 +280,36 @@ def create_report(self, item: LeakRecord, object_refs: list[str]) -> stix2.Repor description = self.build_primary_description(item) published = datetime.combine(item.date, datetime.min.time(), tzinfo=UTC) external_reference = self.build_primary_external_reference(item) - report_id = f"report--{uuid5(NAMESPACE_URL, f'dep-announcement:{item.normalized_hashid}')}" - report_kwargs: dict[str, object] = { - "id": report_id, - "name": report_name, - "description": description, - "published": published, - "report_types": ["threat-report"], - "confidence": self.confidence, - "labels": self.build_labels(item), - "created_by_ref": self.author_identity, - "external_references": [external_reference], - "object_refs": object_refs, - "object_marking_refs": [TLP_AMBER], - } custom_properties = self.build_primary_custom_properties(item) + report_id = pycti.Report.generate_id(name=report_name, published=published) if custom_properties: - report_kwargs["custom_properties"] = custom_properties - return stix2.Report(**report_kwargs) + return stix2.Report( + id=report_id, + name=report_name, + description=description, + published=published, + report_types=["threat-report"], + confidence=self.confidence, + labels=self.build_labels(item), + created_by_ref=self.author_identity, + external_references=[external_reference], + object_refs=object_refs, + object_marking_refs=[TLP_AMBER], + custom_properties=custom_properties, + ) + return stix2.Report( + id=report_id, + name=report_name, + description=description, + published=published, + report_types=["threat-report"], + confidence=self.confidence, + labels=self.build_labels(item), + created_by_ref=self.author_identity, + external_references=[external_reference], + object_refs=object_refs, + object_marking_refs=[TLP_AMBER], + ) def build_labels(self, item: LeakRecord) -> list[str]: labels = {self.label_value}