Class: Falcon::ContainerDetections

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ContainerDetections



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

def api_client
  @api_client
end

Instance Method Details

#read_combined_detections(opts = {}) ⇒ DetectionsApiCombinedDetections

Maximum offset = 10000 - limit

Options Hash (opts):

  • :filter (String)

    Filter images detections using a query in Falcon Query Language (FQL). Supported filter fields: - `cid` - `detection_type` - `image_registry` - `image_repository` - `image_tag`

  • :sort (String)

    The fields to sort the records on. Supported columns: - `containers_impacted` - `detection_name` - `detection_severity` - `detection_type` - `images_impacted` - `last_detected`

  • :limit (Integer)

    The upper-bound on the number of records to retrieve. (default to 100)

  • :offset (Integer)

    The offset from where to begin.



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

def read_combined_detections(opts = {})
  data, _status_code, _headers = read_combined_detections_with_http_info(opts)
  data
end

#read_combined_detections_with_http_info(opts = {}) ⇒ Array<(DetectionsApiCombinedDetections, Integer, Hash)>

Maximum offset &#x3D; 10000 - limit

Options Hash (opts):

  • :filter (String)

    Filter images detections using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;cid&#x60; - &#x60;detection_type&#x60; - &#x60;image_registry&#x60; - &#x60;image_repository&#x60; - &#x60;image_tag&#x60;

  • :sort (String)

    The fields to sort the records on. Supported columns: - &#x60;containers_impacted&#x60; - &#x60;detection_name&#x60; - &#x60;detection_severity&#x60; - &#x60;detection_type&#x60; - &#x60;images_impacted&#x60; - &#x60;last_detected&#x60;

  • :limit (Integer)

    The upper-bound on the number of records to retrieve. (default to 100)

  • :offset (Integer)

    The offset from where to begin.



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

def read_combined_detections_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContainerDetections.read_combined_detections ...'
  end
  # resource path
  local_var_path = '/container-security/combined/detections/v1'

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

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

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

#read_detections(opts = {}) ⇒ DetectionsApiAssessmentDetections

Maximum offset = 10000 - limit

Options Hash (opts):

  • :filter (String)

    Filter images detections using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;cid&#x60; - &#x60;detection_type&#x60; - &#x60;image_registry&#x60; - &#x60;image_repository&#x60; - &#x60;image_tag&#x60;

  • :limit (Integer)

    The upper-bound on the number of records to retrieve. (default to 100)

  • :offset (Integer)

    The offset from where to begin.



112
113
114
115
# File 'lib/crimson-falcon/api/container_detections.rb', line 112

def read_detections(opts = {})
  data, _status_code, _headers = read_detections_with_http_info(opts)
  data
end

#read_detections_count(opts = {}) ⇒ DetectionsApiDetectionsCount

Aggregate count of detections

Options Hash (opts):

  • :filter (String)

    Filter images detections using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;cid&#x60; - &#x60;detection_type&#x60; - &#x60;image_registry&#x60; - &#x60;image_repository&#x60; - &#x60;image_tag&#x60;



174
175
176
177
# File 'lib/crimson-falcon/api/container_detections.rb', line 174

def read_detections_count(opts = {})
  data, _status_code, _headers = read_detections_count_with_http_info(opts)
  data
end

#read_detections_count_by_severity(opts = {}) ⇒ DetectionsApiDetectionsBySeverity

Aggregate counts of detections by severity

Options Hash (opts):

  • :filter (String)

    Filter images detections using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;cid&#x60; - &#x60;detection_type&#x60; - &#x60;image_registry&#x60; - &#x60;image_repository&#x60; - &#x60;image_tag&#x60;



232
233
234
235
# File 'lib/crimson-falcon/api/container_detections.rb', line 232

def read_detections_count_by_severity(opts = {})
  data, _status_code, _headers = read_detections_count_by_severity_with_http_info(opts)
  data
end

#read_detections_count_by_severity_with_http_info(opts = {}) ⇒ Array<(DetectionsApiDetectionsBySeverity, Integer, Hash)>

Aggregate counts of detections by severity

Options Hash (opts):

  • :filter (String)

    Filter images detections using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;cid&#x60; - &#x60;detection_type&#x60; - &#x60;image_registry&#x60; - &#x60;image_repository&#x60; - &#x60;image_tag&#x60;



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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/crimson-falcon/api/container_detections.rb', line 241

def read_detections_count_by_severity_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContainerDetections.read_detections_count_by_severity ...'
  end
  # resource path
  local_var_path = '/container-security/aggregates/detections/count-by-severity/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].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] || 'DetectionsApiDetectionsBySeverity'

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

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

#read_detections_count_by_type(opts = {}) ⇒ DetectionsApiDetectionsByType

Aggregate counts of detections by detection type

Options Hash (opts):

  • :filter (String)

    Filter images detections using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;cid&#x60; - &#x60;detection_type&#x60; - &#x60;image_registry&#x60; - &#x60;image_repository&#x60; - &#x60;image_tag&#x60;



290
291
292
293
# File 'lib/crimson-falcon/api/container_detections.rb', line 290

def read_detections_count_by_type(opts = {})
  data, _status_code, _headers = read_detections_count_by_type_with_http_info(opts)
  data
end

#read_detections_count_by_type_with_http_info(opts = {}) ⇒ Array<(DetectionsApiDetectionsByType, Integer, Hash)>

Aggregate counts of detections by detection type

Options Hash (opts):

  • :filter (String)

    Filter images detections using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;cid&#x60; - &#x60;detection_type&#x60; - &#x60;image_registry&#x60; - &#x60;image_repository&#x60; - &#x60;image_tag&#x60;



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

def read_detections_count_by_type_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContainerDetections.read_detections_count_by_type ...'
  end
  # resource path
  local_var_path = '/container-security/aggregates/detections/count-by-type/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].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] || 'DetectionsApiDetectionsByType'

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

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

#read_detections_count_with_http_info(opts = {}) ⇒ Array<(DetectionsApiDetectionsCount, Integer, Hash)>

Aggregate count of detections

Options Hash (opts):

  • :filter (String)

    Filter images detections using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;cid&#x60; - &#x60;detection_type&#x60; - &#x60;image_registry&#x60; - &#x60;image_repository&#x60; - &#x60;image_tag&#x60;



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

def read_detections_count_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContainerDetections.read_detections_count ...'
  end
  # resource path
  local_var_path = '/container-security/aggregates/detections/count/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].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] || 'DetectionsApiDetectionsCount'

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

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

#read_detections_with_http_info(opts = {}) ⇒ Array<(DetectionsApiAssessmentDetections, Integer, Hash)>

Maximum offset &#x3D; 10000 - limit

Options Hash (opts):

  • :filter (String)

    Filter images detections using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;cid&#x60; - &#x60;detection_type&#x60; - &#x60;image_registry&#x60; - &#x60;image_repository&#x60; - &#x60;image_tag&#x60;

  • :limit (Integer)

    The upper-bound on the number of records to retrieve. (default to 100)

  • :offset (Integer)

    The offset from where to begin.



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
165
166
167
168
# File 'lib/crimson-falcon/api/container_detections.rb', line 123

def read_detections_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContainerDetections.read_detections ...'
  end
  # resource path
  local_var_path = '/container-security/entities/detections/v1'

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

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

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

#search_detections(opts = {}) ⇒ CommonGenericEntityResponseString

Maximum offset = 10000 - limit

Options Hash (opts):

  • :filter (String)

    Filter images detections using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;cid&#x60; - &#x60;detection_type&#x60; - &#x60;image_registry&#x60; - &#x60;image_repository&#x60; - &#x60;image_tag&#x60;

  • :limit (Integer)

    The upper-bound on the number of records to retrieve. (default to 100)

  • :offset (Integer)

    The offset from where to begin.



350
351
352
353
# File 'lib/crimson-falcon/api/container_detections.rb', line 350

def search_detections(opts = {})
  data, _status_code, _headers = search_detections_with_http_info(opts)
  data
end

#search_detections_with_http_info(opts = {}) ⇒ Array<(CommonGenericEntityResponseString, Integer, Hash)>

Maximum offset &#x3D; 10000 - limit

Options Hash (opts):

  • :filter (String)

    Filter images detections using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;cid&#x60; - &#x60;detection_type&#x60; - &#x60;image_registry&#x60; - &#x60;image_repository&#x60; - &#x60;image_tag&#x60;

  • :limit (Integer)

    The upper-bound on the number of records to retrieve. (default to 100)

  • :offset (Integer)

    The offset from where to begin.



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
398
399
400
401
402
403
404
405
406
# File 'lib/crimson-falcon/api/container_detections.rb', line 361

def search_detections_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContainerDetections.search_detections ...'
  end
  # resource path
  local_var_path = '/container-security/queries/detections/v1'

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

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

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