Class: Falcon::RealTimeResponseAdminApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ RealTimeResponseAdminApi

Returns a new instance of RealTimeResponseAdminApi.



36
37
38
# File 'lib/crimson-falcon/api/real_time_response_admin_api.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/real_time_response_admin_api.rb', line 34

def api_client
  @api_client
end

Instance Method Details

#batch_admin_cmd(body, opts = {}) ⇒ DomainMultiCommandExecuteResponseWrapper

Batch executes a RTR administrator command across the hosts mapped to the given batch ID.

Parameters:

  • body (DomainBatchExecuteCommandRequest)

    Use this endpoint to run these [real time response commands](falcon.crowdstrike.com/support/documentation/11/getting-started-guide#rtr_commands): - `cat` - `cd` - `clear` - `cp` - `encrypt` - `env` - `eventlog` - `filehash` - `get` - `getsid` - `help` - `history` - `ipconfig` - `kill` - `ls` - `map` - `memdump` - `mkdir` - `mount` - `mv` - `netstat` - `ps` - `put` - `reg query` - `reg set` - `reg delete` - `reg load` - `reg unload` - `restart` - `rm` - `run` - `runscript` - `shutdown` - `unmap` - `update history` - `update install` - `update list` - `update query` - `xmemdump` - `zip` **`base_command`** Active-Responder command type we are going to execute, for example: `get` or `cp`. Refer to the RTR documentation for the full list of commands. **`batch_id`** Batch ID to execute the command on. Received from `/real-time-response/combined/batch-init-session/v1`. **`command_string`** Full command string for the command. For example `get some_file.txt` **`optional_hosts`** List of a subset of hosts we want to run the command on. If this list is supplied, only these hosts will receive the command.

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

    the optional parameters

Options Hash (opts):

  • :timeout (Integer)

    Timeout for how long to wait for the request in seconds, default timeout is 30 seconds. Maximum is 5 minutes. (default to 30)

  • :timeout_duration (String)

    Timeout duration for how long to wait for the request in duration syntax. Example, `10s`. Valid units: `ns, us, ms, s, m, h`. Maximum is 5 minutes. (default to ‘30s’)

  • :host_timeout_duration (String)

    Timeout duration for how long a host has time to complete processing. Default value is a bit less than the overall timeout value. It cannot be greater than the overall request timeout. Maximum is < 5 minutes. Example, `10s`. Valid units: `ns, us, ms, s, m, h`. (default to ‘tiny bit less than overall request timeout’)

Returns:



46
47
48
49
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 46

def batch_admin_cmd(body, opts = {})
  data, _status_code, _headers = batch_admin_cmd_with_http_info(body, opts)
  data
end

#batch_admin_cmd_with_http_info(body, opts = {}) ⇒ Array<(DomainMultiCommandExecuteResponseWrapper, Integer, Hash)>

Batch executes a RTR administrator command across the hosts mapped to the given batch ID.

Parameters:

  • body (DomainBatchExecuteCommandRequest)

    Use this endpoint to run these [real time response commands](falcon.crowdstrike.com/support/documentation/11/getting-started-guide#rtr_commands): - &#x60;cat&#x60; - &#x60;cd&#x60; - &#x60;clear&#x60; - &#x60;cp&#x60; - &#x60;encrypt&#x60; - &#x60;env&#x60; - &#x60;eventlog&#x60; - &#x60;filehash&#x60; - &#x60;get&#x60; - &#x60;getsid&#x60; - &#x60;help&#x60; - &#x60;history&#x60; - &#x60;ipconfig&#x60; - &#x60;kill&#x60; - &#x60;ls&#x60; - &#x60;map&#x60; - &#x60;memdump&#x60; - &#x60;mkdir&#x60; - &#x60;mount&#x60; - &#x60;mv&#x60; - &#x60;netstat&#x60; - &#x60;ps&#x60; - &#x60;put&#x60; - &#x60;reg query&#x60; - &#x60;reg set&#x60; - &#x60;reg delete&#x60; - &#x60;reg load&#x60; - &#x60;reg unload&#x60; - &#x60;restart&#x60; - &#x60;rm&#x60; - &#x60;run&#x60; - &#x60;runscript&#x60; - &#x60;shutdown&#x60; - &#x60;unmap&#x60; - &#x60;update history&#x60; - &#x60;update install&#x60; - &#x60;update list&#x60; - &#x60;update query&#x60; - &#x60;xmemdump&#x60; - &#x60;zip&#x60; **&#x60;base_command&#x60;** Active-Responder command type we are going to execute, for example: &#x60;get&#x60; or &#x60;cp&#x60;. Refer to the RTR documentation for the full list of commands. **&#x60;batch_id&#x60;** Batch ID to execute the command on. Received from &#x60;/real-time-response/combined/batch-init-session/v1&#x60;. **&#x60;command_string&#x60;** Full command string for the command. For example &#x60;get some_file.txt&#x60; **&#x60;optional_hosts&#x60;** List of a subset of hosts we want to run the command on. If this list is supplied, only these hosts will receive the command.

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

    the optional parameters

Options Hash (opts):

  • :timeout (Integer)

    Timeout for how long to wait for the request in seconds, default timeout is 30 seconds. Maximum is 5 minutes. (default to 30)

  • :timeout_duration (String)

    Timeout duration for how long to wait for the request in duration syntax. Example, &#x60;10s&#x60;. Valid units: &#x60;ns, us, ms, s, m, h&#x60;. Maximum is 5 minutes. (default to ‘30s’)

  • :host_timeout_duration (String)

    Timeout duration for how long a host has time to complete processing. Default value is a bit less than the overall timeout value. It cannot be greater than the overall request timeout. Maximum is &lt; 5 minutes. Example, &#x60;10s&#x60;. Valid units: &#x60;ns, us, ms, s, m, h&#x60;. (default to ‘tiny bit less than overall request timeout’)

Returns:



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
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 58

def batch_admin_cmd_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RealTimeResponseAdminApi.batch_admin_cmd ...'
  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 RealTimeResponseAdminApi.batch_admin_cmd"
  end
  # resource path
  local_var_path = '/real-time-response/combined/batch-admin-command/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'timeout'] = opts[:'timeout'] if !opts[:'timeout'].nil?
  query_params[:'timeout_duration'] = opts[:'timeout_duration'] if !opts[:'timeout_duration'].nil?
  query_params[:'host_timeout_duration'] = opts[:'host_timeout_duration'] if !opts[:'host_timeout_duration'].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/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] || 'DomainMultiCommandExecuteResponseWrapper'

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

  new_options = opts.merge(
    :operation => :"RealTimeResponseAdminApi.batch_admin_cmd",
    :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: RealTimeResponseAdminApi#batch_admin_cmd\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#r_tr_check_admin_command_status(cloud_request_id, sequence_id, opts = {}) ⇒ DomainStatusResponseWrapper

Get status of an executed RTR administrator command on a single host.

Parameters:

  • cloud_request_id (String)

    Cloud Request ID of the executed command to query

  • sequence_id (Integer)

    Sequence ID that we want to retrieve. Command responses are chunked across sequences

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

    the optional parameters

Returns:



119
120
121
122
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 119

def r_tr_check_admin_command_status(cloud_request_id, sequence_id, opts = {})
  data, _status_code, _headers = r_tr_check_admin_command_status_with_http_info(cloud_request_id, sequence_id, opts)
  data
end

#r_tr_check_admin_command_status_with_http_info(cloud_request_id, sequence_id, opts = {}) ⇒ Array<(DomainStatusResponseWrapper, Integer, Hash)>

Get status of an executed RTR administrator command on a single host.

Parameters:

  • cloud_request_id (String)

    Cloud Request ID of the executed command to query

  • sequence_id (Integer)

    Sequence ID that we want to retrieve. Command responses are chunked across sequences

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

    the optional parameters

Returns:

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

    DomainStatusResponseWrapper data, response status code and response headers



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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 129

def r_tr_check_admin_command_status_with_http_info(cloud_request_id, sequence_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RealTimeResponseAdminApi.r_tr_check_admin_command_status ...'
  end
  # verify the required parameter 'cloud_request_id' is set
  if @api_client.config.client_side_validation && cloud_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'cloud_request_id' when calling RealTimeResponseAdminApi.r_tr_check_admin_command_status"
  end
  # verify the required parameter 'sequence_id' is set
  if @api_client.config.client_side_validation && sequence_id.nil?
    fail ArgumentError, "Missing the required parameter 'sequence_id' when calling RealTimeResponseAdminApi.r_tr_check_admin_command_status"
  end
  # resource path
  local_var_path = '/real-time-response/entities/admin-command/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'cloud_request_id'] = cloud_request_id
  query_params[:'sequence_id'] = sequence_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] || 'DomainStatusResponseWrapper'

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

  new_options = opts.merge(
    :operation => :"RealTimeResponseAdminApi.r_tr_check_admin_command_status",
    :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: RealTimeResponseAdminApi#r_tr_check_admin_command_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#r_tr_create_put_files(file, description, opts = {}) ⇒ MsaReplyMetaOnly

Upload a new put-file to use for the RTR ‘put` command.

Parameters:

  • file (File)

    put-file to upload

  • description (String)

    File description

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

    the optional parameters

Options Hash (opts):

  • :name (String)

    File name (if different than actual file name)

  • :comments_for_audit_log (String)

    The audit log comment

Returns:



190
191
192
193
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 190

def r_tr_create_put_files(file, description, opts = {})
  data, _status_code, _headers = r_tr_create_put_files_with_http_info(file, description, opts)
  data
end

#r_tr_create_put_files_with_http_info(file, description, opts = {}) ⇒ Array<(MsaReplyMetaOnly, Integer, Hash)>

Upload a new put-file to use for the RTR &#x60;put&#x60; command.

Parameters:

  • file (File)

    put-file to upload

  • description (String)

    File description

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

    the optional parameters

Options Hash (opts):

  • :name (String)

    File name (if different than actual file name)

  • :comments_for_audit_log (String)

    The audit log comment

Returns:

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

    MsaReplyMetaOnly data, response status code and response headers



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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 202

def r_tr_create_put_files_with_http_info(file, description, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RealTimeResponseAdminApi.r_tr_create_put_files ...'
  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 RealTimeResponseAdminApi.r_tr_create_put_files"
  end
  # verify the required parameter 'description' is set
  if @api_client.config.client_side_validation && description.nil?
    fail ArgumentError, "Missing the required parameter 'description' when calling RealTimeResponseAdminApi.r_tr_create_put_files"
  end
  if @api_client.config.client_side_validation && !opts[:'name'].nil? && opts[:'name'].to_s.length > 32766
    fail ArgumentError, 'invalid value for "opts[:"name"]" when calling RealTimeResponseAdminApi.r_tr_create_put_files, the character length must be smaller than or equal to 32766.'
  end

  if @api_client.config.client_side_validation && !opts[:'comments_for_audit_log'].nil? && opts[:'comments_for_audit_log'].to_s.length > 4096
    fail ArgumentError, 'invalid value for "opts[:"comments_for_audit_log"]" when calling RealTimeResponseAdminApi.r_tr_create_put_files, the character length must be smaller than or equal to 4096.'
  end

  # resource path
  local_var_path = '/real-time-response/entities/put-files/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(['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['description'] = description
  form_params['name'] = opts[:'name'] if !opts[:'name'].nil?
  form_params['comments_for_audit_log'] = opts[:'comments_for_audit_log'] if !opts[:'comments_for_audit_log'].nil?

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

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

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

  new_options = opts.merge(
    :operation => :"RealTimeResponseAdminApi.r_tr_create_put_files",
    :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: RealTimeResponseAdminApi#r_tr_create_put_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#r_tr_create_scripts(description, permission_type, opts = {}) ⇒ MsaReplyMetaOnly

Upload a new custom-script to use for the RTR ‘runscript` command.

Parameters:

  • description (String)

    File description

  • permission_type (String)

    Permission for the custom-script. Valid permission values: - &#x60;private&#x60;, usable by only the user who uploaded it - &#x60;group&#x60;, usable by all RTR Admins - &#x60;public&#x60;, usable by all active-responders and RTR admins

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

    the optional parameters

Options Hash (opts):

  • :file (File)

    custom-script file to upload. These should be powershell scripts.

  • :name (String)

    File name (if different than actual file name)

  • :comments_for_audit_log (String)

    The audit log comment

  • :content (String)

    The script text that you want to use to upload

  • :platform (Array<String>)

    Platforms for the file. Currently supports: windows, mac, linux, . If no platform is provided, it will default to &#39;windows&#39;

Returns:



281
282
283
284
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 281

def r_tr_create_scripts(description, permission_type, opts = {})
  data, _status_code, _headers = r_tr_create_scripts_with_http_info(description, permission_type, opts)
  data
end

#r_tr_create_scripts_with_http_info(description, permission_type, opts = {}) ⇒ Array<(MsaReplyMetaOnly, Integer, Hash)>

Upload a new custom-script to use for the RTR &#x60;runscript&#x60; command.

Parameters:

  • description (String)

    File description

  • permission_type (String)

    Permission for the custom-script. Valid permission values: - &#x60;private&#x60;, usable by only the user who uploaded it - &#x60;group&#x60;, usable by all RTR Admins - &#x60;public&#x60;, usable by all active-responders and RTR admins

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

    the optional parameters

Options Hash (opts):

  • :file (File)

    custom-script file to upload. These should be powershell scripts.

  • :name (String)

    File name (if different than actual file name)

  • :comments_for_audit_log (String)

    The audit log comment

  • :content (String)

    The script text that you want to use to upload

  • :platform (Array<String>)

    Platforms for the file. Currently supports: windows, mac, linux, . If no platform is provided, it will default to &#39;windows&#39;

Returns:

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

    MsaReplyMetaOnly data, response status code and response headers



296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
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
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 296

def r_tr_create_scripts_with_http_info(description, permission_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RealTimeResponseAdminApi.r_tr_create_scripts ...'
  end
  # verify the required parameter 'description' is set
  if @api_client.config.client_side_validation && description.nil?
    fail ArgumentError, "Missing the required parameter 'description' when calling RealTimeResponseAdminApi.r_tr_create_scripts"
  end
  # verify the required parameter 'permission_type' is set
  if @api_client.config.client_side_validation && permission_type.nil?
    fail ArgumentError, "Missing the required parameter 'permission_type' when calling RealTimeResponseAdminApi.r_tr_create_scripts"
  end
  if @api_client.config.client_side_validation && !opts[:'name'].nil? && opts[:'name'].to_s.length > 32766
    fail ArgumentError, 'invalid value for "opts[:"name"]" when calling RealTimeResponseAdminApi.r_tr_create_scripts, the character length must be smaller than or equal to 32766.'
  end

  if @api_client.config.client_side_validation && !opts[:'comments_for_audit_log'].nil? && opts[:'comments_for_audit_log'].to_s.length > 4096
    fail ArgumentError, 'invalid value for "opts[:"comments_for_audit_log"]" when calling RealTimeResponseAdminApi.r_tr_create_scripts, the character length must be smaller than or equal to 4096.'
  end

  # resource path
  local_var_path = '/real-time-response/entities/scripts/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(['multipart/form-data'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['description'] = description
  form_params['permission_type'] = permission_type
  form_params['file'] = opts[:'file'] if !opts[:'file'].nil?
  form_params['name'] = opts[:'name'] if !opts[:'name'].nil?
  form_params['comments_for_audit_log'] = opts[:'comments_for_audit_log'] if !opts[:'comments_for_audit_log'].nil?
  form_params['content'] = opts[:'content'] if !opts[:'content'].nil?
  form_params['platform'] = @api_client.build_collection_param(opts[:'platform'], :csv) if !opts[:'platform'].nil?

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

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

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

  new_options = opts.merge(
    :operation => :"RealTimeResponseAdminApi.r_tr_create_scripts",
    :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: RealTimeResponseAdminApi#r_tr_create_scripts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#r_tr_delete_put_files(ids, opts = {}) ⇒ MsaReplyMetaOnly

Delete a put-file based on the ID given. Can only delete one file at a time.

Parameters:

  • ids (String)

    File id

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

    the optional parameters

Returns:



372
373
374
375
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 372

def r_tr_delete_put_files(ids, opts = {})
  data, _status_code, _headers = r_tr_delete_put_files_with_http_info(ids, opts)
  data
end

#r_tr_delete_put_files_with_http_info(ids, opts = {}) ⇒ Array<(MsaReplyMetaOnly, Integer, Hash)>

Delete a put-file based on the ID given. Can only delete one file at a time.

Parameters:

  • ids (String)

    File id

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

    the optional parameters

Returns:

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

    MsaReplyMetaOnly data, response status code and response headers



381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 381

def r_tr_delete_put_files_with_http_info(ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RealTimeResponseAdminApi.r_tr_delete_put_files ...'
  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 RealTimeResponseAdminApi.r_tr_delete_put_files"
  end
  # resource path
  local_var_path = '/real-time-response/entities/put-files/v1'

  # 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] || 'MsaReplyMetaOnly'

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

  new_options = opts.merge(
    :operation => :"RealTimeResponseAdminApi.r_tr_delete_put_files",
    :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: RealTimeResponseAdminApi#r_tr_delete_put_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#r_tr_delete_scripts(ids, opts = {}) ⇒ MsaReplyMetaOnly

Delete a custom-script based on the ID given. Can only delete one script at a time.

Parameters:

  • ids (String)

    File id

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

    the optional parameters

Returns:



434
435
436
437
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 434

def r_tr_delete_scripts(ids, opts = {})
  data, _status_code, _headers = r_tr_delete_scripts_with_http_info(ids, opts)
  data
end

#r_tr_delete_scripts_with_http_info(ids, opts = {}) ⇒ Array<(MsaReplyMetaOnly, Integer, Hash)>

Delete a custom-script based on the ID given. Can only delete one script at a time.

Parameters:

  • ids (String)

    File id

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

    the optional parameters

Returns:

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

    MsaReplyMetaOnly data, response status code and response headers



443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 443

def r_tr_delete_scripts_with_http_info(ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RealTimeResponseAdminApi.r_tr_delete_scripts ...'
  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 RealTimeResponseAdminApi.r_tr_delete_scripts"
  end
  # resource path
  local_var_path = '/real-time-response/entities/scripts/v1'

  # 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] || 'MsaReplyMetaOnly'

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

  new_options = opts.merge(
    :operation => :"RealTimeResponseAdminApi.r_tr_delete_scripts",
    :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: RealTimeResponseAdminApi#r_tr_delete_scripts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#r_tr_execute_admin_command(body, opts = {}) ⇒ DomainCommandExecuteResponseWrapper

Execute a RTR administrator command on a single host.

Parameters:

  • body (DomainCommandExecuteRequest)

    Use this endpoint to run these [real time response commands](falcon.crowdstrike.com/support/documentation/11/getting-started-guide#rtr_commands): - &#x60;cat&#x60; - &#x60;cd&#x60; - &#x60;clear&#x60; - &#x60;cp&#x60; - &#x60;encrypt&#x60; - &#x60;env&#x60; - &#x60;eventlog&#x60; - &#x60;filehash&#x60; - &#x60;get&#x60; - &#x60;getsid&#x60; - &#x60;help&#x60; - &#x60;history&#x60; - &#x60;ipconfig&#x60; - &#x60;kill&#x60; - &#x60;ls&#x60; - &#x60;map&#x60; - &#x60;memdump&#x60; - &#x60;mkdir&#x60; - &#x60;mount&#x60; - &#x60;mv&#x60; - &#x60;netstat&#x60; - &#x60;ps&#x60; - &#x60;put&#x60; - &#x60;reg query&#x60; - &#x60;reg set&#x60; - &#x60;reg delete&#x60; - &#x60;reg load&#x60; - &#x60;reg unload&#x60; - &#x60;restart&#x60; - &#x60;rm&#x60; - &#x60;run&#x60; - &#x60;runscript&#x60; - &#x60;shutdown&#x60; - &#x60;unmap&#x60; - &#x60;update history&#x60; - &#x60;update install&#x60; - &#x60;update list&#x60; - &#x60;update query&#x60; - &#x60;xmemdump&#x60; - &#x60;zip&#x60; Required values. The rest of the fields are unused. **&#x60;base_command&#x60;** Active-Responder command type we are going to execute, for example: &#x60;get&#x60; or &#x60;cp&#x60;. Refer to the RTR documentation for the full list of commands. **&#x60;command_string&#x60;** Full command string for the command. For example &#x60;get some_file.txt&#x60; **&#x60;session_id&#x60;** RTR session ID to run the command on

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

    the optional parameters

Returns:



496
497
498
499
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 496

def r_tr_execute_admin_command(body, opts = {})
  data, _status_code, _headers = r_tr_execute_admin_command_with_http_info(body, opts)
  data
end

#r_tr_execute_admin_command_with_http_info(body, opts = {}) ⇒ Array<(DomainCommandExecuteResponseWrapper, Integer, Hash)>

Execute a RTR administrator command on a single host.

Parameters:

  • body (DomainCommandExecuteRequest)

    Use this endpoint to run these [real time response commands](falcon.crowdstrike.com/support/documentation/11/getting-started-guide#rtr_commands): - &#x60;cat&#x60; - &#x60;cd&#x60; - &#x60;clear&#x60; - &#x60;cp&#x60; - &#x60;encrypt&#x60; - &#x60;env&#x60; - &#x60;eventlog&#x60; - &#x60;filehash&#x60; - &#x60;get&#x60; - &#x60;getsid&#x60; - &#x60;help&#x60; - &#x60;history&#x60; - &#x60;ipconfig&#x60; - &#x60;kill&#x60; - &#x60;ls&#x60; - &#x60;map&#x60; - &#x60;memdump&#x60; - &#x60;mkdir&#x60; - &#x60;mount&#x60; - &#x60;mv&#x60; - &#x60;netstat&#x60; - &#x60;ps&#x60; - &#x60;put&#x60; - &#x60;reg query&#x60; - &#x60;reg set&#x60; - &#x60;reg delete&#x60; - &#x60;reg load&#x60; - &#x60;reg unload&#x60; - &#x60;restart&#x60; - &#x60;rm&#x60; - &#x60;run&#x60; - &#x60;runscript&#x60; - &#x60;shutdown&#x60; - &#x60;unmap&#x60; - &#x60;update history&#x60; - &#x60;update install&#x60; - &#x60;update list&#x60; - &#x60;update query&#x60; - &#x60;xmemdump&#x60; - &#x60;zip&#x60; Required values. The rest of the fields are unused. **&#x60;base_command&#x60;** Active-Responder command type we are going to execute, for example: &#x60;get&#x60; or &#x60;cp&#x60;. Refer to the RTR documentation for the full list of commands. **&#x60;command_string&#x60;** Full command string for the command. For example &#x60;get some_file.txt&#x60; **&#x60;session_id&#x60;** RTR session ID to run the command on

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

    the optional parameters

Returns:



505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 505

def r_tr_execute_admin_command_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RealTimeResponseAdminApi.r_tr_execute_admin_command ...'
  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 RealTimeResponseAdminApi.r_tr_execute_admin_command"
  end
  # resource path
  local_var_path = '/real-time-response/entities/admin-command/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] || 'DomainCommandExecuteResponseWrapper'

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

  new_options = opts.merge(
    :operation => :"RealTimeResponseAdminApi.r_tr_execute_admin_command",
    :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: RealTimeResponseAdminApi#r_tr_execute_admin_command\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#r_tr_get_falcon_scripts(ids, opts = {}) ⇒ EmpowerapiMsaFalconScriptResponse

Get Falcon scripts with metadata and content of script

Parameters:

  • ids (Array<String>)

    IDs of the Falcon scripts you want to retrieve

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

    the optional parameters

Returns:



562
563
564
565
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 562

def r_tr_get_falcon_scripts(ids, opts = {})
  data, _status_code, _headers = r_tr_get_falcon_scripts_with_http_info(ids, opts)
  data
end

#r_tr_get_falcon_scripts_with_http_info(ids, opts = {}) ⇒ Array<(EmpowerapiMsaFalconScriptResponse, Integer, Hash)>

Get Falcon scripts with metadata and content of script

Parameters:

  • ids (Array<String>)

    IDs of the Falcon scripts you want to retrieve

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

    the optional parameters

Returns:



571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 571

def r_tr_get_falcon_scripts_with_http_info(ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RealTimeResponseAdminApi.r_tr_get_falcon_scripts ...'
  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 RealTimeResponseAdminApi.r_tr_get_falcon_scripts"
  end
  # resource path
  local_var_path = '/real-time-response/entities/falcon-scripts/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ids'] = @api_client.build_collection_param(ids, :multi)

  # 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] || 'EmpowerapiMsaFalconScriptResponse'

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

  new_options = opts.merge(
    :operation => :"RealTimeResponseAdminApi.r_tr_get_falcon_scripts",
    :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: RealTimeResponseAdminApi#r_tr_get_falcon_scripts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#r_tr_get_put_files(ids, opts = {}) ⇒ EmpowerapiMsaPFResponseV1

Get put-files based on the ID’s given. These are used for the RTR ‘put` command.

Parameters:

  • ids (Array<String>)

    File IDs

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

    the optional parameters

Returns:



624
625
626
627
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 624

def r_tr_get_put_files(ids, opts = {})
  data, _status_code, _headers = r_tr_get_put_files_with_http_info(ids, opts)
  data
end

#r_tr_get_put_files_v2(ids, opts = {}) ⇒ EmpowerapiMsaPFResponseV2

Get put-files based on the ID’s given. These are used for the RTR ‘put` command.

Parameters:

  • ids (Array<String>)

    File IDs

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

    the optional parameters

Returns:



686
687
688
689
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 686

def r_tr_get_put_files_v2(ids, opts = {})
  data, _status_code, _headers = r_tr_get_put_files_v2_with_http_info(ids, opts)
  data
end

#r_tr_get_put_files_v2_with_http_info(ids, opts = {}) ⇒ Array<(EmpowerapiMsaPFResponseV2, Integer, Hash)>

Get put-files based on the ID&#39;s given. These are used for the RTR &#x60;put&#x60; command.

Parameters:

  • ids (Array<String>)

    File IDs

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

    the optional parameters

Returns:

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

    EmpowerapiMsaPFResponseV2 data, response status code and response headers



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
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 695

def r_tr_get_put_files_v2_with_http_info(ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RealTimeResponseAdminApi.r_tr_get_put_files_v2 ...'
  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 RealTimeResponseAdminApi.r_tr_get_put_files_v2"
  end
  # resource path
  local_var_path = '/real-time-response/entities/put-files/v2'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ids'] = @api_client.build_collection_param(ids, :multi)

  # 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] || 'EmpowerapiMsaPFResponseV2'

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

  new_options = opts.merge(
    :operation => :"RealTimeResponseAdminApi.r_tr_get_put_files_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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RealTimeResponseAdminApi#r_tr_get_put_files_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#r_tr_get_put_files_with_http_info(ids, opts = {}) ⇒ Array<(EmpowerapiMsaPFResponseV1, Integer, Hash)>

Get put-files based on the ID&#39;s given. These are used for the RTR &#x60;put&#x60; command.

Parameters:

  • ids (Array<String>)

    File IDs

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

    the optional parameters

Returns:

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

    EmpowerapiMsaPFResponseV1 data, response status code and response headers



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
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 633

def r_tr_get_put_files_with_http_info(ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RealTimeResponseAdminApi.r_tr_get_put_files ...'
  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 RealTimeResponseAdminApi.r_tr_get_put_files"
  end
  # resource path
  local_var_path = '/real-time-response/entities/put-files/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ids'] = @api_client.build_collection_param(ids, :multi)

  # 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] || 'EmpowerapiMsaPFResponseV1'

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

  new_options = opts.merge(
    :operation => :"RealTimeResponseAdminApi.r_tr_get_put_files",
    :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: RealTimeResponseAdminApi#r_tr_get_put_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#r_tr_get_scripts(ids, opts = {}) ⇒ EmpowerapiMsaPFResponseV1

Get custom-scripts based on the ID’s given. These are used for the RTR ‘runscript` command.

Parameters:

  • ids (Array<String>)

    File IDs

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

    the optional parameters

Returns:



748
749
750
751
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 748

def r_tr_get_scripts(ids, opts = {})
  data, _status_code, _headers = r_tr_get_scripts_with_http_info(ids, opts)
  data
end

#r_tr_get_scripts_v2(ids, opts = {}) ⇒ EmpowerapiMsaPFResponseV2

Get custom-scripts based on the ID’s given. These are used for the RTR ‘runscript` command.

Parameters:

  • ids (Array<String>)

    File IDs

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

    the optional parameters

Returns:



810
811
812
813
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 810

def r_tr_get_scripts_v2(ids, opts = {})
  data, _status_code, _headers = r_tr_get_scripts_v2_with_http_info(ids, opts)
  data
end

#r_tr_get_scripts_v2_with_http_info(ids, opts = {}) ⇒ Array<(EmpowerapiMsaPFResponseV2, Integer, Hash)>

Get custom-scripts based on the ID&#39;s given. These are used for the RTR &#x60;runscript&#x60; command.

Parameters:

  • ids (Array<String>)

    File IDs

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

    the optional parameters

Returns:

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

    EmpowerapiMsaPFResponseV2 data, response status code and response headers



819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 819

def r_tr_get_scripts_v2_with_http_info(ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RealTimeResponseAdminApi.r_tr_get_scripts_v2 ...'
  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 RealTimeResponseAdminApi.r_tr_get_scripts_v2"
  end
  # resource path
  local_var_path = '/real-time-response/entities/scripts/v2'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ids'] = @api_client.build_collection_param(ids, :multi)

  # 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] || 'EmpowerapiMsaPFResponseV2'

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

  new_options = opts.merge(
    :operation => :"RealTimeResponseAdminApi.r_tr_get_scripts_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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RealTimeResponseAdminApi#r_tr_get_scripts_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#r_tr_get_scripts_with_http_info(ids, opts = {}) ⇒ Array<(EmpowerapiMsaPFResponseV1, Integer, Hash)>

Get custom-scripts based on the ID&#39;s given. These are used for the RTR &#x60;runscript&#x60; command.

Parameters:

  • ids (Array<String>)

    File IDs

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

    the optional parameters

Returns:

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

    EmpowerapiMsaPFResponseV1 data, response status code and response headers



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
804
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 757

def r_tr_get_scripts_with_http_info(ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RealTimeResponseAdminApi.r_tr_get_scripts ...'
  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 RealTimeResponseAdminApi.r_tr_get_scripts"
  end
  # resource path
  local_var_path = '/real-time-response/entities/scripts/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ids'] = @api_client.build_collection_param(ids, :multi)

  # 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] || 'EmpowerapiMsaPFResponseV1'

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

  new_options = opts.merge(
    :operation => :"RealTimeResponseAdminApi.r_tr_get_scripts",
    :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: RealTimeResponseAdminApi#r_tr_get_scripts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#r_tr_list_falcon_scripts(opts = {}) ⇒ EmpowerapiMsaIDListResponse

Get a list of Falcon script IDs available to the user to run

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Optional filter criteria in the form of an FQL query. For more information about FQL queries, see our [FQL documentation in Falcon](falcon.crowdstrike.com/support/documentation/45/falcon-query-language-feature-guide).

  • :offset (Integer)

    Starting index of overall result set from which to return ids.

  • :limit (Integer)

    Number of ids to return.

  • :sort (String)

    Sort by spec. Ex: &#39;created_at|asc&#39;.

Returns:



875
876
877
878
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 875

def r_tr_list_falcon_scripts(opts = {})
  data, _status_code, _headers = r_tr_list_falcon_scripts_with_http_info(opts)
  data
end

#r_tr_list_falcon_scripts_with_http_info(opts = {}) ⇒ Array<(EmpowerapiMsaIDListResponse, Integer, Hash)>

Get a list of Falcon script IDs available to the user to run

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Optional filter criteria in the form of an FQL query. For more information about FQL queries, see our [FQL documentation in Falcon](falcon.crowdstrike.com/support/documentation/45/falcon-query-language-feature-guide).

  • :offset (Integer)

    Starting index of overall result set from which to return ids.

  • :limit (Integer)

    Number of ids to return.

  • :sort (String)

    Sort by spec. Ex: &#39;created_at|asc&#39;.

Returns:

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

    EmpowerapiMsaIDListResponse data, response status code and response headers



887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 887

def r_tr_list_falcon_scripts_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RealTimeResponseAdminApi.r_tr_list_falcon_scripts ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RealTimeResponseAdminApi.r_tr_list_falcon_scripts, must be smaller than or equal to 100.'
  end

  allowable_values = ["created_timestamp", "modified_timestamp", "name"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/real-time-response/queries/falcon-scripts/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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] || 'EmpowerapiMsaIDListResponse'

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

  new_options = opts.merge(
    :operation => :"RealTimeResponseAdminApi.r_tr_list_falcon_scripts",
    :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: RealTimeResponseAdminApi#r_tr_list_falcon_scripts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#r_tr_list_put_files(opts = {}) ⇒ BinservapiMsaPutFileResponse

Get a list of put-file ID’s that are available to the user for the ‘put` command.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Optional filter criteria in the form of an FQL query. For more information about FQL queries, see our [FQL documentation in Falcon](falcon.crowdstrike.com/support/documentation/45/falcon-query-language-feature-guide).

  • :offset (String)

    Starting index of overall result set from which to return ids.

  • :limit (Integer)

    Number of ids to return.

  • :sort (String)

    Sort by spec. Ex: &#39;created_at|asc&#39;.

Returns:



950
951
952
953
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 950

def r_tr_list_put_files(opts = {})
  data, _status_code, _headers = r_tr_list_put_files_with_http_info(opts)
  data
end

#r_tr_list_put_files_with_http_info(opts = {}) ⇒ Array<(BinservapiMsaPutFileResponse, Integer, Hash)>

Get a list of put-file ID&#39;s that are available to the user for the &#x60;put&#x60; command.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Optional filter criteria in the form of an FQL query. For more information about FQL queries, see our [FQL documentation in Falcon](falcon.crowdstrike.com/support/documentation/45/falcon-query-language-feature-guide).

  • :offset (String)

    Starting index of overall result set from which to return ids.

  • :limit (Integer)

    Number of ids to return.

  • :sort (String)

    Sort by spec. Ex: &#39;created_at|asc&#39;.

Returns:



962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 962

def r_tr_list_put_files_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RealTimeResponseAdminApi.r_tr_list_put_files ...'
  end
  # resource path
  local_var_path = '/real-time-response/queries/put-files/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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] || 'BinservapiMsaPutFileResponse'

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

  new_options = opts.merge(
    :operation => :"RealTimeResponseAdminApi.r_tr_list_put_files",
    :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: RealTimeResponseAdminApi#r_tr_list_put_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#r_tr_list_scripts(opts = {}) ⇒ BinservapiMsaPutFileResponse

Get a list of custom-script ID’s that are available to the user for the ‘runscript` command.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Optional filter criteria in the form of an FQL query. For more information about FQL queries, see our [FQL documentation in Falcon](falcon.crowdstrike.com/support/documentation/45/falcon-query-language-feature-guide).

  • :offset (String)

    Starting index of overall result set from which to return ids.

  • :limit (Integer)

    Number of ids to return.

  • :sort (String)

    Sort by spec. Ex: &#39;created_at|asc&#39;.

Returns:



1017
1018
1019
1020
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 1017

def r_tr_list_scripts(opts = {})
  data, _status_code, _headers = r_tr_list_scripts_with_http_info(opts)
  data
end

#r_tr_list_scripts_with_http_info(opts = {}) ⇒ Array<(BinservapiMsaPutFileResponse, Integer, Hash)>

Get a list of custom-script ID&#39;s that are available to the user for the &#x60;runscript&#x60; command.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Optional filter criteria in the form of an FQL query. For more information about FQL queries, see our [FQL documentation in Falcon](falcon.crowdstrike.com/support/documentation/45/falcon-query-language-feature-guide).

  • :offset (String)

    Starting index of overall result set from which to return ids.

  • :limit (Integer)

    Number of ids to return.

  • :sort (String)

    Sort by spec. Ex: &#39;created_at|asc&#39;.

Returns:



1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 1029

def r_tr_list_scripts_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RealTimeResponseAdminApi.r_tr_list_scripts ...'
  end
  # resource path
  local_var_path = '/real-time-response/queries/scripts/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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] || 'BinservapiMsaPutFileResponse'

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

  new_options = opts.merge(
    :operation => :"RealTimeResponseAdminApi.r_tr_list_scripts",
    :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: RealTimeResponseAdminApi#r_tr_list_scripts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#r_tr_update_scripts(id, opts = {}) ⇒ MsaReplyMetaOnly

Upload a new scripts to replace an existing one.

Parameters:

  • id (String)

    ID to update

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

    the optional parameters

Options Hash (opts):

  • :file (File)

    custom-script file to upload. These should be powershell scripts.

  • :description (String)

    File description

  • :name (String)

    File name (if different than actual file name)

  • :comments_for_audit_log (String)

    The audit log comment

  • :permission_type (String)

    Permission for the custom-script. Valid permission values: - &#x60;private&#x60;, usable by only the user who uploaded it - &#x60;group&#x60;, usable by all RTR Admins - &#x60;public&#x60;, usable by all active-responders and RTR admins (default to ‘none’)

  • :content (String)

    The script text that you want to use to upload

  • :platform (Array<String>)

    Platforms for the file. Currently supports: windows, mac, linux,

Returns:



1088
1089
1090
1091
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 1088

def r_tr_update_scripts(id, opts = {})
  data, _status_code, _headers = r_tr_update_scripts_with_http_info(id, opts)
  data
end

#r_tr_update_scripts_with_http_info(id, opts = {}) ⇒ Array<(MsaReplyMetaOnly, Integer, Hash)>

Upload a new scripts to replace an existing one.

Parameters:

  • id (String)

    ID to update

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

    the optional parameters

Options Hash (opts):

  • :file (File)

    custom-script file to upload. These should be powershell scripts.

  • :description (String)

    File description

  • :name (String)

    File name (if different than actual file name)

  • :comments_for_audit_log (String)

    The audit log comment

  • :permission_type (String)

    Permission for the custom-script. Valid permission values: - &#x60;private&#x60;, usable by only the user who uploaded it - &#x60;group&#x60;, usable by all RTR Admins - &#x60;public&#x60;, usable by all active-responders and RTR admins (default to ‘none’)

  • :content (String)

    The script text that you want to use to upload

  • :platform (Array<String>)

    Platforms for the file. Currently supports: windows, mac, linux,

Returns:

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

    MsaReplyMetaOnly data, response status code and response headers



1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
# File 'lib/crimson-falcon/api/real_time_response_admin_api.rb', line 1104

def r_tr_update_scripts_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RealTimeResponseAdminApi.r_tr_update_scripts ...'
  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 RealTimeResponseAdminApi.r_tr_update_scripts"
  end
  if @api_client.config.client_side_validation && !opts[:'name'].nil? && opts[:'name'].to_s.length > 32766
    fail ArgumentError, 'invalid value for "opts[:"name"]" when calling RealTimeResponseAdminApi.r_tr_update_scripts, the character length must be smaller than or equal to 32766.'
  end

  if @api_client.config.client_side_validation && !opts[:'comments_for_audit_log'].nil? && opts[:'comments_for_audit_log'].to_s.length > 4096
    fail ArgumentError, 'invalid value for "opts[:"comments_for_audit_log"]" when calling RealTimeResponseAdminApi.r_tr_update_scripts, the character length must be smaller than or equal to 4096.'
  end

  # resource path
  local_var_path = '/real-time-response/entities/scripts/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(['multipart/form-data'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['id'] = id
  form_params['file'] = opts[:'file'] if !opts[:'file'].nil?
  form_params['description'] = opts[:'description'] if !opts[:'description'].nil?
  form_params['name'] = opts[:'name'] if !opts[:'name'].nil?
  form_params['comments_for_audit_log'] = opts[:'comments_for_audit_log'] if !opts[:'comments_for_audit_log'].nil?
  form_params['permission_type'] = opts[:'permission_type'] if !opts[:'permission_type'].nil?
  form_params['content'] = opts[:'content'] if !opts[:'content'].nil?
  form_params['platform'] = @api_client.build_collection_param(opts[:'platform'], :csv) if !opts[:'platform'].nil?

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

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

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

  new_options = opts.merge(
    :operation => :"RealTimeResponseAdminApi.r_tr_update_scripts",
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RealTimeResponseAdminApi#r_tr_update_scripts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end