147 lines
3.3 KiB
YAML
147 lines
3.3 KiB
YAML
openapi: 3.0.3
|
|
info:
|
|
title: Admin Findings API (Internal)
|
|
version: 0.1.0
|
|
description: |
|
|
Internal contracts for the generic Findings pipeline.
|
|
Drift MVP is the first generator (finding_type=drift).
|
|
|
|
servers:
|
|
- url: /admin/api
|
|
|
|
paths:
|
|
/findings:
|
|
get:
|
|
summary: List findings
|
|
parameters:
|
|
- in: query
|
|
name: finding_type
|
|
schema:
|
|
type: string
|
|
enum: [drift, audit, compare]
|
|
- in: query
|
|
name: status
|
|
schema:
|
|
type: string
|
|
enum: [new, acknowledged]
|
|
- in: query
|
|
name: scope_key
|
|
schema:
|
|
type: string
|
|
- in: query
|
|
name: current_run_id
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
data:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/Finding'
|
|
|
|
/findings/{id}:
|
|
get:
|
|
summary: Get finding detail
|
|
parameters:
|
|
- in: path
|
|
name: id
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/Finding'
|
|
|
|
/findings/{id}/acknowledge:
|
|
post:
|
|
summary: Acknowledge a finding
|
|
parameters:
|
|
- in: path
|
|
name: id
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/Finding'
|
|
|
|
/drift/generate:
|
|
post:
|
|
summary: Generate drift findings (async)
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
scope_key:
|
|
type: string
|
|
description: Inventory selection hash
|
|
required: [scope_key]
|
|
responses:
|
|
'202':
|
|
description: Accepted
|
|
|
|
components:
|
|
schemas:
|
|
Finding:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
finding_type:
|
|
type: string
|
|
enum: [drift, audit, compare]
|
|
tenant_id:
|
|
type: integer
|
|
scope_key:
|
|
type: string
|
|
baseline_run_id:
|
|
type: integer
|
|
nullable: true
|
|
current_run_id:
|
|
type: integer
|
|
nullable: true
|
|
fingerprint:
|
|
type: string
|
|
subject_type:
|
|
type: string
|
|
subject_external_id:
|
|
type: string
|
|
severity:
|
|
type: string
|
|
enum: [low, medium, high]
|
|
status:
|
|
type: string
|
|
enum: [new, acknowledged]
|
|
acknowledged_at:
|
|
type: string
|
|
nullable: true
|
|
acknowledged_by_user_id:
|
|
type: integer
|
|
nullable: true
|
|
evidence_jsonb:
|
|
type: object
|
|
additionalProperties: true
|