This repository was archived by the owner on Dec 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +60
-2
lines changed
Expand file tree Collapse file tree 2 files changed +60
-2
lines changed Original file line number Diff line number Diff line change 3131 OBSERVABLES_VALUE_INT ,
3232 STIX_CYBER_OBSERVABLE_MAPPING ,
3333 STIX_OBJECTS ,
34+ STIX_META_OBJECTS ,
35+ STIX_CORE_OBJECTS ,
3436)
3537
3638datefinder .ValueError = ValueError , OverflowError
@@ -2542,9 +2544,17 @@ def organization_unshare(self, item):
25422544
25432545 def element_operation_delete (self , item , operation ):
25442546 # If data is stix, just use the generic stix function for deletion
2545- if item ["type" ] in STIX_OBJECTS :
2546- force_delete = operation == "delete_force"
2547+ force_delete = operation == "delete_force"
2548+ if item ["type" ] == "relationship" :
2549+ self .opencti .stix_core_relationship .delete (id = item ["id" ])
2550+ elif item ["type" ] == "sighting" :
2551+ self .opencti .stix_sighting_relationship .delete (id = item ["id" ])
2552+ elif item ["type" ] in STIX_META_OBJECTS :
25472553 self .opencti .stix .delete (id = item ["id" ], force_delete = force_delete )
2554+ elif item ["type" ] in list (STIX_CYBER_OBSERVABLE_MAPPING .keys ()):
2555+ self .opencti .stix_cyber_observable .delete (id = item ["id" ])
2556+ elif item ["type" ] in STIX_CORE_OBJECTS :
2557+ self .opencti .stix_core_object .delete (id = item ["id" ])
25482558 else :
25492559 # Element is not knowledge we need to use the right api
25502560 stix_helper = self .get_internal_helper ().get (item ["type" ])
Original file line number Diff line number Diff line change 1717 "publicdashboard" ,
1818]
1919
20+ STIX_META_OBJECTS = [
21+ "label" ,
22+ "vocabulary" ,
23+ "kill-chain-phase" ,
24+ ]
25+
26+ STIX_CORE_OBJECTS = [
27+ "attack-pattern" ,
28+ "campaign" ,
29+ "case-incident" ,
30+ "x-opencti-case-incident" ,
31+ "case-rfi" ,
32+ "x-opencti-case-rfi" ,
33+ "case-rft" ,
34+ "x-opencti-case-rft" ,
35+ "channel" ,
36+ "course-of-action" ,
37+ "data-component" ,
38+ "x-mitre-data-component" ,
39+ "data-source" ,
40+ "x-mitre-data-source" ,
41+ "event" ,
42+ "external-reference" ,
43+ "feedback" ,
44+ "x-opencti-feedback" ,
45+ "grouping" ,
46+ "identity" ,
47+ "incident" ,
48+ "indicator" ,
49+ "infrastructure" ,
50+ "intrusion-set" ,
51+ "language" ,
52+ "location" ,
53+ "malware" ,
54+ "malware-analysis" ,
55+ "marking-definition" ,
56+ "narrative" ,
57+ "note" ,
58+ "observed-data" ,
59+ "opinion" ,
60+ "report" ,
61+ "task" ,
62+ "x-opencti-task" ,
63+ "threat-actor" ,
64+ "tool" ,
65+ "vulnerability" ,
66+ ]
67+
2068SUPPORTED_STIX_ENTITY_OBJECTS = [
2169 "attack-pattern" ,
2270 "campaign" ,
You can’t perform that action at this time.
0 commit comments