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

Commit e165ac1

Browse files
authored
Merge pull request #680 from OpenCTI-Platform/opencti/issue/6171-promote-no-breaking-api
[client] deprecate SCO promote_to_indicator in favor of promote_to_indicator_v2 (#6171)
2 parents 2a70ed6 + 98d588e commit e165ac1

File tree

11 files changed

+987
-878
lines changed

11 files changed

+987
-878
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# coding: utf-8
2+
3+
from pycti import OpenCTIApiClient
4+
5+
# Variables
6+
api_url = "http://opencti:4000"
7+
api_token = "bfa014e0-e02e-4aa6-a42b-603b19dcf159"
8+
9+
# OpenCTI initialization
10+
opencti_api_client = OpenCTIApiClient(api_url, api_token)
11+
12+
obs = opencti_api_client.stix_cyber_observable.create(
13+
simple_observable_key="IPv4-Addr.value", simple_observable_value="55.55.55.99"
14+
)
15+
indicator = opencti_api_client.stix_cyber_observable.promote_to_indicator_v2(
16+
id=obs.get("id")
17+
)
18+
print("promoted observable, new indicator is", indicator)

pycti/entities/indicator/__init__.py

Whitespace-only changes.
Lines changed: 256 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
1+
INDICATOR_PROPERTIES = """
2+
id
3+
standard_id
4+
entity_type
5+
parent_types
6+
spec_version
7+
created_at
8+
updated_at
9+
creators {
10+
id
11+
name
12+
}
13+
createdBy {
14+
... on Identity {
15+
id
16+
standard_id
17+
entity_type
18+
parent_types
19+
spec_version
20+
identity_class
21+
name
22+
description
23+
roles
24+
contact_information
25+
x_opencti_aliases
26+
created
27+
modified
28+
objectLabel {
29+
id
30+
value
31+
color
32+
}
33+
}
34+
... on Organization {
35+
x_opencti_organization_type
36+
x_opencti_reliability
37+
}
38+
... on Individual {
39+
x_opencti_firstname
40+
x_opencti_lastname
41+
}
42+
}
43+
objectOrganization {
44+
id
45+
standard_id
46+
name
47+
}
48+
objectMarking {
49+
id
50+
standard_id
51+
entity_type
52+
definition_type
53+
definition
54+
created
55+
modified
56+
x_opencti_order
57+
x_opencti_color
58+
}
59+
objectLabel {
60+
id
61+
value
62+
color
63+
}
64+
externalReferences {
65+
edges {
66+
node {
67+
id
68+
standard_id
69+
entity_type
70+
source_name
71+
description
72+
url
73+
hash
74+
external_id
75+
created
76+
modified
77+
}
78+
}
79+
}
80+
revoked
81+
confidence
82+
created
83+
modified
84+
pattern_type
85+
pattern_version
86+
pattern
87+
name
88+
description
89+
indicator_types
90+
valid_from
91+
valid_until
92+
x_opencti_score
93+
x_opencti_detection
94+
x_opencti_main_observable_type
95+
x_mitre_platforms
96+
observables {
97+
edges {
98+
node {
99+
id
100+
entity_type
101+
observable_value
102+
}
103+
}
104+
}
105+
killChainPhases {
106+
id
107+
standard_id
108+
entity_type
109+
kill_chain_name
110+
phase_name
111+
x_opencti_order
112+
created
113+
modified
114+
}
115+
"""
116+
INDICATOR_PROPERTIES_WITH_FILES = """
117+
id
118+
standard_id
119+
entity_type
120+
parent_types
121+
spec_version
122+
created_at
123+
updated_at
124+
creators {
125+
id
126+
name
127+
}
128+
createdBy {
129+
... on Identity {
130+
id
131+
standard_id
132+
entity_type
133+
parent_types
134+
spec_version
135+
identity_class
136+
name
137+
description
138+
roles
139+
contact_information
140+
x_opencti_aliases
141+
created
142+
modified
143+
objectLabel {
144+
id
145+
value
146+
color
147+
}
148+
}
149+
... on Organization {
150+
x_opencti_organization_type
151+
x_opencti_reliability
152+
}
153+
... on Individual {
154+
x_opencti_firstname
155+
x_opencti_lastname
156+
}
157+
}
158+
objectOrganization {
159+
id
160+
standard_id
161+
name
162+
}
163+
objectMarking {
164+
id
165+
standard_id
166+
entity_type
167+
definition_type
168+
definition
169+
created
170+
modified
171+
x_opencti_order
172+
x_opencti_color
173+
}
174+
objectLabel {
175+
id
176+
value
177+
color
178+
}
179+
externalReferences {
180+
edges {
181+
node {
182+
id
183+
standard_id
184+
entity_type
185+
source_name
186+
description
187+
url
188+
hash
189+
external_id
190+
created
191+
modified
192+
importFiles {
193+
edges {
194+
node {
195+
id
196+
name
197+
size
198+
metaData {
199+
mimetype
200+
version
201+
}
202+
}
203+
}
204+
}
205+
}
206+
}
207+
}
208+
revoked
209+
confidence
210+
created
211+
modified
212+
pattern_type
213+
pattern_version
214+
pattern
215+
name
216+
description
217+
indicator_types
218+
valid_from
219+
valid_until
220+
x_opencti_score
221+
x_opencti_detection
222+
x_opencti_main_observable_type
223+
x_mitre_platforms
224+
observables {
225+
edges {
226+
node {
227+
id
228+
entity_type
229+
observable_value
230+
}
231+
}
232+
}
233+
killChainPhases {
234+
id
235+
standard_id
236+
entity_type
237+
kill_chain_name
238+
phase_name
239+
x_opencti_order
240+
created
241+
modified
242+
}
243+
importFiles {
244+
edges {
245+
node {
246+
id
247+
name
248+
size
249+
metaData {
250+
mimetype
251+
version
252+
}
253+
}
254+
}
255+
}
256+
"""

0 commit comments

Comments
 (0)