forked from demisto/content
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook-AWS-CloudWatchLogs_Test.yml
900 lines (900 loc) · 22.2 KB
/
playbook-AWS-CloudWatchLogs_Test.yml
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
id: 2cddaacb-4e4c-407e-8ef5-d924867b810c
version: 11
name: AWS - CloudWatchLogs Test Playbook_copy
starttaskid: "0"
tasks:
"0":
id: "0"
taskid: 5ed045bb-7326-46e4-86fd-836a6c494c1b
type: start
task:
id: 5ed045bb-7326-46e4-86fd-836a6c494c1b
version: -1
name: ""
iscommand: false
brand: ""
nexttasks:
'#none#':
- "24"
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 50
}
}
note: false
"8":
id: "8"
taskid: d24be249-1a30-4085-8c97-9ee708b9d0d8
type: regular
task:
id: d24be249-1a30-4085-8c97-9ee708b9d0d8
version: -1
name: VerifyContext
description: |-
Verifies path in context:
- Verifies path existence
- If matching object is an array: verify fields exists in each of the objects in the array
- If matching object is not an array: verify fields exists in matching object
- if 'expectedValue' is given: ensure that the given value is equal to the context path
scriptName: VerifyContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "33"
scriptarguments:
expectedValue: {}
fields: {}
path:
simple: AWS.CloudWatchLogs.LogGroups.LogGroupName
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 1070
}
}
note: false
"14":
id: "14"
taskid: fdefc79c-145a-49dc-88c7-62dc2599e0a0
type: regular
task:
id: fdefc79c-145a-49dc-88c7-62dc2599e0a0
version: -1
name: VerifyContext
description: |-
Verifies path in context:
- Verifies path existence
- If matching object is an array: verify fields exists in each of the objects in the array
- If matching object is not an array: verify fields exists in matching object
- if 'expectedValue' is given: ensure that the given value is equal to the context path
scriptName: VerifyContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "33"
scriptarguments:
expectedValue: {}
fields: {}
path:
simple: AWS.CloudWatchLogs.LogGroups.CreationTime
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 1070
}
}
note: false
"15":
id: "15"
taskid: 0484c7cc-a29b-4853-8e20-54f874c7faa4
type: regular
task:
id: 0484c7cc-a29b-4853-8e20-54f874c7faa4
version: -1
name: VerifyContext
description: |-
Verifies path in context:
- Verifies path existence
- If matching object is an array: verify fields exists in each of the objects in the array
- If matching object is not an array: verify fields exists in matching object
- if 'expectedValue' is given: ensure that the given value is equal to the context path
scriptName: VerifyContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "33"
scriptarguments:
expectedValue: {}
fields: {}
path:
simple: AWS.CloudWatchLogs.LogGroups.Arn
separatecontext: false
view: |-
{
"position": {
"x": 910,
"y": 1070
}
}
note: false
"24":
id: "24"
taskid: 2c968e3b-22ef-4789-8692-9e9ba779f98b
type: regular
task:
id: 2c968e3b-22ef-4789-8692-9e9ba779f98b
version: -1
name: DeleteContext
description: Delete field from context
scriptName: DeleteContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "45"
scriptarguments:
all:
simple: "yes"
index: {}
key: {}
keysToKeep: {}
subplaybook: {}
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 195
}
}
note: false
"25":
id: "25"
taskid: 303b78bc-2e29-4600-8618-f984f1d00a2d
type: title
task:
id: 303b78bc-2e29-4600-8618-f984f1d00a2d
version: -1
name: End of Playbook
type: title
iscommand: false
brand: ""
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 3170
}
}
note: false
"26":
id: "26"
taskid: 4323c00c-b648-4ecc-871c-1aaf9678742a
type: regular
task:
id: 4323c00c-b648-4ecc-871c-1aaf9678742a
version: -1
name: aws-logs-create-log-group
description: Creates a log group with the specified name.
script: AWS - CloudWatchLogs|||aws-logs-create-log-group
type: regular
iscommand: true
brand: AWS - CloudWatchLogs
nexttasks:
'#none#':
- "38"
scriptarguments:
kmsKeyId: {}
logGroupName:
simple: test
region:
simple: ${inputs.region}
roleArn: {}
roleSessionDuration: {}
roleSessionName: {}
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 545
}
}
note: false
"28":
id: "28"
taskid: b040aaed-ed82-4b2e-8393-892f979b140b
type: regular
task:
id: b040aaed-ed82-4b2e-8393-892f979b140b
version: -1
name: aws-logs-put-log-events
description: Uploads a batch of log events to the specified log stream. You
must include the sequence token obtained from the response of the previous
call. An upload in a newly created log stream does not require a sequence
token. You can also get the sequence token using DescribeLogStreams . If you
call PutLogEvents twice within a narrow time period using the same value for
sequenceToken , both calls may be successful, or one may be rejected.
script: AWS - CloudWatchLogs|||aws-logs-put-log-events
type: regular
iscommand: true
brand: AWS - CloudWatchLogs
nexttasks:
'#none#':
- "29"
scriptarguments:
logGroupName:
simple: test
logStreamName:
simple: test
message:
simple: testing test
region:
simple: ${inputs.region}
roleArn: {}
roleSessionDuration: {}
roleSessionName: {}
sequenceToken: {}
timestamp:
simple: ${timeTimeNowUnix}
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 1595
}
}
note: false
"29":
id: "29"
taskid: d31b327b-4a0a-45cc-89ea-51e823b46a34
type: regular
task:
id: d31b327b-4a0a-45cc-89ea-51e823b46a34
version: -1
name: aws-logs-put-metric-filter
description: Creates or updates a metric filter and associates it with the specified
log group. Metric filters allow you to configure rules to extract metric data
from log events ingested through PutLogEvents .
script: AWS - CloudWatchLogs|||aws-logs-put-metric-filter
type: regular
iscommand: true
brand: AWS - CloudWatchLogs
nexttasks:
'#none#':
- "31"
scriptarguments:
filterName:
simple: test
filterPattern:
simple: '"ERROR"'
logGroupName:
simple: test
metricName:
simple: test
metricNamespace:
simple: test
metricValue:
simple: "1"
region:
simple: ${inputs.region}
roleArn: {}
roleSessionDuration: {}
roleSessionName: {}
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 1770
}
}
note: false
"30":
id: "30"
taskid: 246492ad-d75e-490d-8e11-9f388d2ac875
type: regular
task:
id: 246492ad-d75e-490d-8e11-9f388d2ac875
version: -1
name: aws-logs-delete-metric-filter
description: Deletes the specified metric filter.
script: AWS - CloudWatchLogs|||aws-logs-delete-metric-filter
type: regular
iscommand: true
brand: AWS - CloudWatchLogs
nexttasks:
'#none#':
- "37"
scriptarguments:
filterName:
simple: test
logGroupName:
simple: test
region:
simple: ${inputs.region}
roleArn: {}
roleSessionDuration: {}
roleSessionName: {}
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 2645
}
}
note: false
"31":
id: "31"
taskid: d687cc47-11f9-4c68-8578-803dc5716ada
type: regular
task:
id: d687cc47-11f9-4c68-8578-803dc5716ada
version: -1
name: aws-logs-describe-metric-filters
description: Lists the specified metric filters. You can list all the metric
filters or filter the results by log name, prefix, metric name, or metric
namespace.
script: AWS - CloudWatchLogs|||aws-logs-describe-metric-filters
type: regular
iscommand: true
brand: AWS - CloudWatchLogs
nexttasks:
'#none#':
- "44"
- "43"
- "42"
scriptarguments:
filterNamePrefix: {}
logGroupName:
simple: test
metricName: {}
metricNamespace: {}
region:
simple: ${inputs.region}
roleArn: {}
roleSessionDuration: {}
roleSessionName: {}
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 1945
}
}
note: false
"32":
id: "32"
taskid: a9522c33-a656-4301-800c-cd6c8bd28355
type: regular
task:
id: a9522c33-a656-4301-800c-cd6c8bd28355
version: -1
name: aws-logs-describe-log-groups
description: Lists the specified log groups. You can list all your log groups
or filter the results by prefix. The results are ASCII-sorted by log group
name.
script: AWS - CloudWatchLogs|||aws-logs-describe-log-groups
type: regular
iscommand: true
brand: AWS - CloudWatchLogs
nexttasks:
'#none#':
- "14"
- "8"
- "15"
scriptarguments:
limit: {}
logGroupNamePrefix: {}
region:
simple: ${inputs.region}
roleArn: {}
roleSessionDuration: {}
roleSessionName: {}
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 895
}
}
note: false
"33":
id: "33"
taskid: 62f5a219-0f8c-440e-8603-68c9247e13e7
type: regular
task:
id: 62f5a219-0f8c-440e-8603-68c9247e13e7
version: -1
name: aws-logs-describe-log-streams
description: Lists the log streams for the specified log group. You can list
all the log streams or filter the results by prefix. You can also control
how the results are ordered.
script: AWS - CloudWatchLogs|||aws-logs-describe-log-streams
type: regular
iscommand: true
brand: AWS - CloudWatchLogs
nexttasks:
'#none#':
- "39"
- "40"
- "41"
scriptarguments:
limit: {}
logGroupName:
simple: test
logStreamNamePrefix: {}
orderBy: {}
region:
simple: ${inputs.region}
roleArn: {}
roleSessionDuration: {}
roleSessionName: {}
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 1245
}
}
note: false
"34":
id: "34"
taskid: 390dfc88-caed-4393-85a7-cf7000248506
type: regular
task:
id: 390dfc88-caed-4393-85a7-cf7000248506
version: -1
name: aws-logs-put-retention-policy
description: Sets the retention of the specified log group. A retention policy
allows you to configure the number of days for which to retain log events
in the specified log group.
script: AWS - CloudWatchLogs|||aws-logs-put-retention-policy
type: regular
iscommand: true
brand: AWS - CloudWatchLogs
nexttasks:
'#none#':
- "35"
scriptarguments:
logGroupName:
simple: test
region:
simple: ${inputs.region}
retentionInDays:
simple: "5"
roleArn: {}
roleSessionDuration: {}
roleSessionName: {}
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 2295
}
}
note: false
"35":
id: "35"
taskid: 0151095a-08d7-4eb1-802d-280bdf78741f
type: regular
task:
id: 0151095a-08d7-4eb1-802d-280bdf78741f
version: -1
name: aws-logs-delete-retention-policy
description: Deletes the specified retention policy. Log events do not expire
if they belong to log groups without a retention policy.
script: AWS - CloudWatchLogs|||aws-logs-delete-retention-policy
type: regular
iscommand: true
brand: AWS - CloudWatchLogs
nexttasks:
'#none#':
- "30"
scriptarguments:
logGroupName:
simple: test
region:
simple: ${inputs.region}
roleArn: {}
roleSessionDuration: {}
roleSessionName: {}
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 2470
}
}
note: false
"36":
id: "36"
taskid: b0ea5c19-3da0-4e9d-8417-e31bdbb35a7a
type: regular
task:
id: b0ea5c19-3da0-4e9d-8417-e31bdbb35a7a
version: -1
name: aws-logs-delete-log-group
description: Deletes the specified log group and permanently deletes all the
archived log events associated with the log group.
script: AWS - CloudWatchLogs|||aws-logs-delete-log-group
type: regular
iscommand: true
brand: AWS - CloudWatchLogs
nexttasks:
'#none#':
- "25"
scriptarguments:
logGroupName:
simple: test
region:
simple: ${inputs.region}
roleArn: {}
roleSessionDuration: {}
roleSessionName: {}
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 2995
}
}
note: false
"37":
id: "37"
taskid: fb5a1d2e-5abc-4866-8276-7d89f1c28da3
type: regular
task:
id: fb5a1d2e-5abc-4866-8276-7d89f1c28da3
version: -1
name: aws-logs-delete-log-stream
description: Deletes the specified log stream and permanently deletes all the
archived log events associated with the log stream.
script: AWS - CloudWatchLogs|||aws-logs-delete-log-stream
type: regular
iscommand: true
brand: AWS - CloudWatchLogs
nexttasks:
'#none#':
- "36"
scriptarguments:
logGroupName:
simple: test
logStreamName:
simple: test
region:
simple: ${inputs.region}
roleArn: {}
roleSessionDuration: {}
roleSessionName: {}
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 2820
}
}
note: false
"38":
id: "38"
taskid: 6e1905c5-84fd-486e-841f-d2dc76e7616d
type: regular
task:
id: 6e1905c5-84fd-486e-841f-d2dc76e7616d
version: -1
name: aws-logs-create-log-stream
description: Creates a log stream for the specified log group.
script: AWS - CloudWatchLogs|||aws-logs-create-log-stream
type: regular
iscommand: true
brand: AWS - CloudWatchLogs
nexttasks:
'#none#':
- "32"
scriptarguments:
logGroupName:
simple: test
logStreamName:
simple: test
region:
simple: ${inputs.region}
roleArn: {}
roleSessionDuration: {}
roleSessionName: {}
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 720
}
}
note: false
"39":
id: "39"
taskid: cb00ecfa-2604-4eae-83a0-7de886a98da1
type: regular
task:
id: cb00ecfa-2604-4eae-83a0-7de886a98da1
version: -1
name: VerifyContext
description: |-
Verifies path in context:
- Verifies path existence
- If matching object is an array: verify fields exists in each of the objects in the array
- If matching object is not an array: verify fields exists in matching object
- if 'expectedValue' is given: ensure that the given value is equal to the context path
scriptName: VerifyContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "28"
scriptarguments:
expectedValue: {}
fields: {}
path:
simple: AWS.CloudWatchLogs.LogGroups.LogStreams.CreationTime
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 1420
}
}
note: false
"40":
id: "40"
taskid: 1795122d-fe3c-4d21-8842-39aacb1cc736
type: regular
task:
id: 1795122d-fe3c-4d21-8842-39aacb1cc736
version: -1
name: VerifyContext
description: |-
Verifies path in context:
- Verifies path existence
- If matching object is an array: verify fields exists in each of the objects in the array
- If matching object is not an array: verify fields exists in matching object
- if 'expectedValue' is given: ensure that the given value is equal to the context path
scriptName: VerifyContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "28"
scriptarguments:
expectedValue: {}
fields: {}
path:
simple: AWS.CloudWatchLogs.LogGroups.LogStreams.LogStreamName
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 1420
}
}
note: false
"41":
id: "41"
taskid: 6f7f3ea6-a795-4b18-8378-243d120ff1fa
type: regular
task:
id: 6f7f3ea6-a795-4b18-8378-243d120ff1fa
version: -1
name: VerifyContext
description: |-
Verifies path in context:
- Verifies path existence
- If matching object is an array: verify fields exists in each of the objects in the array
- If matching object is not an array: verify fields exists in matching object
- if 'expectedValue' is given: ensure that the given value is equal to the context path
scriptName: VerifyContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "28"
scriptarguments:
expectedValue: {}
fields: {}
path:
simple: AWS.CloudWatchLogs.LogGroups.LogStreams.LogGroupName
separatecontext: false
view: |-
{
"position": {
"x": 910,
"y": 1420
}
}
note: false
"42":
id: "42"
taskid: f2b2bb53-fd44-46bb-8a91-dea4f8aa3a1d
type: regular
task:
id: f2b2bb53-fd44-46bb-8a91-dea4f8aa3a1d
version: -1
name: VerifyContext
description: |-
Verifies path in context:
- Verifies path existence
- If matching object is an array: verify fields exists in each of the objects in the array
- If matching object is not an array: verify fields exists in matching object
- if 'expectedValue' is given: ensure that the given value is equal to the context path
scriptName: VerifyContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "34"
scriptarguments:
expectedValue: {}
fields: {}
path:
simple: AWS.CloudWatchLogs.MetricFilters.creationTime
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 2120
}
}
note: false
"43":
id: "43"
taskid: 6ed06fe9-9022-4d61-8c07-797d086987b9
type: regular
task:
id: 6ed06fe9-9022-4d61-8c07-797d086987b9
version: -1
name: VerifyContext
description: |-
Verifies path in context:
- Verifies path existence
- If matching object is an array: verify fields exists in each of the objects in the array
- If matching object is not an array: verify fields exists in matching object
- if 'expectedValue' is given: ensure that the given value is equal to the context path
scriptName: VerifyContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "34"
scriptarguments:
expectedValue: {}
fields: {}
path:
simple: AWS.CloudWatchLogs.MetricFilters.filterPattern
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 2120
}
}
note: false
"44":
id: "44"
taskid: 621141a6-0d14-4353-8b48-de27c6c54652
type: regular
task:
id: 621141a6-0d14-4353-8b48-de27c6c54652
version: -1
name: VerifyContext
description: |-
Verifies path in context:
- Verifies path existence
- If matching object is an array: verify fields exists in each of the objects in the array
- If matching object is not an array: verify fields exists in matching object
- if 'expectedValue' is given: ensure that the given value is equal to the context path
scriptName: VerifyContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "34"
scriptarguments:
expectedValue: {}
fields: {}
path:
simple: AWS.CloudWatchLogs.MetricFilters.filterName
separatecontext: false
view: |-
{
"position": {
"x": 910,
"y": 2120
}
}
note: false
"45":
id: "45"
taskid: aef8f5ae-12ce-40fc-819d-494a6af86788
type: regular
task:
id: aef8f5ae-12ce-40fc-819d-494a6af86788
version: -1
name: GetTime
description: |
Retrieves the current date and time.
scriptName: GetTime
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "26"
scriptarguments:
contextKey:
simple: time
date: {}
dateFormat:
simple: UTC
hoursAgo: {}
minutesAgo: {}
monthsAgo: {}
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 370
}
}
note: false
view: |-
{
"linkLabelsPosition": {},
"paper": {
"dimensions": {
"height": 3185,
"width": 1240,
"x": 50,
"y": 50
}
}
}
inputs:
- key: region
value:
simple: eu-central-1
required: false
description: ""
outputs: []