Class: Falcon::ItautomationTask

Inherits:
Object
  • Object
show all
Defined in:
lib/crimson-falcon/models/itautomation_task.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ItautomationTask

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 206

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::ItautomationTask` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Falcon::ItautomationTask`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'access_type')
    self.access_type = attributes[:'access_type']
  end

  if attributes.key?(:'assigned_user_group_ids')
    if (value = attributes[:'assigned_user_group_ids']).is_a?(Array)
      self.assigned_user_group_ids = value
    end
  end

  if attributes.key?(:'assigned_user_ids')
    if (value = attributes[:'assigned_user_ids']).is_a?(Array)
      self.assigned_user_ids = value
    end
  end

  if attributes.key?(:'composite_query')
    self.composite_query = attributes[:'composite_query']
  end

  if attributes.key?(:'created_by')
    self.created_by = attributes[:'created_by']
  end

  if attributes.key?(:'created_time')
    self.created_time = attributes[:'created_time']
  end

  if attributes.key?(:'description')
    self.description = attributes[:'description']
  end

  if attributes.key?(:'groups')
    if (value = attributes[:'groups']).is_a?(Array)
      self.groups = value
    end
  end

  if attributes.key?(:'has_task_parameters')
    self.has_task_parameters = attributes[:'has_task_parameters']
  end

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.key?(:'last_run_time')
    self.last_run_time = attributes[:'last_run_time']
  end

  if attributes.key?(:'modified_by')
    self.modified_by = attributes[:'modified_by']
  end

  if attributes.key?(:'modified_time')
    self.modified_time = attributes[:'modified_time']
  end

  if attributes.key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.key?(:'os_query')
    self.os_query = attributes[:'os_query']
  end

  if attributes.key?(:'output_parser_config')
    self.output_parser_config = attributes[:'output_parser_config']
  end

  if attributes.key?(:'queries')
    self.queries = attributes[:'queries']
  end

  if attributes.key?(:'remediations')
    self.remediations = attributes[:'remediations']
  end

  if attributes.key?(:'rows_parser_config')
    self.rows_parser_config = attributes[:'rows_parser_config']
  end

  if attributes.key?(:'runs')
    self.runs = attributes[:'runs']
  end

  if attributes.key?(:'supported_os')
    if (value = attributes[:'supported_os']).is_a?(Array)
      self.supported_os = value
    end
  end

  if attributes.key?(:'target')
    self.target = attributes[:'target']
  end

  if attributes.key?(:'task_parameters')
    if (value = attributes[:'task_parameters']).is_a?(Array)
      self.task_parameters = value
    end
  end

  if attributes.key?(:'task_type')
    self.task_type = attributes[:'task_type']
  end

  if attributes.key?(:'trigger_condition')
    if (value = attributes[:'trigger_condition']).is_a?(Array)
      self.trigger_condition = value
    end
  end

  if attributes.key?(:'verification_condition')
    if (value = attributes[:'verification_condition']).is_a?(Array)
      self.verification_condition = value
    end
  end
end

Instance Attribute Details

#access_typeObject

Access type of the task



35
36
37
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 35

def access_type
  @access_type
end

#assigned_user_group_idsObject

Assigned user group IDs of the task, when access_type is Shared.



38
39
40
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 38

def assigned_user_group_ids
  @assigned_user_group_ids
end

#assigned_user_idsObject

Assigned user IDs of the task, when access_type is Shared.



41
42
43
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 41

def assigned_user_ids
  @assigned_user_ids
end

#composite_queryObject

Returns the value of attribute composite_query.



43
44
45
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 43

def composite_query
  @composite_query
end

#created_byObject

Username/api client name of who created the task. Example: john.smith@crowdstrike.com



46
47
48
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 46

def created_by
  @created_by
end

#created_timeObject

Timestamp when task was created. Example: 2025-01-23T18:11:20.148439Z



49
50
51
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 49

def created_time
  @created_time
end

#descriptionObject

Detailed description of what the task does. Example: User Table Validation Check



52
53
54
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 52

def description
  @description
end

#groupsObject

Group memberships of the task



55
56
57
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 55

def groups
  @groups
end

#has_task_parametersObject

Indicates if the task has parameters. Example: true



58
59
60
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 58

def has_task_parameters
  @has_task_parameters
end

#idObject

Unique identifier for the task. Example: f64b95555ef54ea682619ce880d267cc



61
62
63
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 61

def id
  @id
end

#last_run_timeObject

Timestamp of last execution. Example: 2025-01-23T18:49:26.785778Z



64
65
66
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 64

def last_run_time
  @last_run_time
end

#modified_byObject

Username/api client name of who modified the task. Example: jane.doe@crowdstrike.com



67
68
69
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 67

def modified_by
  @modified_by
end

#modified_timeObject

Timestamp when task was last modified. Example: 2025-01-23T18:49:26.785778Z



70
71
72
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 70

def modified_time
  @modified_time
end

#nameObject

Name of the task. Example: OSQuery Check



73
74
75
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 73

def name
  @name
end

#os_queryObject

OSQuery to execute. Example: select * from users



76
77
78
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 76

def os_query
  @os_query
end

#output_parser_configObject

Returns the value of attribute output_parser_config.



78
79
80
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 78

def output_parser_config
  @output_parser_config
end

#queriesObject

Returns the value of attribute queries.



80
81
82
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 80

def queries
  @queries
end

#remediationsObject

Returns the value of attribute remediations.



82
83
84
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 82

def remediations
  @remediations
end

#rows_parser_configObject

Returns the value of attribute rows_parser_config.



84
85
86
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 84

def rows_parser_config
  @rows_parser_config
end

#runsObject

Number of times task has been executed. Example: 42



87
88
89
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 87

def runs
  @runs
end

#supported_osObject

List of supported operating systems. Example: [‘Windows’, ‘Linux’, ‘Mac’]



90
91
92
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 90

def supported_os
  @supported_os
end

#targetObject

Target filter in FQL format. Example: platform_name: ‘Windows’



93
94
95
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 93

def target
  @target
end

#task_parametersObject

Parameters definitions for the task



96
97
98
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 96

def task_parameters
  @task_parameters
end

#task_typeObject

Type of task. Example: query



99
100
101
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 99

def task_type
  @task_type
end

#trigger_conditionObject

Conditions that trigger remediation scripts



102
103
104
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 102

def trigger_condition
  @trigger_condition
end

#verification_conditionObject

Conditions that verify the outcome of the remediation scripts execution



105
106
107
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 105

def verification_condition
  @verification_condition
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



162
163
164
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 162

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



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
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 130

def self.attribute_map
  {
    :'access_type' => :'access_type',
    :'assigned_user_group_ids' => :'assigned_user_group_ids',
    :'assigned_user_ids' => :'assigned_user_ids',
    :'composite_query' => :'composite_query',
    :'created_by' => :'created_by',
    :'created_time' => :'created_time',
    :'description' => :'description',
    :'groups' => :'groups',
    :'has_task_parameters' => :'has_task_parameters',
    :'id' => :'id',
    :'last_run_time' => :'last_run_time',
    :'modified_by' => :'modified_by',
    :'modified_time' => :'modified_time',
    :'name' => :'name',
    :'os_query' => :'os_query',
    :'output_parser_config' => :'output_parser_config',
    :'queries' => :'queries',
    :'remediations' => :'remediations',
    :'rows_parser_config' => :'rows_parser_config',
    :'runs' => :'runs',
    :'supported_os' => :'supported_os',
    :'target' => :'target',
    :'task_parameters' => :'task_parameters',
    :'task_type' => :'task_type',
    :'trigger_condition' => :'trigger_condition',
    :'verification_condition' => :'verification_condition'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



476
477
478
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 476

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



199
200
201
202
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 199

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 167

def self.openapi_types
  {
    :'access_type' => :'String',
    :'assigned_user_group_ids' => :'Array<String>',
    :'assigned_user_ids' => :'Array<String>',
    :'composite_query' => :'ItautomationCompositeQuery',
    :'created_by' => :'String',
    :'created_time' => :'Time',
    :'description' => :'String',
    :'groups' => :'Array<FalconforitapiGroupMembership>',
    :'has_task_parameters' => :'Boolean',
    :'id' => :'String',
    :'last_run_time' => :'Time',
    :'modified_by' => :'String',
    :'modified_time' => :'Time',
    :'name' => :'String',
    :'os_query' => :'String',
    :'output_parser_config' => :'ItautomationOutputParserConfig',
    :'queries' => :'ItautomationScripts',
    :'remediations' => :'ItautomationScripts',
    :'rows_parser_config' => :'ItautomationRowsParserConfig',
    :'runs' => :'Integer',
    :'supported_os' => :'Array<String>',
    :'target' => :'String',
    :'task_parameters' => :'Array<ItautomationTaskParameter>',
    :'task_type' => :'String',
    :'trigger_condition' => :'Array<FalconforitapiConditionGroup>',
    :'verification_condition' => :'Array<FalconforitapiConditionGroup>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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/models/itautomation_task.rb', line 430

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      access_type == o.access_type &&
      assigned_user_group_ids == o.assigned_user_group_ids &&
      assigned_user_ids == o.assigned_user_ids &&
      composite_query == o.composite_query &&
      created_by == o.created_by &&
      created_time == o.created_time &&
      description == o.description &&
      groups == o.groups &&
      has_task_parameters == o.has_task_parameters &&
      id == o.id &&
      last_run_time == o.last_run_time &&
      modified_by == o.modified_by &&
      modified_time == o.modified_time &&
      name == o.name &&
      os_query == o.os_query &&
      output_parser_config == o.output_parser_config &&
      queries == o.queries &&
      remediations == o.remediations &&
      rows_parser_config == o.rows_parser_config &&
      runs == o.runs &&
      supported_os == o.supported_os &&
      target == o.target &&
      task_parameters == o.task_parameters &&
      task_type == o.task_type &&
      trigger_condition == o.trigger_condition &&
      verification_condition == o.verification_condition
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



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
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 507

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = Falcon.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



578
579
580
581
582
583
584
585
586
587
588
589
590
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 578

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 483

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


463
464
465
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 463

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



469
470
471
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 469

def hash
  [access_type, assigned_user_group_ids, assigned_user_ids, composite_query, created_by, created_time, description, groups, has_task_parameters, id, last_run_time, modified_by, modified_time, name, os_query, output_parser_config, queries, remediations, rows_parser_config, runs, supported_os, target, task_parameters, task_type, trigger_condition, verification_condition].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



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
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 340

def list_invalid_properties
  invalid_properties = Array.new
  if @created_by.nil?
    invalid_properties.push('invalid value for "created_by", created_by cannot be nil.')
  end

  if @created_time.nil?
    invalid_properties.push('invalid value for "created_time", created_time cannot be nil.')
  end

  if @description.nil?
    invalid_properties.push('invalid value for "description", description cannot be nil.')
  end

  if @groups.nil?
    invalid_properties.push('invalid value for "groups", groups cannot be nil.')
  end

  if @id.nil?
    invalid_properties.push('invalid value for "id", id cannot be nil.')
  end

  if @last_run_time.nil?
    invalid_properties.push('invalid value for "last_run_time", last_run_time cannot be nil.')
  end

  if @modified_by.nil?
    invalid_properties.push('invalid value for "modified_by", modified_by cannot be nil.')
  end

  if @modified_time.nil?
    invalid_properties.push('invalid value for "modified_time", modified_time cannot be nil.')
  end

  if @name.nil?
    invalid_properties.push('invalid value for "name", name cannot be nil.')
  end

  if @runs.nil?
    invalid_properties.push('invalid value for "runs", runs cannot be nil.')
  end

  if @supported_os.nil?
    invalid_properties.push('invalid value for "supported_os", supported_os cannot be nil.')
  end

  if @target.nil?
    invalid_properties.push('invalid value for "target", target cannot be nil.')
  end

  if @task_type.nil?
    invalid_properties.push('invalid value for "task_type", task_type cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



554
555
556
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 554

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



560
561
562
563
564
565
566
567
568
569
570
571
572
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 560

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



548
549
550
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 548

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# File 'lib/crimson-falcon/models/itautomation_task.rb', line 399

def valid?
  access_type_validator = EnumAttributeValidator.new('String', ["Public", "Shared"])
  return false unless access_type_validator.valid?(@access_type)
  return false if @created_by.nil?
  return false if @created_time.nil?
  return false if @description.nil?
  return false if @groups.nil?
  return false if @id.nil?
  return false if @last_run_time.nil?
  return false if @modified_by.nil?
  return false if @modified_time.nil?
  return false if @name.nil?
  return false if @runs.nil?
  return false if @supported_os.nil?
  return false if @target.nil?
  return false if @task_type.nil?
  true
end