5
5
6
6
from stix2 .canonicalization .Canonicalize import canonicalize
7
7
8
- from pycti .connector .opencti_connector_helper import OpenCTIConnectorHelper
9
-
10
8
11
9
class AttackPattern :
12
10
def __init__ (self , opencti ):
@@ -379,12 +377,10 @@ def import_from_stix2(self, **kwargs):
379
377
if "x_mitre_id" in stix_object :
380
378
x_mitre_id = stix_object ["x_mitre_id" ]
381
379
elif (
382
- OpenCTIConnectorHelper .get_attribute_in_mitre_extension (
383
- "id" , stix_object
384
- )
380
+ self .opencti .get_attribute_in_mitre_extension ("id" , stix_object )
385
381
is not None
386
382
):
387
- x_mitre_id = OpenCTIConnectorHelper .get_attribute_in_mitre_extension (
383
+ x_mitre_id = self . opencti .get_attribute_in_mitre_extension (
388
384
"id" , stix_object
389
385
)
390
386
elif "external_references" in stix_object :
@@ -405,39 +401,33 @@ def import_from_stix2(self, **kwargs):
405
401
# Search in extensions
406
402
if "x_opencti_order" not in stix_object :
407
403
stix_object ["x_opencti_order" ] = (
408
- OpenCTIConnectorHelper .get_attribute_in_extension (
409
- "order" , stix_object
410
- )
411
- if OpenCTIConnectorHelper .get_attribute_in_extension (
412
- "order" , stix_object
413
- )
404
+ self .opencti .get_attribute_in_extension ("order" , stix_object )
405
+ if self .opencti .get_attribute_in_extension ("order" , stix_object )
414
406
is not None
415
407
else 0
416
408
)
417
409
if "x_mitre_platforms" not in stix_object :
418
410
stix_object [
419
411
"x_mitre_platforms"
420
- ] = OpenCTIConnectorHelper .get_attribute_in_mitre_extension (
412
+ ] = self . opencti .get_attribute_in_mitre_extension (
421
413
"platforms" , stix_object
422
414
)
423
415
if "x_mitre_permissions_required" not in stix_object :
424
416
stix_object [
425
417
"x_mitre_permissions_required"
426
- ] = OpenCTIConnectorHelper .get_attribute_in_mitre_extension (
418
+ ] = self . opencti .get_attribute_in_mitre_extension (
427
419
"permissions_required" , stix_object
428
420
)
429
421
if "x_mitre_detection" not in stix_object :
430
422
stix_object [
431
423
"x_mitre_detection"
432
- ] = OpenCTIConnectorHelper .get_attribute_in_mitre_extension (
424
+ ] = self . opencti .get_attribute_in_mitre_extension (
433
425
"detection" , stix_object
434
426
)
435
427
if "x_opencti_stix_ids" not in stix_object :
436
428
stix_object [
437
429
"x_opencti_stix_ids"
438
- ] = OpenCTIConnectorHelper .get_attribute_in_extension (
439
- "stix_ids" , stix_object
440
- )
430
+ ] = self .opencti .get_attribute_in_extension ("stix_ids" , stix_object )
441
431
442
432
return self .create (
443
433
stix_id = stix_object ["id" ],
0 commit comments