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

Commit 146db34

Browse files
author
Samuel Hassine
committed
[client] Migration incidents
1 parent 7ae7eed commit 146db34

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

pycti/entities/opencti_incident.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ def list(self, **kwargs):
163163
)
164164

165165
"""
166-
Read a X-OpenCTI-Incident object
166+
Read a Incident object
167167
168-
:param id: the id of the X-OpenCTI-Incident
168+
:param id: the id of the Incident
169169
:param filters: the filters to apply if no id provided
170-
:return X-OpenCTI-Incident object
170+
:return Incident object
171171
"""
172172

173173
def read(self, **kwargs):
@@ -272,10 +272,10 @@ def create(self, **kwargs):
272272
self.opencti.log("error", "Missing parameters: name and description")
273273

274274
"""
275-
Import a X-OpenCTI-Incident object from a STIX2 object
275+
Import a Incident object from a STIX2 object
276276
277-
:param stixObject: the Stix-Object X-OpenCTI-Incident
278-
:return X-OpenCTI-Incident object
277+
:param stixObject: the Stix-Object Incident
278+
:return Incident object
279279
"""
280280

281281
def import_from_stix2(self, **kwargs):

pycti/utils/opencti_stix2.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def extract_embedded_relationships(self, stix_object, types=None) -> dict:
366366
"threat-actor",
367367
"intrusion-set",
368368
"campaign",
369-
"x-opencti-incident",
369+
"incident",
370370
"malware",
371371
"relationship",
372372
]
@@ -524,7 +524,7 @@ def import_object(self, stix_object, update=False, types=None) -> list:
524524
"threat-actor": self.opencti.threat_actor.import_from_stix2,
525525
"tool": self.opencti.tool.import_from_stix2,
526526
"vulnerability": self.opencti.vulnerability.import_from_stix2,
527-
"x-opencti-incident": self.opencti.incident.import_from_stix2,
527+
"incident": self.opencti.incident.import_from_stix2,
528528
}
529529

530530
# TODO: Remove this, compatibility with V3
@@ -1235,7 +1235,7 @@ def prepare_export(
12351235
"Threat-Actor": self.opencti.threat_actor.read,
12361236
"Tool": self.opencti.tool.read,
12371237
"Vulnerability": self.opencti.vulnerability.read,
1238-
"X-OpenCTI-Incident": self.opencti.incident.read,
1238+
"Incident": self.opencti.incident.read,
12391239
"Stix-Cyber-Observable": self.opencti.stix_cyber_observable.read,
12401240
"stix_core_relationship": self.opencti.stix_core_relationship.read,
12411241
}
@@ -1371,7 +1371,7 @@ def export_entity(
13711371
"Threat-Actor": self.opencti.threat_actor.read,
13721372
"Tool": self.opencti.tool.read,
13731373
"Vulnerability": self.opencti.vulnerability.read,
1374-
"X-OpenCTI-Incident": self.opencti.incident.read,
1374+
"Incident": self.opencti.incident.read,
13751375
}
13761376
do_read = reader.get(
13771377
entity_type, lambda **kwargs: self.unknown_type({"type": entity_type})
@@ -1453,7 +1453,7 @@ def export_list(
14531453
"Threat-Actor": self.opencti.threat_actor.list,
14541454
"Tool": self.opencti.tool.list,
14551455
"Vulnerability": self.opencti.vulnerability.list,
1456-
"X-OpenCTI-Incident": self.opencti.incident.list,
1456+
"Incident": self.opencti.incident.list,
14571457
"Stix-Cyber-Observable": self.opencti.stix_cyber_observable.list,
14581458
}
14591459
do_list = lister.get(

tests/data/DATA-TEST-STIX2_v2.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,10 @@
272272
},
273273
{
274274
"id": "incident--0b626d41-1d8d-4b96-86fa-ad49cea2cfd4",
275-
"type": "x-opencti-incident",
275+
"type": "incident",
276276
"spec_version": "2.1",
277277
"name": "A new incident",
278-
"labels": ["x-opencti-incident"],
278+
"labels": ["incident"],
279279
"description": "A test incident",
280280
"first_seen": "2020-02-27T08:45:47.779Z",
281281
"last_seen": "2020-02-27T08:45:47.779Z",

0 commit comments

Comments
 (0)