-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathplaybook-TestParseEmailFile-deprecated-script.yml
571 lines (571 loc) · 13.9 KB
/
playbook-TestParseEmailFile-deprecated-script.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
id: TestParseEmailFile-deprecated-script
version: -1
fromversion: 5.0.0
name: TestParseEmailFile-deprecated-script
starttaskid: "0"
tasks:
"0":
id: "0"
taskid: 903859f8-95b8-4702-8e7f-06940e7b8087
type: start
task:
id: 903859f8-95b8-4702-8e7f-06940e7b8087
version: -1
name: ""
iscommand: false
brand: ""
nexttasks:
'#none#':
- "1"
separatecontext: false
view: |-
{
"position": {
"x": 450,
"y": 50
}
}
note: false
timertriggers: []
"1":
id: "1"
taskid: 69dc8a79-43b0-4893-8fd3-dd7c365befd4
type: regular
task:
id: 69dc8a79-43b0-4893-8fd3-dd7c365befd4
version: -1
name: DeleteContext
description: Delete field from context
scriptName: DeleteContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "2"
scriptarguments:
all:
simple: "yes"
key: {}
separatecontext: false
view: |-
{
"position": {
"x": 450,
"y": 230
}
}
note: false
timertriggers: []
"2":
id: "2"
taskid: d3723f5a-a6db-4658-8b07-a5aa9a4f7bc9
type: regular
task:
id: d3723f5a-a6db-4658-8b07-a5aa9a4f7bc9
version: -1
name: http
description: Sends http request. Returns the response as json.
scriptName: http
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "3"
scriptarguments:
body: {}
filename:
simple: ParseEmailFiles_test_email.eml
headers: {}
insecure: {}
method:
simple: GET
password: {}
proxy: {}
saveAsFile:
simple: "yes"
unsecure: {}
url:
simple: https://raw.githubusercontent.com/demisto/content/master/TestData/ParseEmailFiles_test_email.eml
username: {}
separatecontext: false
view: |-
{
"position": {
"x": 450,
"y": 410
}
}
note: false
timertriggers: []
"3":
id: "3"
taskid: 2aef4635-5c2d-42fd-8e6c-c53e79b3789d
type: regular
task:
id: 2aef4635-5c2d-42fd-8e6c-c53e79b3789d
version: -1
name: ParseEmailFile
description: Parse an email from an eml or msg file and populate all relevant
context data to investigate the email. Also extracts inner attachments and
returns them to the war room. The incident labels themselves are preserved
and not modified - only the "Label/x" context items that originated from the
labels, and the best practice is to rely on these for the remainder of the
playbook. Requires pip and access to python repository to install "olefile"
package.
scriptName: ParseEmailFile
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "4"
- "8"
- "11"
- "13"
- "14"
scriptarguments:
entryid:
complex:
root: File
filters:
- - operator: isEqualString
left:
value:
simple: File.Name
iscontext: true
right:
value:
simple: ParseEmailFiles_test_email.eml
transformers:
- operator: getField
args:
field:
value:
simple: EntryID
results:
- AttachmentName
separatecontext: false
view: |-
{
"position": {
"x": 450,
"y": 590
}
}
note: false
timertriggers: []
"4":
id: "4"
taskid: 56073346-f603-4fef-814f-9e0722b785bf
type: regular
task:
id: 56073346-f603-4fef-814f-9e0722b785bf
version: -1
name: VerifyContext - To
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: ""
scriptarguments:
expectedValue:
simple: shachar@demisto.com, yaakovi@demisto.com
fields: {}
path:
simple: Label/Email
separatecontext: false
view: |-
{
"position": {
"x": 352,
"y": 769
}
}
note: false
timertriggers: []
"8":
id: "8"
taskid: b358b937-e009-4f9f-8d11-e06b9b1c5ce0
type: regular
task:
id: b358b937-e009-4f9f-8d11-e06b9b1c5ce0
version: -1
name: VerifyContext - Subject
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: ""
scriptarguments:
expectedValue:
simple: ParseEmail test email
fields: {}
path:
simple: Label/Email/subject
separatecontext: false
view: |-
{
"position": {
"x": -120,
"y": 769
}
}
note: false
timertriggers: []
"11":
id: "11"
taskid: 67bca680-ba86-4f82-86e7-0e9cfdd2a463
type: condition
task:
id: 67bca680-ba86-4f82-86e7-0e9cfdd2a463
version: -1
name: AreValuesEqual - verify pdf attachment
description: Check whether the values provided in arguments are equal. If either
of the arguments are missing, no is returned.
scriptName: AreValuesEqual
type: condition
iscommand: false
brand: ""
nexttasks:
"yes":
- "12"
scriptarguments:
left:
complex:
root: File
filters:
- - operator: isEqualString
left:
value:
simple: File.Extension
iscontext: true
right:
value:
simple: pdf
accessor: MD5
right:
simple: 9060c2d4f48745de19a5690d8e6cabe1
results:
- AreValuesEqual
separatecontext: false
view: |-
{
"position": {
"x": 1213,
"y": 769
}
}
note: false
timertriggers: []
"12":
id: "12"
taskid: 4a76c3ff-9054-44c5-85ce-2455d2055ec8
type: title
task:
id: 4a76c3ff-9054-44c5-85ce-2455d2055ec8
version: -1
name: Validate Non-Unicode parsing
type: title
iscommand: false
brand: ""
nexttasks:
'#none#':
- "15"
- "16"
separatecontext: false
view: |-
{
"position": {
"x": 400,
"y": 1107
}
}
note: false
timertriggers: []
"13":
id: "13"
taskid: dc24ae89-4d87-44c1-89b3-34453ab501c2
type: condition
task:
id: dc24ae89-4d87-44c1-89b3-34453ab501c2
version: -1
name: AreValuesEqual - verify docx attachment
description: Check whether the values provided in arguments are equal. If either
of the arguments are missing, no is returned.
scriptName: AreValuesEqual
type: condition
iscommand: false
brand: ""
nexttasks:
"yes":
- "12"
scriptarguments:
left:
complex:
root: File
filters:
- - operator: isEqualString
left:
value:
simple: File.Extension
iscontext: true
right:
value:
simple: docx
accessor: MD5
right:
simple: b842aa8664f41a2dd7fe0d47a9fd4724
results:
- AreValuesEqual
separatecontext: false
view: |-
{
"position": {
"x": 780,
"y": 769
}
}
note: false
timertriggers: []
"14":
id: "14"
taskid: e80ce90d-8d02-4894-845d-05994a3008c4
type: regular
task:
id: e80ce90d-8d02-4894-845d-05994a3008c4
version: -1
name: VerifyContext - From
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: ""
scriptarguments:
expectedValue:
simple: shachar@demisto.com
fields: {}
path:
simple: Label/Email/from
separatecontext: false
view: |-
{
"position": {
"x": -558,
"y": 769
}
}
note: false
timertriggers: []
"15":
id: "15"
taskid: dd0fb53b-faef-4710-8c8b-bbe5a7439c73
type: regular
task:
id: dd0fb53b-faef-4710-8c8b-bbe5a7439c73
version: -1
name: Non Unicode Subject
scriptName: http
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "18"
scriptarguments:
body: {}
filename:
simple: EmailWithNonAsciiSubject.eml
headers: {}
insecure: {}
method:
simple: GET
password: {}
proxy: {}
saveAsFile:
simple: "yes"
unsecure: {}
url:
simple: https://github.com/demisto/content/raw/master/TestData/EmailWithNonAsciiSubject.eml
username: {}
separatecontext: false
view: |-
{
"position": {
"x": 400,
"y": 1280
}
}
note: false
timertriggers: []
"16":
id: "16"
taskid: 56ce604e-d2a4-402b-889f-71b154acb37e
type: regular
task:
id: 56ce604e-d2a4-402b-889f-71b154acb37e
version: -1
name: Non Unicode Attachment Name
scriptName: http
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "17"
scriptarguments:
body: {}
filename:
simple: EmailWithNonAsciiAttachmentName.eml
headers: {}
insecure: {}
method:
simple: GET
password: {}
proxy: {}
saveAsFile:
simple: "yes"
unsecure: {}
url:
simple: https://github.com/demisto/content/raw/master/TestData/EmailWithNonAsciiAttachmentName.eml
username: {}
separatecontext: false
view: |-
{
"position": {
"x": 880,
"y": 1280
}
}
note: false
timertriggers: []
"17":
id: "17"
taskid: dad3eb22-7ad1-4fb5-8239-268165b943ff
type: regular
task:
id: dad3eb22-7ad1-4fb5-8239-268165b943ff
version: -1
name: ParseEmailFiles
description: Parse an email from an eml or msg file and populate all relevant
context data to investigate the email. Also extracts inner attachments and
returns them to the war room. The incident labels themselves are preserved
and not modified - only the "Label/x" context items that originated from the
labels, and the best practice is to rely on these for the remainder of the
playbook. Requires pip and access to python repository to install "olefile"
package.
scriptName: ParseEmailFiles
type: regular
iscommand: false
brand: ""
scriptarguments:
entryid:
complex:
root: File
filters:
- - operator: isEqualString
left:
value:
simple: File.Name
iscontext: true
right:
value:
simple: EmailWithNonAsciiAttachmentName.eml
transformers:
- operator: getField
args:
field:
value:
simple: EntryID
results:
- AttachmentName
separatecontext: false
view: |-
{
"position": {
"x": 880,
"y": 1470
}
}
note: false
timertriggers: []
"18":
id: "18"
taskid: 68f6eb4b-98a8-49db-87c2-ec2d5e0cd7fc
type: regular
task:
id: 68f6eb4b-98a8-49db-87c2-ec2d5e0cd7fc
version: -1
name: ParseEmailFiles
description: Parse an email from an eml or msg file and populate all relevant
context data to investigate the email. Also extracts inner attachments and
returns them to the war room. The incident labels themselves are preserved
and not modified - only the "Label/x" context items that originated from the
labels, and the best practice is to rely on these for the remainder of the
playbook. Requires pip and access to python repository to install "olefile"
package.
scriptName: ParseEmailFiles
type: regular
iscommand: false
brand: ""
scriptarguments:
entryid:
complex:
root: File
filters:
- - operator: isEqualString
left:
value:
simple: File.Name
iscontext: true
right:
value:
simple: EmailWithNonAsciiSubject.eml
transformers:
- operator: getField
args:
field:
value:
simple: EntryID
results:
- AttachmentName
separatecontext: false
view: |-
{
"position": {
"x": 430,
"y": 1470
}
}
note: false
timertriggers: []
view: |-
{
"linkLabelsPosition": {},
"paper": {
"dimensions": {
"height": 1515,
"width": 2151,
"x": -558,
"y": 50
}
}
}
inputs: []
outputs: []