Makes the OSCAL loop live: POST /api/v1/oscal/assess on the agent pulls the control catalog for a target's frameworks, loads the target's findings from the tenant DB, and returns a standard OSCAL 1.1 assessment-results document linking findings to controls.
Completes the chain: breakpilot-compliance#128 (export) → #210 (ingest) → #211 (assess) → this (the live endpoint).
What's in it
BreakpilotConfig (base_url / token / snapshot_dir) from BREAKPILOT_* env; the endpoint returns 503 when base_url is unset.
handlers::oscal::assess_target on the authenticated, tenant-scoped router: provider.load(frameworks) + DB findings + assess() → OSCAL.
Test helpers updated for the new config field.
Verified live (not just unit tests)
Ran the built agent against a local Mongo + a local catalog server + two seeded findings:
POST /api/v1/oscal/assess {"target_id":"demo-target"} → HTTP 200, OSCAL 1.1.2 assessment-results
Control-driven direction (run scans / a code-side LLM evidence-finder per control) + surface the assessment-results through compliance-mcp for breakpilot's scanner_mcp_client (the pull-flow they already wrote a client for).
## What
Makes the OSCAL loop **live**: `POST /api/v1/oscal/assess` on the agent pulls the control catalog for a target's frameworks, loads the target's findings from the tenant DB, and returns a standard **OSCAL 1.1 assessment-results** document linking findings to controls.
Completes the chain: `breakpilot-compliance#128` (export) → `#210` (ingest) → `#211` (assess) → **this** (the live endpoint).
## What's in it
- **`BreakpilotConfig`** (`base_url` / `token` / `snapshot_dir`) from `BREAKPILOT_*` env; the endpoint returns `503` when `base_url` is unset.
- **`handlers::oscal::assess_target`** on the authenticated, tenant-scoped router: `provider.load(frameworks)` + DB findings + `assess()` → OSCAL.
- Test helpers updated for the new config field.
## Verified live (not just unit tests)
Ran the built agent against a local Mongo + a local catalog server + two seeded findings:
- `POST /api/v1/oscal/assess {"target_id":"demo-target"}` → **HTTP 200**, OSCAL 1.1.2 assessment-results
- `cra-ai-8` (*Keine Default-Passwörter*) → **not-satisfied** ← `[semgrep] Hardcoded credential @ src/auth.rs:42` (CWE-798)
- `cra-ai-13` (*Verschlüsselung sensibler Daten*) → **not-satisfied** ← `[semgrep] Weak cipher (DES) @ src/crypto.rs:88` (CWE-327)
- 40 reviewed controls, 2 observations, deterministic uuids.
## Testing
- `cargo clippy -p compliance-agent -- -D warnings` + `cargo fmt --all --check`: clean.
- `cargo test -p compliance-core -p compliance-agent -p werkbank-exec --lib`: **287 + 47 + 27 pass.**
## Next (PR-5)
Control-driven direction (run scans / a code-side LLM evidence-finder *per control*) + surface the assessment-results through `compliance-mcp` for breakpilot's `scanner_mcp_client` (the pull-flow they already wrote a client for).
Wires ingest (OscalControlsProvider) + assessment (assess) behind an agent
endpoint: pulls the catalog for the target's frameworks (default CRA), loads the
target's findings from the tenant DB, and returns an OSCAL assessment-results
document linking findings to controls.
- BreakpilotConfig (base_url/token/snapshot_dir) from BREAKPILOT_* env; endpoint
returns 503 when base_url is unset
- handlers::oscal::assess_target on the authenticated (tenant-scoped) router
- test helpers updated for the new config field
clippy -D warnings + fmt + CI test cmd (287+47+27) clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
sharang
merged commit 5285fb67ae into main2026-07-20 19:13:47 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
Makes the OSCAL loop live:
POST /api/v1/oscal/assesson the agent pulls the control catalog for a target's frameworks, loads the target's findings from the tenant DB, and returns a standard OSCAL 1.1 assessment-results document linking findings to controls.Completes the chain:
breakpilot-compliance#128(export) →#210(ingest) →#211(assess) → this (the live endpoint).What's in it
BreakpilotConfig(base_url/token/snapshot_dir) fromBREAKPILOT_*env; the endpoint returns503whenbase_urlis unset.handlers::oscal::assess_targeton the authenticated, tenant-scoped router:provider.load(frameworks)+ DB findings +assess()→ OSCAL.Verified live (not just unit tests)
Ran the built agent against a local Mongo + a local catalog server + two seeded findings:
POST /api/v1/oscal/assess {"target_id":"demo-target"}→ HTTP 200, OSCAL 1.1.2 assessment-resultscra-ai-8(Keine Default-Passwörter) → not-satisfied ←[semgrep] Hardcoded credential @ src/auth.rs:42(CWE-798)cra-ai-13(Verschlüsselung sensibler Daten) → not-satisfied ←[semgrep] Weak cipher (DES) @ src/crypto.rs:88(CWE-327)Testing
cargo clippy -p compliance-agent -- -D warnings+cargo fmt --all --check: clean.cargo test -p compliance-core -p compliance-agent -p werkbank-exec --lib: 287 + 47 + 27 pass.Next (PR-5)
Control-driven direction (run scans / a code-side LLM evidence-finder per control) + surface the assessment-results through
compliance-mcpfor breakpilot'sscanner_mcp_client(the pull-flow they already wrote a client for).