-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathplaybook-TestParseEmailHeaders.yml
More file actions
411 lines (411 loc) · 9.46 KB
/
playbook-TestParseEmailHeaders.yml
File metadata and controls
411 lines (411 loc) · 9.46 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
id: TestParseEmailHeaders
version: -1
fromversion: 5.0.0
name: TestParseEmailHeaders
starttaskid: "0"
tasks:
"0":
id: "0"
taskid: bacbcb43-8045-4612-8c01-748580664a76
type: start
task:
id: bacbcb43-8045-4612-8c01-748580664a76
version: -1
name: ""
iscommand: false
brand: ""
nexttasks:
'#none#':
- "7"
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 50
}
}
note: false
timertriggers: []
ignoreworker: false
"1":
id: "1"
taskid: 72b466ef-e2ea-419f-8f22-48cdcf203279
type: regular
task:
id: 72b466ef-e2ea-419f-8f22-48cdcf203279
version: -1
name: Download EML file
scriptName: http
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "2"
scriptarguments:
body: {}
filename:
simple: EmailWithNonAsciiSubject.eml
headers: {}
insecure: {}
method:
simple: GET
password:
simple: '{ENCRYPTED}73CUHPcGaqWCBzx1eWdWPnTNZJtJ/1cx4/Bn+nC8OCydev0AcnyHOUv8MRHlhZNu+d2rsWGIBWI8vJV8hgjskA=='
proxy: {}
saveAsFile:
simple: "yes"
unsecure: {}
url:
simple: https://raw.githubusercontent.com/demisto/content/master/TestData/EmailWithNonAsciiSubject.eml
username: {}
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 370
}
}
note: false
timertriggers: []
ignoreworker: false
"2":
id: "2"
taskid: 10941233-eea6-4e27-8fca-71546d698650
type: regular
task:
id: 10941233-eea6-4e27-8fca-71546d698650
version: -1
name: ParseEmailHeaders
scriptName: ParseEmailHeaders
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "3"
scriptarguments:
entryId:
complex:
root: File
filters:
- - operator: isEqualString
left:
value:
simple: File.Extension
iscontext: true
right:
value:
simple: eml
accessor: EntryID
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 545
}
}
note: false
timertriggers: []
ignoreworker: false
"3":
id: "3"
taskid: 597063dd-bcf3-4d81-8f55-9d15484986f4
type: condition
task:
id: 597063dd-bcf3-4d81-8f55-9d15484986f4
version: -1
name: Validate Headers outputs
type: condition
iscommand: false
brand: ""
nexttasks:
"yes":
- "4"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: isEqualString
left:
value:
simple: Email.Headers.From
iscontext: true
right:
value:
simple: Shai Yaakovi <Yaakovi@demisto.com>
- - operator: isEqualString
left:
value:
simple: Email.Headers.Subject
iscontext: true
right:
value:
simple: cãcao is not taçóánd taco is not à çãcao
- - operator: containsString
left:
value:
complex:
root: Email.Headers.Received
transformers:
- operator: atIndex
args:
index:
value:
simple: "0"
iscontext: true
right:
value:
simple: DM6PR11MB2842.namprd11.prod.outlook.com
view: |-
{
"position": {
"x": 50,
"y": 720
}
}
note: false
timertriggers: []
ignoreworker: false
"4":
id: "4"
taskid: 6012b9c8-88fb-4bd3-836c-5ac7fb8118bd
type: regular
task:
id: 6012b9c8-88fb-4bd3-836c-5ac7fb8118bd
version: -1
name: Download MSG file
scriptName: http
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "5"
scriptarguments:
body: {}
filename:
simple: utf_subject.msg
headers: {}
insecure: {}
method:
simple: GET
password:
simple: '{ENCRYPTED}TjxAu8YVJac7qSpZfpgc4fDDavutkY4vYzTmyAwC1yRbXA+65KXrufr4Nt5++PjNMUywmua3oLOsqyRYKiFgWA=='
proxy: {}
saveAsFile:
simple: "yes"
unsecure: {}
url:
simple: https://github.com/demisto/content/raw/master/Packs/Legacy/Scripts/ParseEmailFiles/test_data/utf_subject.msg
username: {}
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 895
}
}
note: false
timertriggers: []
ignoreworker: false
"5":
id: "5"
taskid: 858f097b-e6a2-499b-863b-5c38427b4a4a
type: regular
task:
id: 858f097b-e6a2-499b-863b-5c38427b4a4a
version: -1
name: ParseEmailHeaders - last entry id
scriptName: ParseEmailHeaders
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "6"
scriptarguments:
entryId:
complex:
root: File
filters:
- - operator: isEqualString
left:
value:
simple: File.Extension
iscontext: true
right:
value:
simple: msg
accessor: EntryID
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 1070
}
}
note: false
timertriggers: []
ignoreworker: false
"6":
id: "6"
taskid: f315b72b-72f9-4d2e-8ec2-1572c85f2221
type: condition
task:
id: f315b72b-72f9-4d2e-8ec2-1572c85f2221
version: -1
name: Validate outputs
type: condition
iscommand: false
brand: ""
nexttasks:
"yes":
- "8"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: containsString
left:
value:
complex:
root: Email.Headers
filters:
- - operator: isEqualString
left:
value:
simple: Email.Headers.Message-ID
iscontext: true
right:
value:
simple: <5c530c1b.1c69fb81.bd826.0eff@mx.google.com>
accessor: Received
iscontext: true
right:
value:
simple: DM6PR11MB2810.namprd11.prod.outlook.com
- - operator: containsGeneral
left:
value:
complex:
root: Email.Headers
filters:
- - operator: isEqualString
left:
value:
simple: Email.Headers.Message-ID
iscontext: true
right:
value:
simple: <5c530c1b.1c69fb81.bd826.0eff@mx.google.com>
accessor: Subject
iscontext: true
right:
value:
simple: '[TESTING] =?utf-8?q?=F0=9F=94=92_=E2=9C=94_Votre_colis_est_disponible_chez_votre_co?=
=?utf-8?q?mmer=C3=A7ant_Pickup_!?='
- - operator: isEqualString
left:
value:
complex:
root: Email.Headers
filters:
- - operator: isEqualString
left:
value:
simple: Email.Headers.Message-ID
iscontext: true
right:
value:
simple: <5c530c1b.1c69fb81.bd826.0eff@mx.google.com>
accessor: X-MS-TrafficTypeDiagnostic
iscontext: true
right:
value:
simple: 'DM6PR11MB2810:'
view: |-
{
"position": {
"x": 50,
"y": 1245
}
}
note: false
timertriggers: []
ignoreworker: false
"7":
id: "7"
taskid: 6c0cb32a-5f91-4713-8400-23f85bb0b042
type: regular
task:
id: 6c0cb32a-5f91-4713-8400-23f85bb0b042
version: -1
name: DeleteContext
description: Delete field from context
scriptName: DeleteContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "1"
scriptarguments:
all:
simple: "yes"
index: {}
key: {}
keysToKeep: {}
subplaybook: {}
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 195
}
}
note: false
timertriggers: []
ignoreworker: false
"8":
id: "8"
taskid: 3b9d03bd-c002-4c70-8665-c6676d5c35f2
type: title
task:
id: 3b9d03bd-c002-4c70-8665-c6676d5c35f2
version: -1
name: Test Done - Success
type: title
iscommand: false
brand: ""
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 1420
}
}
note: false
timertriggers: []
ignoreworker: false
view: |-
{
"linkLabelsPosition": {},
"paper": {
"dimensions": {
"height": 1435,
"width": 380,
"x": 50,
"y": 50
}
}
}
inputs: []
outputs: []