forked from demisto/content
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook-GmailTest.yml
1901 lines (1901 loc) · 41 KB
/
playbook-GmailTest.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
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
id: GmailTest
version: -1
name: GmailTest
starttaskid: "0"
tasks:
"0":
id: "0"
taskid: e1ee503f-b7d9-46ed-80e1-f702d36f53f9
type: start
task:
id: e1ee503f-b7d9-46ed-80e1-f702d36f53f9
version: -1
name: ""
iscommand: false
brand: ""
nexttasks:
'#none#':
- "1"
separatecontext: false
view: |-
{
"position": {
"x": 1350,
"y": 50
}
}
note: false
timertriggers: []
ignoreworker: false
"1":
id: "1"
taskid: 822ade12-3997-4484-8c64-ee02eb2db726
type: regular
task:
id: 822ade12-3997-4484-8c64-ee02eb2db726
version: -1
name: Start clean
scriptName: DeleteContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "8"
scriptarguments:
all:
simple: "yes"
key: {}
separatecontext: false
view: |-
{
"position": {
"x": 1350,
"y": 195
}
}
note: false
timertriggers: []
ignoreworker: false
"2":
id: "2"
taskid: 05f07878-00ed-4d87-8ca9-aad2d3a37e06
type: regular
task:
id: 05f07878-00ed-4d87-8ca9-aad2d3a37e06
version: -1
name: List all users
script: '|||gmail-list-users'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "3"
scriptarguments:
custom-field-mask: {}
customer: {}
domain: {}
event: {}
max-results: {}
projection: {}
query: {}
show-deleted: {}
sort-order: {}
token: {}
view-type-public-domain: {}
separatecontext: false
view: |-
{
"position": {
"x": 1565,
"y": 515
}
}
note: false
timertriggers: []
ignoreworker: false
"3":
id: "3"
taskid: 886267b2-a45f-4d46-819e-cbaf208cc06f
type: regular
task:
id: 886267b2-a45f-4d46-819e-cbaf208cc06f
version: -1
name: Get specific user
script: '|||gmail-get-user'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "52"
scriptarguments:
custom-field-mask: {}
projection: {}
user-id:
complex:
root: Account
filters:
- - operator: isEqualString
left:
value:
simple: Account.UserName
iscontext: true
right:
value:
simple: test
transformers:
- operator: getField
args:
field:
value:
simple: Email
- operator: getField
args:
field:
value:
simple: Address
view-type-public-domain: {}
separatecontext: false
view: |-
{
"position": {
"x": 1565,
"y": 690
}
}
note: false
timertriggers: []
ignoreworker: false
"5":
id: "5"
taskid: ab9e9100-9ca4-4fad-8c0a-47125c085630
type: regular
task:
id: ab9e9100-9ca4-4fad-8c0a-47125c085630
version: -1
name: Create new user
script: '|||gmail-create-user'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "21"
scriptarguments:
email:
simple: JohnS@demistodev.com
family-name:
simple: Smith
first-name:
simple: John
password:
simple: johnpass1!
separatecontext: false
view: |-
{
"position": {
"x": 1565,
"y": 865
}
}
note: false
timertriggers: []
ignoreworker: false
"6":
id: "6"
taskid: f7ff7dca-e883-4feb-875e-fe84ebcc746c
type: regular
task:
id: f7ff7dca-e883-4feb-875e-fe84ebcc746c
version: -1
name: Delete User
script: '|||gmail-delete-user'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "13"
- "26"
- "7"
scriptarguments:
user-id:
complex:
root: Account
filters:
- - operator: startWith
left:
value:
simple: Account.Email.Address
iscontext: true
right:
value:
simple: JohnS
transformers:
- operator: getField
args:
field:
value:
simple: Email
- operator: getField
args:
field:
value:
simple: Address
separatecontext: false
view: |-
{
"position": {
"x": 1565,
"y": 1390
}
}
note: false
timertriggers: []
ignoreworker: false
"7":
id: "7"
taskid: aa771e6f-a2ab-4616-8cdc-319ed14015c1
type: title
task:
id: aa771e6f-a2ab-4616-8cdc-319ed14015c1
version: -1
name: Gmail Commands
type: title
iscommand: false
brand: ""
nexttasks:
'#none#':
- "9"
- "16"
- "18"
separatecontext: false
view: |-
{
"position": {
"x": 705,
"y": 1755
}
}
note: false
timertriggers: []
ignoreworker: false
"8":
id: "8"
taskid: 5eb90ef1-d04f-4a6a-8c01-ac0c278a36bc
type: title
task:
id: 5eb90ef1-d04f-4a6a-8c01-ac0c278a36bc
version: -1
name: User Commands
type: title
iscommand: false
brand: ""
nexttasks:
'#none#':
- "52"
separatecontext: false
view: |-
{
"position": {
"x": 1565,
"y": 370
}
}
note: false
timertriggers: []
ignoreworker: false
"9":
id: "9"
taskid: 6b2882b7-52ed-4819-84b5-0ab3f2015cc5
type: regular
task:
id: 6b2882b7-52ed-4819-84b5-0ab3f2015cc5
version: -1
name: Search emails with attachments
script: '|||gmail-search'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "10"
- "14"
scriptarguments:
after: {}
before: {}
fields: {}
filename: {}
from: {}
has-attachments:
simple: "True"
in: {}
include-spam-trash: {}
label: {}
labels-ids: {}
max-results:
simple: "10"
page-token: {}
query: {}
subject: {}
to: {}
user-id:
simple: admin@demistodev.com
separatecontext: false
view: |-
{
"position": {
"x": 60,
"y": 1915
}
}
note: false
timertriggers: []
ignoreworker: false
"10":
id: "10"
taskid: 7c2e2d79-7996-4cbf-8051-8097a1d7ee4c
type: regular
task:
id: 7c2e2d79-7996-4cbf-8051-8097a1d7ee4c
version: -1
name: Get mail with attachment
script: '|||gmail-get-attachments'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "48"
scriptarguments:
message-id:
complex:
root: Gmail
filters:
- - operator: isNotEmpty
left:
value:
simple: Gmail.Attachments
iscontext: true
transformers:
- operator: GetFirstObject
- operator: getField
args:
field:
value:
simple: ID
user-id:
simple: admin@demistodev.com
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 2090
}
}
note: false
timertriggers: []
ignoreworker: false
"13":
id: "13"
taskid: 6a3e1704-1a53-4aae-8873-397e105cd332
type: regular
task:
id: 6a3e1704-1a53-4aae-8873-397e105cd332
version: -1
name: Get Tokens
script: '|||gmail-get-tokens-for-user'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "22"
scriptarguments:
user-id:
simple: admin@demistodev.com
separatecontext: false
view: |-
{
"position": {
"x": 1340,
"y": 1565
}
}
note: false
timertriggers: []
ignoreworker: false
"14":
id: "14"
taskid: 1d79bf9e-0a96-4524-8249-ae781f34f276
type: regular
task:
id: 1d79bf9e-0a96-4524-8249-ae781f34f276
version: -1
name: Get Email data
script: '|||gmail-get-mail'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "48"
scriptarguments:
format: {}
message-id:
complex:
root: Gmail
filters:
- - operator: isEqualString
left:
value:
simple: Gmail.Mailbox
iscontext: true
right:
value:
simple: admin@demistodev.com
transformers:
- operator: getField
args:
field:
value:
simple: ID
- operator: GetFirstObject
user-id:
simple: admin@demistodev.com
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 2090
}
}
note: false
timertriggers: []
ignoreworker: false
"16":
id: "16"
taskid: 14919bc2-8b22-4076-8247-8cc95d86a68c
type: regular
task:
id: 14919bc2-8b22-4076-8247-8cc95d86a68c
version: -1
name: Search all mailboxes
script: '|||gmail-search-all-mailboxes'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "17"
scriptarguments:
after:
simple: 2018/1/20
before:
simple: 2018/1/30
fields: {}
filename: {}
from: {}
has-attachments: {}
in: {}
include-spam-trash: {}
label: {}
labels-ids: {}
max-results:
simple: "2"
page-token: {}
query: {}
subject: {}
to: {}
separatecontext: false
view: |-
{
"position": {
"x": 920,
"y": 1915
}
}
note: false
timertriggers: []
ignoreworker: false
"17":
id: "17"
taskid: 37dcf8fc-834e-4300-8ad1-c693c2af6bbf
type: regular
task:
id: 37dcf8fc-834e-4300-8ad1-c693c2af6bbf
version: -1
name: Get Thread
script: '|||gmail-get-thread'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "48"
scriptarguments:
format: {}
thread-id:
complex:
root: Gmail
filters:
- - operator: isEqualString
left:
value:
simple: Gmail.Mailbox
iscontext: true
right:
value:
simple: admin@demistodev.com
transformers:
- operator: getField
args:
field:
value:
simple: ThreadId
- operator: uniq
user-id:
simple: admin@demistodev.com
separatecontext: false
view: |-
{
"position": {
"x": 920,
"y": 2090
}
}
note: false
timertriggers: []
ignoreworker: false
"18":
id: "18"
taskid: 743eccb9-2f2a-400d-8943-e287be3fb4c6
type: regular
task:
id: 743eccb9-2f2a-400d-8943-e287be3fb4c6
version: -1
name: Search in mailbox
script: '|||gmail-search'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "19"
scriptarguments:
after: {}
before: {}
fields: {}
filename: {}
from: {}
has-attachments: {}
in:
simple: INBOX
include-spam-trash: {}
labels-ids: {}
max-results:
simple: "1"
page-token: {}
query: {}
subject: {}
to: {}
user-id:
simple: shai@demistodev.com
separatecontext: false
view: |-
{
"position": {
"x": 1350,
"y": 1915
}
}
note: false
timertriggers: []
ignoreworker: false
"19":
id: "19"
taskid: 2545abea-1be3-461b-8b91-c086de184694
type: regular
task:
id: 2545abea-1be3-461b-8b91-c086de184694
version: -1
name: Move mail to other folder
script: '|||gmail-move-mail'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "20"
scriptarguments:
add-labels:
simple: CATEGORY_SOCIAL
message-id:
complex:
root: Gmail
filters:
- - operator: isEqualString
left:
value:
simple: Gmail.Mailbox
iscontext: true
right:
value:
simple: shai@demistodev.com
transformers:
- operator: getField
args:
field:
value:
simple: ID
remove-labels:
simple: INBOX
user-id:
simple: shai@demistodev.com
separatecontext: false
view: |-
{
"position": {
"x": 1350,
"y": 2090
}
}
note: false
timertriggers: []
ignoreworker: false
"20":
id: "20"
taskid: e5b64f22-0864-4ad5-8964-7cc803148b19
type: regular
task:
id: e5b64f22-0864-4ad5-8964-7cc803148b19
version: -1
name: Move back to inbox
script: '|||gmail-move-mail'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "48"
scriptarguments:
add-labels:
simple: INBOX
message-id:
complex:
root: Gmail
filters:
- - operator: isEqualString
left:
value:
simple: Gmail.Mailbox
iscontext: true
right:
value:
simple: shai@demistodev.com
transformers:
- operator: getField
args:
field:
value:
simple: ID
remove-labels:
simple: CATEGORY_SOCIAL
user-id:
simple: shai@demistodev.com
separatecontext: false
view: |-
{
"position": {
"x": 1350,
"y": 2265
}
}
note: false
timertriggers: []
ignoreworker: false
"21":
id: "21"
taskid: 10bee013-4656-4618-8936-ffbcabc43c33
type: regular
task:
id: 10bee013-4656-4618-8936-ffbcabc43c33
version: -1
name: block the admin
script: '|||gmail-add-delete-filter'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "23"
scriptarguments:
email-address:
complex:
root: Account
filters:
- - operator: startWith
left:
value:
simple: Account.Email.Address
iscontext: true
right:
value:
simple: JohnS
transformers:
- operator: getField
args:
field:
value:
simple: Email
- operator: getField
args:
field:
value:
simple: Address
user-id:
simple: me
separatecontext: false
view: |-
{
"position": {
"x": 1565,
"y": 1040
}
}
note: false
timertriggers: []
ignoreworker: false
"22":
id: "22"
taskid: 47028b5a-6c2e-4f81-85c4-74f27d2ef700
type: title
task:
id: 47028b5a-6c2e-4f81-85c4-74f27d2ef700
version: -1
name: Check all mailboxes
type: title
iscommand: false
brand: ""
nexttasks:
'#none#':
- "16"
separatecontext: false
view: |-
{
"position": {
"x": 1340,
"y": 1755
}
}
note: false
timertriggers: []
ignoreworker: false
"23":
id: "23"
taskid: 9ff181da-f967-4b9d-883a-1ae04054727c
type: regular
task:
id: 9ff181da-f967-4b9d-883a-1ae04054727c
version: -1
name: Remove the block
script: '|||gmail-remove-filter'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "6"
scriptarguments:
filter_ids:
complex:
root: GmailFilter
filters:
- - operator: isEqualString
left:
value:
simple: GmailFilter.Mailbox
iscontext: true
right:
value:
simple: admin@demistodev.com
transformers:
- operator: getField
args:
field:
value:
simple: ID
mailbox:
complex:
root: Gmail
accessor: Filter.Mailbox
user-id:
simple: me
separatecontext: false
view: |-
{
"position": {
"x": 1565,
"y": 1215
}
}
note: false
timertriggers: []
ignoreworker: false
"25":
id: "25"
taskid: 98d0ff82-75d8-426c-8c03-df63de1fc02d
type: regular
task:
id: 98d0ff82-75d8-426c-8c03-df63de1fc02d
version: -1
name: List mailbox filters
script: '|||gmail-list-filters'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "27"
scriptarguments:
address: {}
limit:
simple: "5"
user-id:
simple: test@demistodev.com
separatecontext: false
view: |-
{
"position": {
"x": 1780,
"y": 1740
}
}
note: false
timertriggers: []
ignoreworker: false
"26":
id: "26"
taskid: 9435d3a3-3728-4114-8439-b50ff6af37f3
type: regular
task:
id: 9435d3a3-3728-4114-8439-b50ff6af37f3
version: -1
name: Delete filters from context
description: Delete field from context
scriptName: DeleteContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "25"
scriptarguments:
all: {}
index: {}
key:
simple: GmailFilter
keysToKeep: {}
subplaybook: {}
separatecontext: false
view: |-
{
"position": {
"x": 1780,
"y": 1565
}
}
note: false
timertriggers: []
ignoreworker: false
"27":
id: "27"
taskid: 33cb1652-e69d-4d73-8e9e-16ebe35b9517
type: condition
task:
id: 33cb1652-e69d-4d73-8e9e-16ebe35b9517
version: -1
name: Verify Filters
type: condition
iscommand: false
brand: ""
nexttasks:
'#default#':
- "28"
"yes":
- "48"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: isExists
left:
value:
simple: GmailFilter
iscontext: true
view: |-
{
"position": {
"x": 1780,
"y": 1915
}
}
note: false
timertriggers: []
ignoreworker: false
"28":
id: "28"
taskid: edddb219-f5bf-4da0-893e-8579a7ae6f13
type: regular
task:
id: edddb219-f5bf-4da0-893e-8579a7ae6f13
version: -1
name: Print Error
description: Prints an error entry with a given message
scriptName: PrintErrorEntry
type: regular
iscommand: false
brand: ""
scriptarguments:
message:
simple: No filters were found in test@demistodev.com mailbox
separatecontext: false
view: |-
{
"position": {
"x": 1780,
"y": 2090
}
}
note: false
timertriggers: []
ignoreworker: false
"29":
id: "29"
taskid: 8d15f6eb-2890-475a-882d-1a74d47ff3ea
type: title
task:
id: 8d15f6eb-2890-475a-882d-1a74d47ff3ea
version: -1
name: Done
type: title
iscommand: false
brand: ""
separatecontext: false
view: |-
{
"position": {
"x": 850,
"y": 5720
}
}
note: false
timertriggers: []
ignoreworker: false
"30":
id: "30"
taskid: 5c5048ef-dcdc-4cb3-8694-69f5d4fe3e86
type: regular
task:
id: 5c5048ef-dcdc-4cb3-8694-69f5d4fe3e86
version: -1
name: gmail-create-user
description: Creates a user.
script: '|||gmail-create-user'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "31"
scriptarguments:
email:
simple: user_to_delete@demistodev.com
family-name:
simple: Second
first-name: