@@ -12,6 +12,114 @@ class AttackPattern:
1212 def __init__ (self , opencti ):
1313 self .opencti = opencti
1414 self .properties = """
15+ id
16+ standard_id
17+ entity_type
18+ parent_types
19+ spec_version
20+ created_at
21+ updated_at
22+ createdBy {
23+ ... on Identity {
24+ id
25+ standard_id
26+ entity_type
27+ parent_types
28+ spec_version
29+ identity_class
30+ name
31+ description
32+ roles
33+ contact_information
34+ x_opencti_aliases
35+ created
36+ modified
37+ objectLabel {
38+ edges {
39+ node {
40+ id
41+ value
42+ color
43+ }
44+ }
45+ }
46+ }
47+ ... on Organization {
48+ x_opencti_organization_type
49+ x_opencti_reliability
50+ }
51+ ... on Individual {
52+ x_opencti_firstname
53+ x_opencti_lastname
54+ }
55+ }
56+ objectMarking {
57+ edges {
58+ node {
59+ id
60+ standard_id
61+ entity_type
62+ definition_type
63+ definition
64+ created
65+ modified
66+ x_opencti_order
67+ x_opencti_color
68+ }
69+ }
70+ }
71+ objectLabel {
72+ edges {
73+ node {
74+ id
75+ value
76+ color
77+ }
78+ }
79+ }
80+ externalReferences {
81+ edges {
82+ node {
83+ id
84+ standard_id
85+ entity_type
86+ source_name
87+ description
88+ url
89+ hash
90+ external_id
91+ created
92+ modified
93+ }
94+ }
95+ }
96+ revoked
97+ confidence
98+ created
99+ modified
100+ name
101+ description
102+ aliases
103+ x_mitre_platforms
104+ x_mitre_permissions_required
105+ x_mitre_detection
106+ x_mitre_id
107+ killChainPhases {
108+ edges {
109+ node {
110+ id
111+ standard_id
112+ entity_type
113+ kill_chain_name
114+ phase_name
115+ x_opencti_order
116+ created
117+ modified
118+ }
119+ }
120+ }
121+ """
122+ self .properties_with_files = """
15123 id
16124 standard_id
17125 entity_type
@@ -177,6 +285,7 @@ def list(self, **kwargs):
177285 custom_attributes = kwargs .get ("customAttributes" , None )
178286 get_all = kwargs .get ("getAll" , False )
179287 with_pagination = kwargs .get ("withPagination" , False )
288+ with_files = kwargs .get ("withFiles" , False )
180289 if get_all :
181290 first = 500
182291
@@ -188,7 +297,11 @@ def list(self, **kwargs):
188297 edges {
189298 node {
190299 """
191- + (custom_attributes if custom_attributes is not None else self .properties )
300+ + (
301+ custom_attributes
302+ if custom_attributes is not None
303+ else (self .properties_with_files if with_files else self .properties )
304+ )
192305 + """
193306 }
194307 }
@@ -252,6 +365,7 @@ def read(self, **kwargs):
252365 id = kwargs .get ("id" , None )
253366 filters = kwargs .get ("filters" , None )
254367 custom_attributes = kwargs .get ("customAttributes" , None )
368+ with_files = kwargs .get ("withFiles" , False )
255369 if id is not None :
256370 LOGGER .info ("Reading Attack-Pattern {%s}." , id )
257371 query = (
@@ -262,7 +376,7 @@ def read(self, **kwargs):
262376 + (
263377 custom_attributes
264378 if custom_attributes is not None
265- else self .properties
379+ else ( self .properties_with_files if with_files else self . properties )
266380 )
267381 + """
268382 }
0 commit comments