Class: Falcon::SampleUploads

Inherits:
Object
  • Object
show all
Defined in:
lib/crimson-falcon/api/sample_uploads.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SampleUploads

Returns a new instance of SampleUploads.



36
37
38
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 36

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



34
35
36
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 34

def api_client
  @api_client
end

Instance Method Details

#archive_delete_v1(id, opts = {}) ⇒ nil

Delete an archive that was uploaded previously

Parameters:

  • id (String)

    The archive SHA256.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


43
44
45
46
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 43

def archive_delete_v1(id, opts = {})
  archive_delete_v1_with_http_info(id, opts)
  nil
end

#archive_delete_v1_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an archive that was uploaded previously

Parameters:

  • id (String)

    The archive SHA256.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 52

def archive_delete_v1_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SampleUploads.archive_delete_v1 ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SampleUploads.archive_delete_v1"
  end
  # resource path
  local_var_path = '/archives/entities/archives/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'id'] = id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"SampleUploads.archive_delete_v1",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SampleUploads#archive_delete_v1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#archive_get_v1(id, opts = {}) ⇒ ClientArchiveCreateResponseV1

Retrieves the archives upload operation statuses. Status ‘done` means that archive was processed successfully. Status `error` means that archive was not processed successfully.

Parameters:

  • id (String)

    The archive SHA256.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include_files (Boolean)

    If &#x60;true&#x60; includes processed archive files in response. (default to false)

Returns:



106
107
108
109
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 106

def archive_get_v1(id, opts = {})
  data, _status_code, _headers = archive_get_v1_with_http_info(id, opts)
  data
end

#archive_get_v1_with_http_info(id, opts = {}) ⇒ Array<(ClientArchiveCreateResponseV1, Integer, Hash)>

Retrieves the archives upload operation statuses. Status &#x60;done&#x60; means that archive was processed successfully. Status &#x60;error&#x60; means that archive was not processed successfully.

Parameters:

  • id (String)

    The archive SHA256.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include_files (Boolean)

    If &#x60;true&#x60; includes processed archive files in response. (default to false)

Returns:



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 116

def archive_get_v1_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SampleUploads.archive_get_v1 ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SampleUploads.archive_get_v1"
  end
  # resource path
  local_var_path = '/archives/entities/archives/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'id'] = id
  query_params[:'include_files'] = opts[:'include_files'] if !opts[:'include_files'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ClientArchiveCreateResponseV1'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"SampleUploads.archive_get_v1",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SampleUploads#archive_get_v1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#archive_list_v1(id, opts = {}) ⇒ ClientArchiveListFilesResponseV1

Retrieves the archives files in chunks.

Parameters:

  • id (String)

    The archive SHA256.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Max number of files to retrieve. (default to 100)

  • :offset (String)

    Offset from where to get files.

Returns:



172
173
174
175
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 172

def archive_list_v1(id, opts = {})
  data, _status_code, _headers = archive_list_v1_with_http_info(id, opts)
  data
end

#archive_list_v1_with_http_info(id, opts = {}) ⇒ Array<(ClientArchiveListFilesResponseV1, Integer, Hash)>

Retrieves the archives files in chunks.

Parameters:

  • id (String)

    The archive SHA256.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Max number of files to retrieve. (default to 100)

  • :offset (String)

    Offset from where to get files.

Returns:



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 183

def archive_list_v1_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SampleUploads.archive_list_v1 ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SampleUploads.archive_list_v1"
  end
  # resource path
  local_var_path = '/archives/entities/archive-files/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'id'] = id
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ClientArchiveListFilesResponseV1'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"SampleUploads.archive_list_v1",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SampleUploads#archive_list_v1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#archive_upload_v1(name, body, opts = {}) ⇒ ClientArchiveCreateResponseV1

Uploads an archive and extracts files list from it. Operation is asynchronous use ‘/archives/entities/archives/v1` to check the status. After uploading, use `/archives/entities/extractions/v1` to copy the file to internal storage making it available for content analysis. This method is deprecated in favor of `/archives/entities/archives/v2`

Parameters:

  • name (String)

    Name of the archive.

  • body (Array<Integer>)

    Content of the uploaded archive in binary format. For example, use &#x60;–data-binary @$FILE_PATH&#x60; when using cURL. Max file size: 100 MB. Accepted file formats: - Portable executables: &#x60;.zip&#x60;, &#x60;.7z&#x60;.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :password (String)

    Archive password.

  • :is_confidential (Boolean)

    Defines visibility of this file, either via the API or the Falcon console. - &#x60;true&#x60;: File is only shown to users within your customer account - &#x60;false&#x60;: File can be seen by other CrowdStrike customers Default: &#x60;true&#x60;. (default to true)

  • :comment (String)

    A descriptive comment to identify the file for other users.

Returns:



242
243
244
245
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 242

def archive_upload_v1(name, body, opts = {})
  data, _status_code, _headers = archive_upload_v1_with_http_info(name, body, opts)
  data
end

#archive_upload_v1_with_http_info(name, body, opts = {}) ⇒ Array<(ClientArchiveCreateResponseV1, Integer, Hash)>

Uploads an archive and extracts files list from it. Operation is asynchronous use &#x60;/archives/entities/archives/v1&#x60; to check the status. After uploading, use &#x60;/archives/entities/extractions/v1&#x60; to copy the file to internal storage making it available for content analysis. This method is deprecated in favor of &#x60;/archives/entities/archives/v2&#x60;

Parameters:

  • name (String)

    Name of the archive.

  • body (Array<Integer>)

    Content of the uploaded archive in binary format. For example, use &#x60;–data-binary @$FILE_PATH&#x60; when using cURL. Max file size: 100 MB. Accepted file formats: - Portable executables: &#x60;.zip&#x60;, &#x60;.7z&#x60;.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :password (String)

    Archive password.

  • :is_confidential (Boolean)

    Defines visibility of this file, either via the API or the Falcon console. - &#x60;true&#x60;: File is only shown to users within your customer account - &#x60;false&#x60;: File can be seen by other CrowdStrike customers Default: &#x60;true&#x60;. (default to true)

  • :comment (String)

    A descriptive comment to identify the file for other users.

Returns:



255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 255

def archive_upload_v1_with_http_info(name, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SampleUploads.archive_upload_v1 ...'
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling SampleUploads.archive_upload_v1"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling SampleUploads.archive_upload_v1"
  end
  # resource path
  local_var_path = '/archives/entities/archives/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'name'] = name
  query_params[:'password'] = opts[:'password'] if !opts[:'password'].nil?
  query_params[:'is_confidential'] = opts[:'is_confidential'] if !opts[:'is_confidential'].nil?
  query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/octet-stream', 'application/zip', 'application/x-7z-compressed', 'application/x-zip-compressed'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'ClientArchiveCreateResponseV1'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"SampleUploads.archive_upload_v1",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SampleUploads#archive_upload_v1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#archive_upload_v2(file, name, opts = {}) ⇒ ClientArchiveCreateResponseV1

Uploads an archive and extracts files list from it. Operation is asynchronous use ‘/archives/entities/archives/v1` to check the status. After uploading, use `/archives/entities/extractions/v1` to copy the file to internal storage making it available for content analysis.

Parameters:

  • file (File)

    Content of the uploaded archive. For example, use &#x60;–form file&#x3D;@$FILE_PATH;type&#x3D;&#x60; when using cURL. Supported file types are &#x60;application/zip&#x60; and &#x60;application/x-7z-compressed&#x60;.

  • name (String)

    Name of the archive. For example, use &#x60;–form name&#x3D;&#x60; when using cURL.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :password (String)

    Archive password. For example, use &#x60;–form password&#x3D;&#x60; when using cURL.

  • :is_confidential (Boolean)

    Defines visibility of this file in Falcon MalQuery, either via the API or the Falcon console. For example, use &#x60;–form is_confidential&#x3D;&#x60; when using cURL. - &#x60;true&#x60;: File is only shown to users within your customer account - &#x60;false&#x60;: File can be seen by other CrowdStrike customers Default: &#x60;true&#x60;. (default to true)

  • :comment (String)

    A descriptive comment to identify the file for other users. For example, use &#x60;–form comment&#x3D;&#x60; when using cURL.

Returns:



324
325
326
327
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 324

def archive_upload_v2(file, name, opts = {})
  data, _status_code, _headers = archive_upload_v2_with_http_info(file, name, opts)
  data
end

#archive_upload_v2_with_http_info(file, name, opts = {}) ⇒ Array<(ClientArchiveCreateResponseV1, Integer, Hash)>

Uploads an archive and extracts files list from it. Operation is asynchronous use &#x60;/archives/entities/archives/v1&#x60; to check the status. After uploading, use &#x60;/archives/entities/extractions/v1&#x60; to copy the file to internal storage making it available for content analysis.

Parameters:

  • file (File)

    Content of the uploaded archive. For example, use &#x60;–form file&#x3D;@$FILE_PATH;type&#x3D;&#x60; when using cURL. Supported file types are &#x60;application/zip&#x60; and &#x60;application/x-7z-compressed&#x60;.

  • name (String)

    Name of the archive. For example, use &#x60;–form name&#x3D;&#x60; when using cURL.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :password (String)

    Archive password. For example, use &#x60;–form password&#x3D;&#x60; when using cURL.

  • :is_confidential (Boolean)

    Defines visibility of this file in Falcon MalQuery, either via the API or the Falcon console. For example, use &#x60;–form is_confidential&#x3D;&#x60; when using cURL. - &#x60;true&#x60;: File is only shown to users within your customer account - &#x60;false&#x60;: File can be seen by other CrowdStrike customers Default: &#x60;true&#x60;. (default to true)

  • :comment (String)

    A descriptive comment to identify the file for other users. For example, use &#x60;–form comment&#x3D;&#x60; when using cURL.

Returns:



337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 337

def archive_upload_v2_with_http_info(file, name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SampleUploads.archive_upload_v2 ...'
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling SampleUploads.archive_upload_v2"
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling SampleUploads.archive_upload_v2"
  end
  # resource path
  local_var_path = '/archives/entities/archives/v2'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['multipart/form-data'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['file'] = file
  form_params['name'] = name
  form_params['password'] = opts[:'password'] if !opts[:'password'].nil?
  form_params['is_confidential'] = opts[:'is_confidential'] if !opts[:'is_confidential'].nil?
  form_params['comment'] = opts[:'comment'] if !opts[:'comment'].nil?

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ClientArchiveCreateResponseV1'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"SampleUploads.archive_upload_v2",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SampleUploads#archive_upload_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_sample_v3(ids, opts = {}) ⇒ MsaQueryResponse

Removes a sample, including file, meta and submissions from the collection

Parameters:

  • ids (String)

    The file SHA256.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



403
404
405
406
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 403

def delete_sample_v3(ids, opts = {})
  data, _status_code, _headers = delete_sample_v3_with_http_info(ids, opts)
  data
end

#delete_sample_v3_with_http_info(ids, opts = {}) ⇒ Array<(MsaQueryResponse, Integer, Hash)>

Removes a sample, including file, meta and submissions from the collection

Parameters:

  • ids (String)

    The file SHA256.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(MsaQueryResponse, Integer, Hash)>)

    MsaQueryResponse data, response status code and response headers



412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 412

def delete_sample_v3_with_http_info(ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SampleUploads.delete_sample_v3 ...'
  end
  # verify the required parameter 'ids' is set
  if @api_client.config.client_side_validation && ids.nil?
    fail ArgumentError, "Missing the required parameter 'ids' when calling SampleUploads.delete_sample_v3"
  end
  # resource path
  local_var_path = '/samples/entities/samples/v3'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ids'] = ids

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'MsaQueryResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"SampleUploads.delete_sample_v3",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SampleUploads#delete_sample_v3\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#extraction_create_v1(body, opts = {}) ⇒ ClientExtractionCreateResponseV1

Extracts files from an uploaded archive and copies them to internal storage making it available for content analysis.

Parameters:

Returns:



465
466
467
468
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 465

def extraction_create_v1(body, opts = {})
  data, _status_code, _headers = extraction_create_v1_with_http_info(body, opts)
  data
end

#extraction_create_v1_with_http_info(body, opts = {}) ⇒ Array<(ClientExtractionCreateResponseV1, Integer, Hash)>

Extracts files from an uploaded archive and copies them to internal storage making it available for content analysis.

Parameters:

Returns:



474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 474

def extraction_create_v1_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SampleUploads.extraction_create_v1 ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling SampleUploads.extraction_create_v1"
  end
  # resource path
  local_var_path = '/archives/entities/extractions/v1'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'ClientExtractionCreateResponseV1'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"SampleUploads.extraction_create_v1",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SampleUploads#extraction_create_v1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#extraction_get_v1(id, opts = {}) ⇒ ClientExtractionCreateResponseV1

Retrieves the files extraction operation statuses. Status ‘done` means that all files were processed successfully. Status `error` means that at least one of the file could not be processed.

Parameters:

  • id (String)

    The extraction operation ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include_files (Boolean)

    If &#x60;true&#x60; includes processed archive files in response. (default to false)

Returns:



532
533
534
535
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 532

def extraction_get_v1(id, opts = {})
  data, _status_code, _headers = extraction_get_v1_with_http_info(id, opts)
  data
end

#extraction_get_v1_with_http_info(id, opts = {}) ⇒ Array<(ClientExtractionCreateResponseV1, Integer, Hash)>

Retrieves the files extraction operation statuses. Status &#x60;done&#x60; means that all files were processed successfully. Status &#x60;error&#x60; means that at least one of the file could not be processed.

Parameters:

  • id (String)

    The extraction operation ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include_files (Boolean)

    If &#x60;true&#x60; includes processed archive files in response. (default to false)

Returns:



542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 542

def extraction_get_v1_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SampleUploads.extraction_get_v1 ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SampleUploads.extraction_get_v1"
  end
  # resource path
  local_var_path = '/archives/entities/extractions/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'id'] = id
  query_params[:'include_files'] = opts[:'include_files'] if !opts[:'include_files'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ClientExtractionCreateResponseV1'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"SampleUploads.extraction_get_v1",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SampleUploads#extraction_get_v1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#extraction_list_v1(id, opts = {}) ⇒ ClientExtractionListFilesResponseV1

Retrieves the files extractions in chunks. Status ‘done` means that all files were processed successfully. Status `error` means that at least one of the file could not be processed.

Parameters:

  • id (String)

    The extraction operation ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Max number of file extractions to retrieve. (default to 0)

  • :offset (String)

    Offset from where to get file extractions.

Returns:



598
599
600
601
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 598

def extraction_list_v1(id, opts = {})
  data, _status_code, _headers = extraction_list_v1_with_http_info(id, opts)
  data
end

#extraction_list_v1_with_http_info(id, opts = {}) ⇒ Array<(ClientExtractionListFilesResponseV1, Integer, Hash)>

Retrieves the files extractions in chunks. Status &#x60;done&#x60; means that all files were processed successfully. Status &#x60;error&#x60; means that at least one of the file could not be processed.

Parameters:

  • id (String)

    The extraction operation ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Max number of file extractions to retrieve. (default to 0)

  • :offset (String)

    Offset from where to get file extractions.

Returns:



609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 609

def extraction_list_v1_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SampleUploads.extraction_list_v1 ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SampleUploads.extraction_list_v1"
  end
  # resource path
  local_var_path = '/archives/entities/extraction-files/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'id'] = id
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ClientExtractionListFilesResponseV1'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"SampleUploads.extraction_list_v1",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SampleUploads#extraction_list_v1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_sample_v3(ids, opts = {}) ⇒ String

Retrieves the file associated with the given ID (SHA256)

Parameters:

  • ids (String)

    The file SHA256.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :password_protected (Boolean)

    Flag whether the sample should be zipped and password protected with pass&#x3D;&#39;infected&#39; (default to false)

Returns:

  • (String)


665
666
667
668
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 665

def get_sample_v3(ids, opts = {})
  data, _status_code, _headers = get_sample_v3_with_http_info(ids, opts)
  data
end

#get_sample_v3_with_http_info(ids, opts = {}) ⇒ Array<(String, Integer, Hash)>

Retrieves the file associated with the given ID (SHA256)

Parameters:

  • ids (String)

    The file SHA256.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :password_protected (Boolean)

    Flag whether the sample should be zipped and password protected with pass&#x3D;&#39;infected&#39; (default to false)

Returns:

  • (Array<(String, Integer, Hash)>)

    String data, response status code and response headers



675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 675

def get_sample_v3_with_http_info(ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SampleUploads.get_sample_v3 ...'
  end
  # verify the required parameter 'ids' is set
  if @api_client.config.client_side_validation && ids.nil?
    fail ArgumentError, "Missing the required parameter 'ids' when calling SampleUploads.get_sample_v3"
  end
  # resource path
  local_var_path = '/samples/entities/samples/v3'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ids'] = ids
  query_params[:'password_protected'] = opts[:'password_protected'] if !opts[:'password_protected'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'String'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"SampleUploads.get_sample_v3",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SampleUploads#get_sample_v3\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upload_sample_v3(sample, file_name, opts = {}) ⇒ ClientSampleMetadataResponseV2

Upload a file for further cloud analysis. After uploading, call the specific analysis API endpoint.

Parameters:

  • sample (File)

    Content of the uploaded sample in binary format. For example, use &#x60;–data-binary @$FILE_PATH&#x60; when using cURL. Max file size: 256 MB. Accepted file formats: - Portable executables: &#x60;.exe&#x60;, &#x60;.scr&#x60;, &#x60;.pif&#x60;, &#x60;.dll&#x60;, &#x60;.com&#x60;, &#x60;.cpl&#x60;, etc. - Office documents: &#x60;.doc&#x60;, &#x60;.docx&#x60;, &#x60;.ppt&#x60;, &#x60;.pps&#x60;, &#x60;.pptx&#x60;, &#x60;.ppsx&#x60;, &#x60;.xls&#x60;, &#x60;.xlsx&#x60;, &#x60;.rtf&#x60;, &#x60;.pub&#x60; - PDF - APK - Executable JAR - Windows script component: &#x60;.sct&#x60; - Windows shortcut: &#x60;.lnk&#x60; - Windows help: &#x60;.chm&#x60; - HTML application: &#x60;.hta&#x60; - Windows script file: &#x60;.wsf&#x60; - Javascript: &#x60;.js&#x60; - Visual Basic: &#x60;.vbs&#x60;, &#x60;.vbe&#x60; - Shockwave Flash: &#x60;.swf&#x60; - Perl: &#x60;.pl&#x60; - Powershell: &#x60;.ps1&#x60;, &#x60;.psd1&#x60;, &#x60;.psm1&#x60; - Scalable vector graphics: &#x60;.svg&#x60; - Python: &#x60;.py&#x60; - Linux ELF executables - Email files: MIME RFC 822 &#x60;.eml&#x60;, Outlook &#x60;.msg&#x60;.

  • file_name (String)

    Name of the file.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :comment (String)

    A descriptive comment to identify the file for other users.

  • :is_confidential (Boolean)

    Defines visibility of this file in Falcon MalQuery, either via the API or the Falcon console. - &#x60;true&#x60;: File is only shown to users within your customer account - &#x60;false&#x60;: File can be seen by other CrowdStrike customers Default: &#x60;true&#x60;. (default to true)

Returns:



732
733
734
735
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 732

def upload_sample_v3(sample, file_name, opts = {})
  data, _status_code, _headers = upload_sample_v3_with_http_info(sample, file_name, opts)
  data
end

#upload_sample_v3_with_http_info(sample, file_name, opts = {}) ⇒ Array<(ClientSampleMetadataResponseV2, Integer, Hash)>

Upload a file for further cloud analysis. After uploading, call the specific analysis API endpoint.

Parameters:

  • sample (File)

    Content of the uploaded sample in binary format. For example, use &#x60;–data-binary @$FILE_PATH&#x60; when using cURL. Max file size: 256 MB. Accepted file formats: - Portable executables: &#x60;.exe&#x60;, &#x60;.scr&#x60;, &#x60;.pif&#x60;, &#x60;.dll&#x60;, &#x60;.com&#x60;, &#x60;.cpl&#x60;, etc. - Office documents: &#x60;.doc&#x60;, &#x60;.docx&#x60;, &#x60;.ppt&#x60;, &#x60;.pps&#x60;, &#x60;.pptx&#x60;, &#x60;.ppsx&#x60;, &#x60;.xls&#x60;, &#x60;.xlsx&#x60;, &#x60;.rtf&#x60;, &#x60;.pub&#x60; - PDF - APK - Executable JAR - Windows script component: &#x60;.sct&#x60; - Windows shortcut: &#x60;.lnk&#x60; - Windows help: &#x60;.chm&#x60; - HTML application: &#x60;.hta&#x60; - Windows script file: &#x60;.wsf&#x60; - Javascript: &#x60;.js&#x60; - Visual Basic: &#x60;.vbs&#x60;, &#x60;.vbe&#x60; - Shockwave Flash: &#x60;.swf&#x60; - Perl: &#x60;.pl&#x60; - Powershell: &#x60;.ps1&#x60;, &#x60;.psd1&#x60;, &#x60;.psm1&#x60; - Scalable vector graphics: &#x60;.svg&#x60; - Python: &#x60;.py&#x60; - Linux ELF executables - Email files: MIME RFC 822 &#x60;.eml&#x60;, Outlook &#x60;.msg&#x60;.

  • file_name (String)

    Name of the file.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :comment (String)

    A descriptive comment to identify the file for other users.

  • :is_confidential (Boolean)

    Defines visibility of this file in Falcon MalQuery, either via the API or the Falcon console. - &#x60;true&#x60;: File is only shown to users within your customer account - &#x60;false&#x60;: File can be seen by other CrowdStrike customers Default: &#x60;true&#x60;. (default to true)

Returns:



744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
# File 'lib/crimson-falcon/api/sample_uploads.rb', line 744

def upload_sample_v3_with_http_info(sample, file_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SampleUploads.upload_sample_v3 ...'
  end
  # verify the required parameter 'sample' is set
  if @api_client.config.client_side_validation && sample.nil?
    fail ArgumentError, "Missing the required parameter 'sample' when calling SampleUploads.upload_sample_v3"
  end
  # verify the required parameter 'file_name' is set
  if @api_client.config.client_side_validation && file_name.nil?
    fail ArgumentError, "Missing the required parameter 'file_name' when calling SampleUploads.upload_sample_v3"
  end
  # resource path
  local_var_path = '/samples/entities/samples/v3'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['multipart/form-data', 'application/octet-stream'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['sample'] = sample
  form_params['file_name'] = file_name
  form_params['comment'] = opts[:'comment'] if !opts[:'comment'].nil?
  form_params['is_confidential'] = opts[:'is_confidential'] if !opts[:'is_confidential'].nil?

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ClientSampleMetadataResponseV2'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"SampleUploads.upload_sample_v3",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SampleUploads#upload_sample_v3\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end