-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsocket-triage-api-openapi.yml
More file actions
684 lines (668 loc) · 22.8 KB
/
socket-triage-api-openapi.yml
File metadata and controls
684 lines (668 loc) · 22.8 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
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
openapi: 3.0.0
info:
description: Socket triage API endpoints.
title: Socket Triage API
version: '0'
servers:
- url: https://api.socket.dev/v0
paths:
/orgs/{org_slug}/triage/alerts:
get:
tags:
- triage
summary: List Org Alert Triage
operationId: getOrgTriage
parameters:
- name: org_slug
in: path
required: true
description: The slug of the organization
schema:
type: string
- name: sort
in: query
required: false
description: 'Field to sort by. One of: created_at, updated_at.'
schema:
type: string
default: created_at
- name: direction
in: query
required: false
description: 'Sort direction. One of: asc, desc.'
schema:
type: string
default: desc
- name: per_page
in: query
required: false
description: Number of results per page (1–100, default 30).
schema:
type: integer
minimum: 1
maximum: 100
default: 30
- name: page
in: query
required: false
description: Page number (1-based).
schema:
type: integer
minimum: 1
default: 1
security:
- bearerAuth:
- triage:alerts-list
- basicAuth:
- triage:alerts-list
description: 'List triage actions for an organization. Results are paginated and can be sorted by created_at or updated_at.
This endpoint consumes 1 unit of your quota.
This endpoint requires the following org token scopes:
- triage:alerts-list'
responses:
'200':
content:
application/json:
schema:
type: object
additionalProperties: false
description: ''
properties:
results:
type: array
items:
type: object
additionalProperties: false
properties:
uuid:
type: string
description: The uuid of the triage action
default: ''
nullable: true
package_type:
type: string
description: The package type associated with the triage state
default: ''
nullable: true
package_namespace:
type: string
description: The package namespace associated with the triage state
default: ''
nullable: true
package_name:
type: string
description: The package name associated with the triage state
default: ''
nullable: true
package_version:
type: string
description: The package version associated with the triage state, it can contain a * suffix for wildcard matching
default: ''
nullable: true
alert_key:
type: string
description: The alert_key associated with the triage state
default: ''
nullable: true
alert_type:
type: string
description: The alert type (e.g., criticalCVE, highCVE) associated with the triage state
default: ''
nullable: true
fix_available:
type: string
enum:
- available
- unavailable
- '*'
description: Whether a fix must be available, unavailable, or * for any
default: '*'
nullable: true
patch_available:
type: string
enum:
- available
- unavailable
- '*'
description: Whether a patch must be available, unavailable, or * for any
default: '*'
nullable: true
cvss_score_cmp:
type: string
description: CVSS score comparison (e.g., >=7.5, >5.0, ==8.0)
default: ''
nullable: true
created_at:
type: string
description: The creation date of the triage action
default: ''
updated_at:
type: string
description: The last update date of the triage action
default: ''
note:
type: string
description: The note associated with the triage action
default: ''
organization_id:
type: string
description: The organization id associated with the triage action
default: ''
state:
type: string
enum:
- block
- ignore
- inherit
- monitor
- warn
description: The triage state of the alert
default: inherit
cve_or_ghsa_id:
type: string
description: CVE or GHSA ID associated with the triage state
default: ''
nullable: true
reachability:
type: string
enum:
- reachable
- unreachable
- other
- '*'
description: The reachability of the alert, can be reachable, unreachable, other, or * for any
default: '*'
nullable: true
kevs:
type: string
enum:
- exist
- none
- '*'
description: Whether the alert has a CISA KEV (Known Exploited Vulnerability), can be exist, none, or * for any
default: '*'
nullable: true
description: ''
description: ''
nextPage:
type: integer
description: ''
default: 0
nullable: true
required:
- nextPage
- results
description: Lists triage actions for the specified organization.
'400':
$ref: '#/components/responses/SocketBadRequest'
'401':
$ref: '#/components/responses/SocketUnauthorized'
'403':
$ref: '#/components/responses/SocketForbidden'
'404':
$ref: '#/components/responses/SocketNotFoundResponse'
'429':
$ref: '#/components/responses/SocketTooManyRequestsResponse'
x-readme: {}
post:
tags:
- triage
summary: Create/Update Org Alert Triage
operationId: updateOrgAlertTriage
parameters:
- name: org_slug
in: path
required: true
description: The slug of the organization
schema:
type: string
- name: force
in: query
required: false
description: Set to true to force broad triage updates, these are triages lacking a specific alertKey or granular artifact information which may have limited introspection to see what they apply
to.
schema:
type: string
default: 'false'
requestBody:
content:
application/json:
schema:
type: object
additionalProperties: false
description: ''
properties:
alertTriage:
type: array
items:
type: object
additionalProperties: false
properties:
uuid:
type: string
description: The UUID of the triage entry. Omit to create a new entry; provide to update an existing one.
default: ''
nullable: true
packageType:
type: string
description: The package ecosystem type (e.g., npm, pypi). Use null or "*" for wildcard.
default: ''
nullable: true
packageNamespace:
type: string
description: The package namespace or scope. Use null or "*" for wildcard.
default: ''
nullable: true
packageName:
type: string
description: The package name. Use null or "*" for wildcard.
default: ''
nullable: true
packageVersion:
type: string
description: The package version. Supports a "*" suffix for wildcard prefix matching. Use null for any version.
default: ''
nullable: true
alertKey:
type: string
description: The specific alert key to target.
default: ''
nullable: true
alertType:
type: string
description: The alert type (e.g., criticalCVE, highCVE).
default: ''
nullable: true
fixAvailable:
type: string
enum:
- available
- unavailable
- '*'
description: Whether a fix is available, unavailable, or * for any
patchAvailable:
type: string
enum:
- available
- unavailable
- '*'
description: Whether a patch is available, unavailable, or * for any
kevs:
type: string
enum:
- exist
- none
- '*'
description: Whether the alert has a CISA KEV, can be exist, none, or * for any
cveOrGhsaId:
type: string
description: CVE or GHSA ID to match against.
default: ''
nullable: true
reachability:
type: string
enum:
- reachable
- unreachable
- other
- '*'
description: The reachability of the alert, can be reachable, unreachable, other, or * for any
cvssScoreCmp:
type: string
description: CVSS score comparison operator and value (e.g., >=7.5, >5.0, ==8.0).
default: ''
nullable: true
note:
type: string
description: A note or comment for the triage action.
default: ''
state:
type: string
enum:
- block
- ignore
- inherit
- monitor
- warn
description: The triage state of the alert
description: ''
description: ''
required:
- alertTriage
required: false
security:
- bearerAuth:
- triage:alerts-update
- basicAuth:
- triage:alerts-update
description: 'Create or update triage actions on organization alerts. Accepts a batch of triage entries. Omit `uuid` to create a new entry; provide an existing `uuid` to update it. Use `?force=true`
for broad triages that lack a specific `alertKey` or granular package information.
This endpoint consumes 1 unit of your quota.
This endpoint requires the following org token scopes:
- triage:alerts-update'
responses:
'200':
content:
application/json:
schema:
type: object
additionalProperties: false
description: ''
properties:
result:
type: string
description: ''
default: ''
required:
- result
description: Updated Alert Triage
'400':
$ref: '#/components/responses/SocketBadRequest'
'401':
$ref: '#/components/responses/SocketUnauthorized'
'403':
$ref: '#/components/responses/SocketForbidden'
'404':
$ref: '#/components/responses/SocketNotFoundResponse'
'429':
$ref: '#/components/responses/SocketTooManyRequestsResponse'
x-readme: {}
/orgs/{org_slug}/triage/alerts/{uuid}:
delete:
tags:
- triage
summary: Delete Org Alert Triage
operationId: deleteOrgAlertTriage
parameters:
- name: org_slug
in: path
required: true
description: The slug of the organization
schema:
type: string
- name: uuid
in: path
required: true
description: The UUID of the alert triage entry to delete
schema:
type: string
security:
- bearerAuth:
- triage:alerts-update
- basicAuth:
- triage:alerts-update
description: 'Delete a specific triage rule by UUID.
This endpoint consumes 1 unit of your quota.
This endpoint requires the following org token scopes:
- triage:alerts-update'
responses:
'200':
content:
application/json:
schema:
type: object
additionalProperties: false
description: ''
properties:
result:
type: string
description: ''
default: ''
required:
- result
description: Deleted Alert Triage
'400':
$ref: '#/components/responses/SocketBadRequest'
'401':
$ref: '#/components/responses/SocketUnauthorized'
'403':
$ref: '#/components/responses/SocketForbidden'
'404':
$ref: '#/components/responses/SocketNotFoundResponse'
'429':
$ref: '#/components/responses/SocketTooManyRequestsResponse'
x-readme: {}
components:
requestBodies: {}
responses:
SocketBadRequest:
content:
application/json:
schema:
type: object
additionalProperties: false
description: ''
properties:
error:
type: object
additionalProperties: false
description: ''
properties:
message:
type: string
description: ''
default: ''
details:
type: object
description: ''
default: null
nullable: true
required:
- details
- message
required:
- error
description: Bad request
SocketUnauthorized:
content:
application/json:
schema:
type: object
additionalProperties: false
description: ''
properties:
error:
type: object
additionalProperties: false
description: ''
properties:
message:
type: string
description: ''
default: ''
details:
type: object
description: ''
default: null
nullable: true
required:
- details
- message
required:
- error
description: Unauthorized
SocketForbidden:
content:
application/json:
schema:
type: object
additionalProperties: false
description: ''
properties:
error:
type: object
additionalProperties: false
description: ''
properties:
message:
type: string
description: ''
default: ''
details:
type: object
description: ''
default: null
nullable: true
required:
- details
- message
required:
- error
description: Insufficient max_quota for API method
SocketNotFoundResponse:
content:
application/json:
schema:
type: object
additionalProperties: false
description: ''
properties:
error:
type: object
additionalProperties: false
description: ''
properties:
message:
type: string
description: ''
default: ''
details:
type: object
description: ''
default: null
nullable: true
required:
- details
- message
required:
- error
description: Resource not found
SocketTooManyRequestsResponse:
description: Insufficient quota for API route
headers:
Retry-After:
description: 'Retry contacting the endpoint *at least* after seconds.
See https://tools.ietf.org/html/rfc7231#section-7.1.3'
schema:
format: int32
type: integer
content:
application/json:
schema:
type: object
additionalProperties: false
description: ''
properties:
error:
type: object
additionalProperties: false
description: ''
properties:
message:
type: string
description: ''
default: ''
details:
type: object
description: ''
default: null
nullable: true
required:
- details
- message
required:
- error
SocketInternalServerError:
content:
application/json:
schema:
type: object
additionalProperties: false
description: ''
properties:
error:
type: object
additionalProperties: false
description: ''
properties:
message:
type: string
description: ''
default: ''
details:
type: object
description: ''
default: null
nullable: true
required:
- details
- message
required:
- error
description: Internal server error
SocketConflict:
content:
application/json:
schema:
type: object
additionalProperties: false
description: ''
properties:
error:
type: object
additionalProperties: false
description: ''
properties:
message:
type: string
description: ''
default: ''
details:
type: object
description: ''
default: null
nullable: true
required:
- details
- message
required:
- error
description: Resource already exists
SocketGone:
content:
application/json:
schema:
type: object
additionalProperties: false
description: ''
properties:
error:
type: object
additionalProperties: false
description: ''
properties:
message:
type: string
description: ''
default: ''
details:
type: object
description: ''
default: null
nullable: true
required:
- details
- message
required:
- error
description: Gone
schemas: {}
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: Organization Tokens can be passed as a Bearer token
basicAuth:
type: http
scheme: basic
description: Organization Tokens can be passed as the user field in basic auth