-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathopenapi.yaml
More file actions
2047 lines (1970 loc) · 86.6 KB
/
Copy pathopenapi.yaml
File metadata and controls
2047 lines (1970 loc) · 86.6 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
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
openapi: 3.1.0
info:
title: Scrutineer Skill API
version: 0.4.0
description: |
A narrow HTTP surface that claude-code skills use while they run. The
goal is enough to let a skill orchestrate other skills and read prior
scan outputs without pushing that logic into scrutineer's Go code.
Every scrutineer skill scan is issued a bearer token that is staged into
the workspace context.json. Skills authenticate with that token. A token
is only valid while its originating scan is running, and only grants
access to the repository the scan was issued against.
The `/v1/*` paths are an unauthenticated, localhost-only export surface
intended for external scripts (jq, cron, CI dumps). They emit JSONL and
rely on the same host-header check as the browser UI; see threatmodel.md.
servers:
- url: http://127.0.0.1:8080/api
description: Local scrutineer server
security:
- bearerAuth: []
paths:
/openapi.yaml:
get:
summary: Fetch this OpenAPI document
description: |
Returns the embedded copy of `openapi.yaml`, so a skill or an external
tool can read the API surface from a running server without a checkout.
Two ways in. From localhost it is unauthenticated, because a caller
discovering the API has no running scan to take a bearer token from;
the host check is the boundary, as on the browser UI. A skill inside
the runner container cannot pass that check -- it reaches the server
through the egress proxy on the host endpoint `api_base` advertises,
which forwards the original `Host` -- so it authenticates with the
per-scan bearer token it already holds for the rest of this API.
See threatmodel.md.
operationId: getOpenAPISpec
security:
- {}
- bearerAuth: []
responses:
"200":
description: The OpenAPI document
content:
application/yaml:
schema:
type: string
"401":
description: |
Request came from a non-local host without a bearer token
belonging to a currently running scan
/claim-check:
servers:
- url: http://127.0.0.1:8080
description: Local scrutineer server root
post:
summary: Check whether this instance already holds a federated finding claim
description: |
Accepts a salted finding hash from a federation peer and returns whether
this instance already has a claimable matching finding. The request does
not reveal the finding; a match discloses only the configured operator
contact. Disabled instances, non-POST requests, and instances without a
federation salt answer 404 so federation support is not fingerprintable.
operationId: claimCheck
security: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [hash]
properties:
hash:
type: string
pattern: '^[0-9a-f]{64}$'
responses:
'200':
description: Claim-check result
content:
application/json:
schema:
type: object
required: [match]
properties:
match: { type: boolean }
contact:
type: string
description: Present only when match is true and federation contact is configured.
'400':
description: Invalid JSON body or hash value
'404':
description: Claim check disabled or unsupported method
'500':
description: Failed to load local findings
/repositories/{id}:
get:
summary: Fetch a repository summary
operationId: getRepository
parameters:
- $ref: '#/components/parameters/RepositoryID'
responses:
'200':
description: OK
content:
application/json:
schema: { $ref: '#/components/schemas/Repository' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
patch:
summary: Update skill-writable repository fields
description: |
Allows the authenticated scan to write repository fields that are
produced by skills rather than owned by metadata refreshes. Currently
only `fork` is accepted.
operationId: patchRepository
parameters:
- $ref: '#/components/parameters/RepositoryID'
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [fork]
properties:
fork:
type: string
description: Owner/name of the staging fork prepared for patch work.
responses:
'204':
description: Repository updated
'400':
description: Body is not valid JSON
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
'403': { $ref: '#/components/responses/Forbidden' }
'422':
description: No writable fields were supplied
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
'500':
description: Database update failed
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
/repositories/{id}/scans:
get:
summary: List scans for a repository
operationId: listRepositoryScans
parameters:
- $ref: '#/components/parameters/RepositoryID'
- name: status
in: query
schema:
type: string
enum: [queued, running, paused, done, failed, skipped, cancelled]
- name: skill
in: query
schema: { type: string }
description: Filter by skill name (matches Scan.skill_name).
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items: { $ref: '#/components/schemas/Scan' }
'403': { $ref: '#/components/responses/Forbidden' }
/repositories/{id}/maintainers:
get:
summary: List maintainers linked to this repository
operationId: listRepositoryMaintainers
parameters:
- $ref: '#/components/parameters/RepositoryID'
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items: { $ref: '#/components/schemas/Maintainer' }
'403': { $ref: '#/components/responses/Forbidden' }
/repositories/{id}/packages:
get:
summary: List published packages produced by this repository
operationId: listRepositoryPackages
parameters:
- $ref: '#/components/parameters/RepositoryID'
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items: { $ref: '#/components/schemas/Package' }
'403': { $ref: '#/components/responses/Forbidden' }
/repositories/{id}/alternatives:
get:
summary: List operator-curated package migration alternatives
operationId: listRepositoryAlternatives
parameters:
- $ref: '#/components/parameters/RepositoryID'
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items: { $ref: '#/components/schemas/PackageAlternative' }
'403': { $ref: '#/components/responses/Forbidden' }
/repositories/{id}/advisories:
get:
summary: List published advisories affecting this repository's packages
operationId: listRepositoryAdvisories
parameters:
- $ref: '#/components/parameters/RepositoryID'
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items: { $ref: '#/components/schemas/Advisory' }
'403': { $ref: '#/components/responses/Forbidden' }
/repositories/{id}/dependents:
get:
summary: List downstream dependents of this repository's packages
operationId: listRepositoryDependents
parameters:
- $ref: '#/components/parameters/RepositoryID'
- $ref: '#/components/parameters/RepositoryReadLimit'
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items: { $ref: '#/components/schemas/Dependent' }
'400': { $ref: '#/components/responses/BadRequest' }
'403': { $ref: '#/components/responses/Forbidden' }
/repositories/{id}/ecosystems/{source}/raw:
get:
summary: Verbatim cached ecosyste.ms payload for one source
description: >
Returns the raw upstream payload pre-fetched and cached server-side.
A 404 signals nothing is cached, in which case the caller falls
back to a direct WebFetch. When the operator sets
ecosystems_enrichment false, no source is ever cached, so every
request answers 404 and the fallback is the only path.
operationId: getRepositoryEcosystemsRaw
parameters:
- $ref: '#/components/parameters/RepositoryID'
- name: source
in: path
required: true
schema:
type: string
enum: [repo, packages, advisories, commits, issues, dependents]
responses:
'200':
description: Cached payload, returned verbatim
content:
application/json: {}
'400':
description: Unknown source
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
/repositories/{id}/expected:
get:
summary: List expected findings for benchmark comparison
operationId: listRepositoryExpectedFindings
parameters:
- $ref: '#/components/parameters/RepositoryID'
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items: { $ref: '#/components/schemas/ExpectedFinding' }
'403': { $ref: '#/components/responses/Forbidden' }
/repositories/{id}/dependencies:
get:
summary: List dependencies declared by this repository's manifests
operationId: listRepositoryDependencies
parameters:
- $ref: '#/components/parameters/RepositoryID'
- $ref: '#/components/parameters/RepositoryReadLimit'
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items: { $ref: '#/components/schemas/Dependency' }
'400': { $ref: '#/components/responses/BadRequest' }
'403': { $ref: '#/components/responses/Forbidden' }
/repositories/{id}/findings:
get:
summary: List findings across every scan on this repository
operationId: listRepositoryFindings
parameters:
- $ref: '#/components/parameters/RepositoryID'
- name: severity
in: query
schema: { type: string, enum: [Critical, High, Medium, Low] }
- name: status
in: query
schema:
type: string
enum: [new, enriched, triaged, ready, reported, acknowledged, fixed, published, rejected, duplicate]
- name: skill
in: query
description: Only return findings produced by scans of this skill (e.g. `semgrep`, `security-deep-dive`).
schema: { type: string }
- name: scan_group
in: query
description: Only return findings from scans in this parallel batch, so an in-flight audit skill reads only its siblings' findings.
schema: { type: string }
- name: sub_path
in: query
description: Only return findings for this monorepo sub-package (e.g. `activesupport`), so a repository can be exported or bundled one sub-package at a time.
schema: { type: string }
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items: { $ref: '#/components/schemas/FindingSummary' }
'403': { $ref: '#/components/responses/Forbidden' }
post:
summary: Stream one finding into the concurrent-finding log
description: >
Records a single finding emitted mid-scan so sibling scans in the same
`scan_group` can read it before this scan completes. The body is one
finding in the same shape it has in the skill's `report.json`; the
scan's identity (scan id, repository, commit, sub-path) is stamped from
the bearer token, never trusted from the body. The finding still
belongs in the final `report.json`, which reconciles against the
streamed row by fingerprint rather than duplicating it.
operationId: streamRepositoryFinding
parameters:
- $ref: '#/components/parameters/RepositoryID'
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/FindingInput' }
responses:
'201':
description: Created
content:
application/json:
schema: { $ref: '#/components/schemas/FindingSummary' }
'400': { $ref: '#/components/responses/BadRequest' }
'403': { $ref: '#/components/responses/Forbidden' }
/repositories/{id}/dependency-findings:
get:
summary: List findings on libraries this repository depends on
description: >
Joins this repository's Dependency rows against every Package row
scrutineer knows about and returns the live findings on the matched
library repositories. git-pkgs ecosystem names (gem, golang,
composer) are normalised to packages.ecosyste.ms names (rubygems,
go, packagist) before matching. Findings already marked fixed,
rejected or duplicate are excluded. Consumed by the reachability
skill.
operationId: listRepositoryDependencyFindings
parameters:
- $ref: '#/components/parameters/RepositoryID'
- name: severity
in: query
schema: { type: string, enum: [Critical, High, Medium, Low] }
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items: { $ref: '#/components/schemas/DependencyFinding' }
'403': { $ref: '#/components/responses/Forbidden' }
/repositories/{id}/skills/{name}/run:
post:
summary: Enqueue a skill scan against this repository
operationId: runSkill
parameters:
- $ref: '#/components/parameters/RepositoryID'
- name: name
in: path
required: true
schema: { type: string }
description: Skill name (matches the SKILL.md `name` field).
requestBody:
required: false
content:
application/json:
schema:
type: object
additionalProperties: false
properties:
model:
type: string
description: Override model; defaults to the system default.
ref:
type: string
description: Git ref to checkout; empty means the repository's default branch.
sub_path:
type: string
description: |
Scope this run to a monorepo sub-package (a relative sub-folder, e.g. `activesupport`).
The `triage` skill forwards it to every pipeline child so the whole scan set stays
scoped to the same sub-package. Empty means the whole repository. A `..` segment is rejected.
profile:
type: string
description: |
Runner profile name (e.g. `php`). Empty auto-detects from the clone via `brief`;
`default` forces the default runner image. Unknown names return 400, as do
overrides that conflict with the skill's `requires_profile` constraint.
rescan_mode:
type: string
enum: [full, diff]
description: |
`diff` asks Scrutineer to compare the current commit against a compatible baseline
scan and stage `diff.patch` plus `changed_files.json` for diff-aware skills. The
worker falls back to a full scan when no usable baseline exists or the diff exceeds
safety limits.
baseline_scan_id:
type: integer
format: int64
description: |
Optional baseline scan to use for `rescan_mode: diff`; omitted lets Scrutineer
choose the latest compatible completed scan.
responses:
'201':
description: Scan enqueued
content:
application/json:
schema: { $ref: '#/components/schemas/Scan' }
'400':
description: Bad request (unknown profile, profile mismatch with the skill's `requires_profile`, invalid ref, or invalid `rescan_mode`)
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
'403': { $ref: '#/components/responses/Forbidden' }
'404':
description: Skill or repository not found
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
'409':
description: 'The repository maintainer opted out of federated scanning, so no scan may be enqueued for it.'
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
/findings/{id}:
parameters:
- name: id
in: path
required: true
schema: { type: integer, format: int64 }
get:
summary: Fetch one finding with its six-step prose
operationId: getFinding
responses:
'200':
description: OK
content:
application/json:
schema: { $ref: '#/components/schemas/FindingDetail' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
patch:
summary: Update mutable fields on a finding
operationId: patchFinding
description: |
The authenticated scan must be finding-scoped to this finding ID.
Each field value is written through the history-tracked path.
Finding-scoped skills write with source=model_suggested; browser
form edits use separate routes and write with source=analyst.
Unknown field names are rejected.
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [fields]
properties:
by:
type: string
description: Optional author string for the history row.
fields:
type: object
additionalProperties: { type: string }
description: |
Map of field name to new value. Allowed fields:
title, severity, status, cwe, location, affected, reachability, quality_tier,
cve_id, ghsa_id, cvss_vector, cvss_v4_vector, fix_version, fix_commit,
resolution, disclosure_draft, disclosure_title, suggested_recipients, assignee,
suggested_fix, suggested_fix_commit, breaking_change, breaking_change_rationale,
exploited_in_wild, exploited_in_wild_evidence, mitigation, mitigation_semgrep,
release_tag, release_url, last_revalidate_verdict.
responses:
'204': { description: Updated }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
/findings/{id}/bundle.tar.gz:
get:
summary: Disclosure bundle for one finding
operationId: getFindingBundle
description: |
A gzipped tar containing every per-finding export scrutineer
produces (OSV, CSAF, markdown report, patch.diff when one is on
file) plus a manifest.json header naming the finding and the
archive contents. The per-file bytes are identical to what the
matching /findings/{id}/{file} endpoint serves directly; the
bundle is a composition, not a new format. Shape mirrors the
OSS-SIRT intake brief: one summary line, aliases for
cross-system identifiers, contents map.
parameters:
- name: id
in: path
required: true
schema: { type: integer, format: int64 }
responses:
'200':
description: tar.gz archive.
content:
application/gzip:
schema: { type: string, format: binary }
'404': { description: Finding not found }
'410': { description: Finding is a duplicate; bundle unavailable }
'500': { description: Underlying export failed }
/findings/{id}/notes:
parameters:
- name: id
in: path
required: true
schema: { type: integer, format: int64 }
get:
summary: List notes on a finding
operationId: listFindingNotes
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items: { $ref: '#/components/schemas/FindingNote' }
post:
summary: Append a note to a finding
operationId: addFindingNote
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [body]
properties:
body: { type: string }
by: { type: string }
responses:
'201':
description: Created
content:
application/json:
schema: { $ref: '#/components/schemas/FindingNote' }
/findings/{id}/reviews:
parameters:
- name: id
in: path
required: true
schema: { type: integer, format: int64 }
get:
summary: List structured human verdicts on a finding
operationId: listFindingReviews
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items: { $ref: '#/components/schemas/FindingReview' }
/v1/audit/queue:
get:
summary: Sample of recently auto-bucketed findings without a recorded review
description: |
Returns findings the automation has bucketed as not worth pursuing
(low-severity, rejected, or marked by revalidate as false positive,
already fixed, or uncertain) and that do not yet have a
FindingReview row. Spot-check the queue to keep automated triage
calibrated.
Instance-wide and unauthenticated; relies on the host-only
boundary like the other `/v1/*` exports. Not reachable with a
per-scan bearer token.
operationId: getAuditQueue
parameters:
- name: limit
in: query
schema: { type: integer, default: 50, maximum: 500 }
- name: since
in: query
description: RFC3339 timestamp; excludes findings older than this.
schema: { type: string, format: date-time }
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items: { $ref: '#/components/schemas/Finding' }
/v1/audit/metrics:
get:
summary: Aggregate audit metrics
description: |
Total reviews, those comparable to an automation outcome,
agreements between human verdict and automation, and the
agreement rate (0..1). The audit page renders the same numbers.
Instance-wide and unauthenticated; relies on the host-only
boundary like the other `/v1/*` exports.
operationId: getAuditMetrics
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
TotalReviews: { type: integer }
WithAutomatedOutcome: { type: integer }
Agreements: { type: integer }
AgreementRate: { type: number, format: float }
ByVerdict:
type: object
additionalProperties: { type: integer }
/findings/{id}/communications:
parameters:
- name: id
in: path
required: true
schema: { type: integer, format: int64 }
get:
summary: List logged communications for a finding
operationId: listFindingCommunications
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items: { $ref: '#/components/schemas/FindingCommunication' }
post:
summary: Log a communication (sent or received) about a finding
operationId: addFindingCommunication
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/FindingCommunication' }
responses:
'201':
description: Created
content:
application/json:
schema: { $ref: '#/components/schemas/FindingCommunication' }
/findings/{id}/references:
parameters:
- name: id
in: path
required: true
schema: { type: integer, format: int64 }
get:
summary: List references attached to a finding
operationId: listFindingReferences
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items: { $ref: '#/components/schemas/FindingReference' }
post:
summary: Attach an external reference to a finding
operationId: addFindingReference
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/FindingReference' }
responses:
'201':
description: Created
content:
application/json:
schema: { $ref: '#/components/schemas/FindingReference' }
/findings/{id}/labels:
put:
summary: Replace the set of labels on a finding
operationId: setFindingLabels
parameters:
- name: id
in: path
required: true
schema: { type: integer, format: int64 }
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [labels]
properties:
labels:
type: array
items: { type: string }
description: |
Label names, replacing the finding's current set. Missing
labels are created on demand. Blank and whitespace-only
names are trimmed and ignored, so a request whose names are
all blank clears every label just as `[]` does. The field
itself is required: omitting it or sending null is rejected
rather than treated as a clear-all.
responses:
'204': { description: Updated }
'400':
description: Body is not valid JSON, or has no labels array
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
/findings/{id}/history:
get:
summary: List the history rows recorded for a finding
operationId: listFindingHistory
parameters:
- name: id
in: path
required: true
schema: { type: integer, format: int64 }
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items: { $ref: '#/components/schemas/FindingHistory' }
/findings/{id}/skills/{name}/run:
post:
summary: Enqueue a finding-scoped skill (verify, revalidate, patch, reattack, disclose)
operationId: runFindingSkill
description: |
The authenticated scan's repository must own the finding. The scan
that gets enqueued has FindingID set so its skill body can read
`scrutineer.finding_id` from context.json and act on one finding
specifically.
A `reattack` enqueue ignores a caller-supplied ref and pins the scan to
the newest immutable gated patch attempt and its base commit. It returns
412 when the finding has no gated patch.
parameters:
- name: id
in: path
required: true
schema: { type: integer, format: int64 }
description: Finding id.
- name: name
in: path
required: true
schema: { type: string }
description: Skill name.
requestBody:
required: false
content:
application/json:
schema:
type: object
additionalProperties: false
properties:
model: { type: string }
responses:
'201':
description: Scan enqueued
content:
application/json:
schema: { $ref: '#/components/schemas/Scan' }
'403': { $ref: '#/components/responses/Forbidden' }
'404':
description: Finding or skill not found
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
'409':
description: 'The repository maintainer opted out of federated scanning, so no scan may be enqueued for it, or a federation peer already holds this finding and an outreach skill was asked to report it.'
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
'412':
description: A re-attack was requested but the finding has no reproducible gated patch attempt.
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
/scans/{id}:
get:
summary: Fetch a scan with its report (if complete)
operationId: getScan
parameters:
- name: id
in: path
required: true
schema: { type: integer, format: int64 }
responses:
'200':
description: OK
content:
application/json:
schema: { $ref: '#/components/schemas/ScanDetail' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
/scans/{id}/validate-report:
post:
summary: Validate a candidate report.json against the skill's schema
description: >
Lets a running skill check its report against its skill's schema using
scrutineer's own validator, instead of installing a JSON Schema library
inside the runner container. The request body is the candidate report
JSON; a 200 response carries {"valid": true} when it conforms, or
{"valid": false, "errors": "..."} listing the failures. A skill with no
schema returns {"valid": true, "note": "skill has no schema"}. The token
may only validate the scan it was issued for. Body is capped at 1 MB.
operationId: validateReport
parameters:
- name: id
in: path
required: true
schema: { type: integer, format: int64 }
requestBody:
required: true
content:
application/json:
schema: { type: object, additionalProperties: true }
responses:
'200':
description: Validation result (valid true or false; never a schema error)
content:
application/json:
schema:
type: object
properties:
valid: { type: boolean }
errors: { type: string }
note: { type: string }
required: [valid]
'400':
description: Scan has no associated skill
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'413':
description: Report body exceeds the 1 MB limit
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
/skills:
get:
summary: List installed skills
operationId: listSkills
parameters:
- name: active
in: query
schema: { type: boolean }
description: >
Filter by active state. An empty value applies no filter; a value
that is not a boolean returns 400.
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items: { $ref: '#/components/schemas/SkillSummary' }
'400': { $ref: '#/components/responses/BadRequest' }
/cnas:
get:
summary: List CVE Numbering Authorities
description: >
Cached copy of the cve.org partner list. Global, not repo-scoped.
Use q to substring-match across short_name, organization, and scope.
operationId: listCNAs
parameters:
- name: q
in: query
schema: { type: string }
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
type: object
properties:
short_name: { type: string }
cna_id: { type: string }
organization: { type: string }
scope: { type: string }
email: { type: string }
contact_url: { type: string }
policy_url: { type: string }
advisory_url: { type: string }
root: { type: string }
types: { type: string }
/v1/repositories:
get:
summary: Export repositories as JSONL
description: |
Returns one JSON object per line (`application/x-ndjson`) for the
Repositories tab data set. Each line includes selected scalar
repository columns, the latest scan summary, and the same curated
findings count shown in the UI. Large metadata and ecosystems cache
blobs are intentionally omitted to keep the payload suitable for
automation. No bearer token; localhost-only.
operationId: exportRepositories
security: []
parameters:
- name: format
in: query
schema: { type: string, enum: [jsonl] }
responses:
'200':
description: JSONL stream of RepositoryExport objects, one per line.
content:
application/x-ndjson:
schema: { $ref: '#/components/schemas/RepositoryExport' }
'400':
description: Unsupported format query value, or `encrypt`/`scope`/`include` requested (only valid on per-repository bundle exports).
'403':
description: Host header is not localhost
/v1/repositories/{id}:
delete:
summary: Delete a repository and its linked data
description: |
Host-only operator endpoint for local automation. Removes the