-
Notifications
You must be signed in to change notification settings - Fork 161
Expand file tree
/
Copy pathcustom_ioa.py
More file actions
914 lines (768 loc) · 37.5 KB
/
custom_ioa.py
File metadata and controls
914 lines (768 loc) · 37.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
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
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
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
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
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
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
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
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
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
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
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
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
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
"""Falcon Custom Indicators of Attack API Interface Class.
_______ __ _______ __ __ __
| _ .----.-----.--.--.--.--| | _ | |_.----|__| |--.-----.
|. 1___| _| _ | | | | _ | 1___| _| _| | <| -__|
|. |___|__| |_____|________|_____|____ |____|__| |__|__|__|_____|
|: 1 | |: 1 |
|::.. . | CROWDSTRIKE FALCON |::.. . | FalconPy
`-------' `-------'
OAuth2 API - Customer SDK
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org>
"""
from typing import Dict, Union
from ._util import force_default, process_service_request, handle_single_argument
from ._payload import ioa_custom_payload, generic_payload_list
from ._result import Result
from ._service_class import ServiceClass
from ._endpoint._custom_ioa import _custom_ioa_endpoints as Endpoints
class CustomIOA(ServiceClass):
"""The only requirement to instantiate an instance of this class is one of the following.
- a valid client_id and client_secret provided as keywords.
- a credential dictionary with client_id and client_secret containing valid API credentials
{
"client_id": "CLIENT_ID_HERE",
"client_secret": "CLIENT_SECRET_HERE"
}
- a previously-authenticated instance of the authentication service class (oauth2.py)
- a valid token provided by the authentication service class (OAuth2.token())
"""
@force_default(defaults=["parameters"], default_types=["dict"])
def get_patterns(self: object, *args, parameters: dict = None, **kwargs) -> Union[Dict[str, Union[int, dict]], Result]:
"""Get pattern severities by ID.
Keyword arguments:
ids -- Pattern IDs. String or list of strings.
parameters -- full parameters payload, not required if using `ids` keyword.
Arguments: When not specified, the first argument to this method is assumed to be 'ids'.
All others are ignored.
Returns: dict object containing API response.
HTTP Method: GET
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/custom-ioa/get-patterns
"""
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="get_patterns",
keywords=kwargs,
params=handle_single_argument(args, parameters, "ids")
)
@force_default(defaults=["parameters"], default_types=["dict"])
def get_platforms(self: object, *args, parameters: dict = None, **kwargs) -> Union[Dict[str, Union[int, dict]], Result]:
"""Get platforms by ID.
Keyword arguments:
ids -- Platform IDs. String or list of strings.
parameters -- full parameters payload, not required if using `ids` keyword.
Arguments: When not specified, the first argument to this method is assumed to be 'ids'.
All others are ignored.
Returns: dict object containing API response.
HTTP Method: GET
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/custom-ioa/get-platformsMixin0
"""
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="get_platformsMixin0",
keywords=kwargs,
params=handle_single_argument(args, parameters, "ids")
)
@force_default(defaults=["parameters"], default_types=["dict"])
def get_rule_groups(self: object, *args, parameters: dict = None, **kwargs) -> Union[Dict[str, Union[int, dict]], Result]:
"""Get rule groups by ID.
Keyword arguments:
ids -- Rule group IDs. String or list of strings.
parameters -- full parameters payload, not required if using `ids` keyword.
Arguments: When not specified, the first argument to this method is assumed to be 'ids'.
All others are ignored.
Returns: dict object containing API response.
HTTP Method: GET
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/custom-ioa/get-rule-groupsMixin0
"""
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="get_rule_groupsMixin0",
keywords=kwargs,
params=handle_single_argument(args, parameters, "ids")
)
@force_default(defaults=["body"], default_types=["dict"])
def create_rule_group(self: object,
body: dict = None,
cs_username: str = None, # pylint: disable=W0613 # deprecated
**kwargs
) -> Union[Dict[str, Union[int, dict]], Result]:
"""Create a rule group for a platform with a name and an optional description.
Returns the rule group.
Keyword arguments:
body -- Full body payload in JSON format. Not required if other keywords are provided.
comment -- Comment for the rule group. String.
description -- Rule group description. String.
name -- Name of the rule group. String.
platform -- Platform this rule group applies to. Allowed values: `windows`, `mac`, `linux`
This method only supports keywords for providing arguments.
Returns: dict object containing API response.
HTTP Method: POST
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/custom-ioa/create-rule-groupMixin0
"""
if not body:
body = ioa_custom_payload(passed_keywords=kwargs)
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="create_rule_groupMixin0",
body=body
)
@force_default(defaults=["parameters"], default_types=["dict"])
def delete_rule_groups(self: object,
*args,
cs_username: str = None, # pylint: disable=W0613 # cs_username is deprecated
parameters: dict = None,
**kwargs
) -> Union[Dict[str, Union[int, dict]], Result]:
"""Delete rule groups by ID.
Keyword arguments:
comment -- Explains why the rule group is being deleted. String.
ids -- Rule group IDs to be deleted. String or list of strings.
parameters -- full parameters payload, not required if using `ids` keyword.
Arguments: When not specified, the first argument to this method is assumed to be 'ids'.
All others are ignored.
Returns: dict object containing API response.
HTTP Method: DELETE
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/custom-ioa/delete-rule-groupsMixin0
"""
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="delete_rule_groupsMixin0",
keywords=kwargs,
params=handle_single_argument(args, parameters, "ids")
)
@force_default(defaults=["body"], default_types=["dict"])
def update_rule_group(self: object,
body: dict = None,
cs_username: str = None, # pylint: disable=W0613 # deprecated
**kwargs
) -> Union[Dict[str, Union[int, dict]], Result]:
"""Update a rule group.
The following properties can be modified: `name`, `description`, `enabled`.
Keyword arguments:
body -- Full body payload in JSON format. Not required if other keywords are provided.
{
"comment": "string",
"description": "string",
"enabled": true,
"id": "string",
"name": "string",
"rulegroup_version": 0
}
comment -- Comment for the rule group. String.
description -- Rule group description. String.
enabled -- Flag indicating if the group is enabled. Boolean.
id -- ID of the rule group. String.
name -- Name of the rule group. String.
rulegroup_version -- Rule group version to modify. Integer.
This method only supports keywords for providing arguments.
Returns: dict object containing API response.
HTTP Method: PATCH
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/custom-ioa/update-rule-groupMixin0
"""
if not body:
body = ioa_custom_payload(passed_keywords=kwargs)
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="update_rule_groupMixin0",
body=body
)
@force_default(defaults=["parameters"], default_types=["dict"])
def get_rule_types(self: object, *args, parameters: dict = None, **kwargs) -> Union[Dict[str, Union[int, dict]], Result]:
"""Get rule types by ID.
Keyword arguments:
ids -- Rule type IDs. String or list of strings.
parameters -- full parameters payload, not required if using `ids` keyword.
Arguments: When not specified, the first argument to this method is assumed to be 'ids'.
All others are ignored.
Returns: dict object containing API response.
HTTP Method: GET
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/custom-ioa/get-rule-types
"""
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="get_rule_types",
keywords=kwargs,
params=handle_single_argument(args, parameters, "ids")
)
@force_default(defaults=["body"], default_types=["dict"])
def get_rules_get(self: object, body: dict = None, **kwargs) -> Union[Dict[str, Union[int, dict]], Result]:
"""Get rules by ID and optionally version in the following format: ID[:version].
Keyword arguments:
body -- full body payload in JSON format, not required if using `ids` keyword is used.
ids -- Rule IDs to retrieve. String or list of strings.
Arguments: When not specified, the first argument to this method is assumed to be 'ids'.
All others are ignored.
Returns: dict object containing API response.
HTTP Method: POST
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/custom-ioa/get-rules-get
"""
if not body:
body = generic_payload_list(submitted_keywords=kwargs, payload_value="ids")
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="get_rules_get",
body=body
)
@force_default(defaults=["parameters"], default_types=["dict"])
def get_rules(self: object, *args, parameters: dict = None, **kwargs) -> Union[Dict[str, Union[int, dict]], Result]:
"""Get rules by ID and optionally version in the following format: ID[:version].
The max number of IDs is constrained by URL size.
Keyword arguments:
ids -- Rule IDs. String or list of strings.
parameters -- full parameters payload, not required if using `ids` keyword.
Arguments: When not specified, the first argument to this method is assumed to be 'ids'.
All others are ignored.
Returns: dict object containing API response.
HTTP Method: GET
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/custom-ioa/get-rulesMixin0
"""
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="get_rulesMixin0",
keywords=kwargs,
params=handle_single_argument(args, parameters, "ids")
)
@force_default(defaults=["body"], default_types=["dict"])
def create_rule(self: object,
body: dict = None,
cs_username: str = None, # pylint: disable=W0613 # deprecated
**kwargs
) -> Union[Dict[str, Union[int, dict]], Result]:
"""Create a rule within a rule group. Returns the rule.
Keyword arguments:
body -- full body payload in JSON format, not required if using other keywords.
{
"comment": "string",
"description": "string",
"disposition_id": 0,
"field_values": [
{
"final_value": "string",
"label": "string",
"name": "string",
"type": "string",
"value": "string",
"values": [
{
"label": "string",
"value": "string"
}
]
}
],
"name": "string",
"pattern_severity": "string",
"rulegroup_id": "string",
"ruletype_id": "string"
}
comment -- Comment related to this update. String.
description -- Rule description. String.
disposition_id -- Disposition ID. Integer.
field_values -- Rule values represented as an object. Dictionary.
{
"final_value": "string",
"label": "string",
"name": "string",
"type": "string",
"value": "string",
"values": [
{
"label": "string",
"value": "string"
}
]
}
name -- Name of the rule. String.
pattern_severity -- Severity. String.
rulegroup_id -- ID of the rule group. String.
ruletype_id -- ID of the rule type. String.
This method only supports keywords for providing arguments.
Returns: dict object containing API response.
HTTP Method: POST
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/custom-ioa/create-rule
"""
if not body:
body = ioa_custom_payload(passed_keywords=kwargs)
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="create_rule",
body=body
)
@force_default(defaults=["parameters"], default_types=["dict"])
def delete_rules(self: object,
cs_username: str = None, # pylint: disable=W0613 # deprecated
parameters: dict = None,
**kwargs
) -> Union[Dict[str, Union[int, dict]], Result]:
"""Delete rules from a rule group by ID.
Keyword arguments:
comment -- Explains why the entity is being deleted. String.
ids -- Rule IDs to be deleted. String or list of strings.
parameters -- full parameters payload, not required if using `ids` keyword.
rule_group_id -- The parent rule group. String.
This method only supports keywords for providing arguments.
Returns: dict object containing API response.
HTTP Method: DELETE
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/custom-ioa/delete-rules
"""
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="delete_rules",
keywords=kwargs,
params=parameters
)
@force_default(defaults=["body"], default_types=["dict"])
def update_rules(self: object,
body: dict = None,
cs_username: str = None, # pylint: disable=W0613 # deprecated
**kwargs
) -> Union[Dict[str, Union[int, dict]], Result]:
"""Update rules within a rule group. Return the updated rules.
Keyword arguments:
body -- full body payload in JSON format, not required if using other keywords.
{
"comment": "string",
"rule_updates": [
{
"description": "string",
"disposition_id": 0,
"enabled": true,
"field_values": [
{
"final_value": "string",
"label": "string",
"name": "string",
"type": "string",
"value": "string",
"values": [
{
"label": "string",
"value": "string"
}
]
}
],
"instance_id": "string",
"name": "string",
"pattern_severity": "string",
"rulegroup_version": 0
}
],
"rulegroup_id": "string",
"rulegroup_version": 0
}
comment -- Comment related to this update. String.
rulegroup_id -- ID of the rule group. String.
rule_updates -- JSON dictionary representing the rule updates to
be performed. Only one rule update can be done
in this manner. Dictionary.
{
"description": "string",
"disposition_id": 0,
"enabled": true,
"field_values": [
{
"final_value": "string",
"label": "string",
"name": "string",
"type": "string",
"value": "string",
"values": [
{
"label": "string",
"value": "string"
}
]
}
],
"instance_id": "string",
"name": "string",
"pattern_severity": "string",
"rulegroup_version": 0
}
rulegroup_version -- Version of the rule group. Integer.
This method only supports keywords for providing arguments.
Returns: dict object containing API response.
HTTP Method: PATCH
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/custom-ioa/update-rules
"""
if not body:
body = ioa_custom_payload(passed_keywords=kwargs)
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="update_rules",
body=body
)
@force_default(defaults=["body"], default_types=["dict"])
def update_rules_v2(self: object,
body: dict = None,
**kwargs
) -> Union[Dict[str, Union[int, dict]], Result]:
"""Update rules within a rule group. Return the updated rules.
Keyword arguments:
body -- full body payload in JSON format, not required if using other keywords.
{
"comment": "string",
"rule_updates": [
{
"description": "string",
"disposition_id": 0,
"enabled": true,
"field_values": [
{
"final_value": "string",
"label": "string",
"name": "string",
"type": "string",
"value": "string",
"values": [
{
"label": "string",
"value": "string"
}
]
}
],
"instance_id": "string",
"name": "string",
"pattern_severity": "string",
"rulegroup_version": 0
}
],
"rulegroup_id": "string",
"rulegroup_version": 0
}
comment -- Comment related to this update. String.
rulegroup_id -- ID of the rule group. String.
rule_updates -- JSON dictionary representing the rule updates to
be performed. Only one rule update can be done
in this manner. Dictionary.
{
"description": "string",
"disposition_id": 0,
"enabled": true,
"field_values": [
{
"final_value": "string",
"label": "string",
"name": "string",
"type": "string",
"value": "string",
"values": [
{
"label": "string",
"value": "string"
}
]
}
],
"instance_id": "string",
"name": "string",
"pattern_severity": "string",
"rulegroup_version": 0
}
rulegroup_version -- Version of the rule group. Integer.
This method only supports keywords for providing arguments.
Returns: dict object containing API response.
HTTP Method: PATCH
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/custom-ioa/update-rules-v2
"""
if not body:
body = ioa_custom_payload(passed_keywords=kwargs)
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="update_rules_v2",
body=body
)
@force_default(defaults=["body"], default_types=["dict"])
def validate(self: object, body: dict = None, **kwargs) -> Union[Dict[str, Union[int, dict]], Result]:
"""Validate field values and check for matches if a test string is provided.
Keyword arguments:
body -- full body payload in JSON format, not required if using other keywords.
{
"fields": [
{
"name": "string",
"test_data": "string",
"type": "string",
"values": [
{
"label": "string",
"value": "string"
}
]
}
]
}
fields -- List of fields to validate. List of dictionaries.
{
"name": "string",
"test_data": "string",
"type": "string",
"values": [
{
"label": "string",
"value": "string"
}
]
}
Arguments: When not specified, the first argument to this method is assumed to be 'fields'.
All others are ignored.
Returns: dict object containing API response.
HTTP Method: POST
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/custom-ioa/validate
"""
if not body:
body = generic_payload_list(submitted_keywords=kwargs, payload_value="fields")
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="validate",
body=body
)
@force_default(defaults=["parameters"], default_types=["dict"])
def query_patterns(self: object, parameters: dict = None, **kwargs) -> Union[Dict[str, Union[int, dict]], Result]:
"""Get all pattern severity IDs.
Keyword arguments:
limit -- The maximum number of records to return in this response. [Integer, 1-500]
Use with the offset parameter to manage pagination of results.
offset -- The offset to start retrieving records from. String.
Use with the limit parameter to manage pagination of results.
parameters -- full parameters payload, not required if using other keywords.
This method only supports keywords for providing arguments.
Returns: dict object containing API response.
HTTP Method: GET
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/custom-ioa/query-patterns
"""
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="query_patterns",
keywords=kwargs,
params=parameters
)
@force_default(defaults=["parameters"], default_types=["dict"])
def query_platforms(self: object, parameters: dict = None, **kwargs) -> Union[Dict[str, Union[int, dict]], Result]:
"""Get all platform IDs.
Keyword arguments:
limit -- The maximum number of records to return in this response. [Integer, 1-500]
Use with the offset parameter to manage pagination of results.
offset -- The offset to start retrieving records from. String.
Use with the limit parameter to manage pagination of results.
parameters -- full parameters payload, not required if using other keywords.
This method only supports keywords for providing arguments.
Returns: dict object containing API response.
HTTP Method: GET
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/custom-ioa/query-platformsMixin0
"""
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="query_platformsMixin0",
keywords=kwargs,
params=parameters
)
@force_default(defaults=["parameters"], default_types=["dict"])
def query_rule_groups_full(self: object, parameters: dict = None, **kwargs) -> Union[Dict[str, Union[int, dict]], Result]:
"""Find all rule groups matching the query with optional filter.
Keyword arguments:
filter -- FQL query specifying the filter parameters. String.
Filter term criteria:
enabled rules.name
platform rules.description
name rules.pattern_severity
description rules.ruletype_name
rules.action_label rules.enabled
Filter range criteria:
created_on
modified_on (use any common date format, e.g. '2010-05-15T14:55:21.892315096Z')
limit -- The maximum number of records to return in this response. [Integer, 1-500]
Use with the offset parameter to manage pagination of results.
offset -- The offset to start retrieving records from. String.
Use with the limit parameter to manage pagination of results.
parameters -- full parameters payload, not required if using other keywords.
q -- Match query criteria, which includes all the filter string fields. String.
sort -- FQL syntax specifying sort criteria. String.
Possible order by fields:
created_by enabled
created_on name
modified_by description
modified_on
This method only supports keywords for providing arguments.
Returns: dict object containing API response.
HTTP Method: GET
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/custom-ioa/query-rule-groups-full
"""
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="query_rule_groups_full",
keywords=kwargs,
params=parameters
)
@force_default(defaults=["parameters"], default_types=["dict"])
def query_rule_groups(self: object, parameters: dict = None, **kwargs) -> Union[Dict[str, Union[int, dict]], Result]:
"""Find all rule group IDs matching the query with optional filter.
Keyword arguments:
filter -- FQL query specifying the filter parameters. String.
Filter term criteria:
enabled rules.name
platform rules.description
name rules.pattern_severity
description rules.ruletype_name
rules.action_label rules.enabled
Filter range criteria:
created_on
modified_on (use any common date format, e.g. '2010-05-15T14:55:21.892315096Z')
limit -- The maximum number of records to return in this response. [Integer, 1-500]
Use with the offset parameter to manage pagination of results.
offset -- The offset to start retrieving records from. String.
Use with the limit parameter to manage pagination of results.
parameters -- full parameters payload, not required if using other keywords.
q -- Match query criteria, which includes all the filter string fields. String.
sort -- FQL syntax specifying sort criteria. String.
Possible order by fields:
created_by enabled
created_on name
modified_by description
modified_on
This method only supports keywords for providing arguments.
Returns: dict object containing API response.
HTTP Method: GET
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/custom-ioa/query-rule-groupsMixin0
"""
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="query_rule_groupsMixin0",
keywords=kwargs,
params=parameters
)
@force_default(defaults=["parameters"], default_types=["dict"])
def query_rule_types(self: object, parameters: dict = None, **kwargs) -> Union[Dict[str, Union[int, dict]], Result]:
"""Get all rule type IDs.
Keyword arguments:
limit -- The maximum number of records to return in this response. [Integer, 1-500]
Use with the offset parameter to manage pagination of results.
offset -- The offset to start retrieving records from. String.
Use with the limit parameter to manage pagination of results.
parameters -- full parameters payload, not required if using other keywords.
This method only supports keywords for providing arguments.
Returns: dict object containing API response.
HTTP Method: GET
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/custom-ioa/query-rule-types
"""
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="query_rule_types",
keywords=kwargs,
params=parameters
)
@force_default(defaults=["parameters"], default_types=["dict"])
def query_rules(self: object, parameters: dict = None, **kwargs) -> Union[Dict[str, Union[int, dict]], Result]:
"""Find all rule IDs matching the query with optional filter.
Keyword arguments:
filter -- FQL query specifying the filter parameters. String.
Filter term criteria:
enabled rules.name
platform rules.description
name rules.pattern_severity
description rules.ruletype_name
rules.action_label rules.enabled
Filter range criteria:
created_on
modified_on (use any common date format, e.g. '2010-05-15T14:55:21.892315096Z')
limit -- The maximum number of records to return in this response. [Integer, 1-500]
Use with the offset parameter to manage pagination of results.
offset -- The offset to start retrieving records from. String.
Use with the limit parameter to manage pagination of results.
parameters -- full parameters payload, not required if using other keywords.
q -- Match query criteria, which includes all the filter string fields. String.
sort -- FQL syntax specifying sort criteria. String.
Possible order by fields:
rules.ruletype_name rules.created_on
rules.enabled rules.current_version.description
rules.created_by rules.current_version.pattern_severity
rules.current_version.name rules.current_version.action_label
rules.current_version.modified_by rules.current_version.modified_on
This method only supports keywords for providing arguments.
Returns: dict object containing API response.
HTTP Method: GET
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/custom-ioa/query-rulesMixin0
"""
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="query_rulesMixin0",
keywords=kwargs,
params=parameters
)
# These method names align to the operation IDs in the API but
# do not conform to snake_case / PEP8 and are defined here for
# backwards compatibility / ease of use purposes
get_platformsMixin0 = get_platforms
get_rule_groupsMixin0 = get_rule_groups
create_rule_groupMixin0 = create_rule_group
delete_rule_groupMixin0 = delete_rule_groups # Typo fix
delete_rule_groupsMixin0 = delete_rule_groups
update_rule_groupMixin0 = update_rule_group
get_rulesMixin0 = get_rules
query_platformsMixin0 = query_platforms
query_rule_groupsMixin0 = query_rule_groups
query_rulesMixin0 = query_rules
# The legacy name for this class does not conform to PascalCase / PEP8
# It is defined here for backwards compatibility purposes only.
Custom_IOA = CustomIOA # pylint: disable=C0103