Commit 6745761
authored
feat(reports): fleet OSCAL SAR face for attestation reports (B2) (#643)
Add a fleet OSCAL 1.0.6 assessment-results face (format=oscal_sar,
attestation-only) to the Reports export surface.
Kensa's per-scan exporter (ExportOSCALScan) inlines each scan's evidence
as base64 and is per-scan, so it cannot produce the hash-referencing
single-document fleet SAR the design requires. internal/report/oscal.go
is a light, custom assembler with its own minimal OSCAL structs mirroring
the per-scan shape:
- One assessment-results document, one result, one observation + finding
per (host, rule) reconstructed from the attestation snapshot's frozen,
immutable scan_results.
- Finding target state "satisfied" only on a pass (else
"not-satisfied"); host as a deterministic-v5 inventory-item subject.
- Reviewed-controls aggregated as framework-prefixed control-id tokens
(digit-leading native ids like CIS "1.1" stay valid OSCAL tokens),
narrowed by the snapshot's framework lens.
- Evidence REFERENCED by sha256 in back-matter (an rlink SHA-256 hash),
never inlined as base64; the bytes stay in scan_evidence. This is what
keeps a 100-host x 500-rule attestation from becoming the 1000-page
problem in OSCAL form.
- Every uuid is a deterministic v5 from the snapshot id, so the document
is byte-deterministic and cached in report_faces (face oscal_sar) like
the PDF/CSV faces; assembly is bounded by the same row cap as the CSV,
with a metadata prop disclosing truncation.
OSCAL version stays 1.0.6 to match the Kensa-controlled per-scan emitter.
Spec api-reports v1.8.0: C-14 + AC-20 (DB test over the assembled
document: shape, states, control tokens, hash-referenced evidence,
determinism, framework-lens scoping, executive ErrInvalidFace).1 parent 3c55fcf commit 6745761
8 files changed
Lines changed: 879 additions & 126 deletions
File tree
- api
- docs/engineering
- internal
- report
- server
- api
- specs/api
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2606 | 2606 | | |
2607 | 2607 | | |
2608 | 2608 | | |
2609 | | - | |
| 2609 | + | |
2610 | 2610 | | |
2611 | 2611 | | |
2612 | | - | |
2613 | | - | |
2614 | | - | |
2615 | | - | |
2616 | | - | |
2617 | | - | |
2618 | | - | |
| 2612 | + | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
| 2616 | + | |
| 2617 | + | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
2619 | 2624 | | |
2620 | 2625 | | |
2621 | 2626 | | |
| |||
2625 | 2630 | | |
2626 | 2631 | | |
2627 | 2632 | | |
2628 | | - | |
| 2633 | + | |
2629 | 2634 | | |
2630 | 2635 | | |
2631 | 2636 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
519 | 519 | | |
520 | 520 | | |
521 | 521 | | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
527 | 542 | | |
528 | 543 | | |
529 | 544 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
64 | 69 | | |
65 | 70 | | |
66 | 71 | | |
| |||
150 | 155 | | |
151 | 156 | | |
152 | 157 | | |
153 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
154 | 165 | | |
155 | 166 | | |
156 | 167 | | |
| |||
0 commit comments