Skip to content

CRA Assessment Engine — Architecture

The CRA Assessment Engine is integrated into Fleet as a new product capability. It scans codebases against a structured catalog of CRA Annex I requirements, producing findings, evidence records, and compliance reports suitable for Module A technical documentation.

┌──────────────────────────────────────────────────────────────────┐
│ Fleet Platform │
│ │
│ ┌─────────────┐ ┌──────────────┐ ┌───────────────────────┐ │
│ │ Catalog │ │ Scanner │ │ LLM Layer │ │
│ │ Compiler │──▶│ Engine │──▶│ (Ollama/Claude/OAI) │ │
│ │ (TS) │ │ (Rust) │ │ │ │
│ └─────────────┘ └──────┬───────┘ └───────────┬───────────┘ │
│ │ │ │
│ ┌──────▼────────────────────────▼──────┐ │
│ │ Evidence Pipeline │ │
│ │ (hash, sign, attest, store) │ │
│ └──────────────┬───────────────────────┘ │
│ │ │
│ ┌─────────────────────────┼──────────────────────┐ │
│ │ │ │ │
│ ┌─────▼─────┐ ┌──────────────▼──┐ ┌──────────────▼──┐ │
│ │ Axum API │ │ PostgreSQL │ │ S3 Storage │ │
│ │ (REST) │ │ (11 tables) │ │ (evidence) │ │
│ └─────┬─────┘ └─────────────────┘ └─────────────────┘ │
│ │ │
└────────┼─────────────────────────────────────────────────────────┘
┌─────▼────┐ ┌────────────┐ ┌───────────┐
│Dashboard │ │ CI Actions │ │ MCP Tools │
│(lit-html)│ │ (GH/GL/…) │ │ (35 tools)│
└──────────┘ └────────────┘ └───────────┘
ModulePathPurpose
Catalog compilercatalog/compiler/compile.tsCompiles resources/structure.md into catalog/compiled/catalog.json
Catalog loadersrc/assessment/catalog.rsLoads compiled JSON, provides O(1) indexed lookups by requirement/risk/feature ID
Detection enginesrc/assessment/detect.rsDetector trait, DetectorRegistry, project discovery, finding types
11 Detectorssrc/assessment/detectors/crypto, network, auth, input, storage, update, logging, supply_chain, config, vuln_handling, ai
AI Advisorsrc/advisor/LlmBackend trait, Ollama/Claude/OpenAI backends, secret redaction, CRA-tuned prompts
Evidencesrc/assessment/evidence.rsEvidence records, SHA-256 hashing, LLM provenance
Attestationsrc/assessment/attestation.rsHMAC-SHA256 signing, CI identity detection, attestation envelopes
Pipelinesrc/assessment/pipeline.rsOrchestrates: discovery -> detection -> LLM review -> evidence -> SBOM -> CBOM
Scoringsrc/assessment/scoring.rsComponent criticality scoring (10-50 scale), 4 assessment tiers
Reportsrc/assessment/report.rsModule A Markdown report generation
SBOMsrc/sbom.rs9-ecosystem SBOM generation, CycloneDX 1.6, diff, hashes, licenses
CBOMsrc/cbom.rsCryptographic BOM — 30 crypto rules, compliance classification
Vuln enrichmentsrc/vuln_enrich.rsOSV.dev batch API for vulnerability data
DB modelssrc/db_assessment.rsPostgreSQL models and queries for all assessment tables
APIsrc/api/assessment.rs25+ REST endpoints under /api/v1/assessment/
MCP toolssrc/mcp/tools.rs35 tools — assessment, AI advisor, distribution, licensing, admin, docs
Dashboarddashboard/Vite + lit-html + Sass SaaS dashboard
CI integrationsintegrations/GitHub Action, GitLab CI, Jenkins, Bitbucket, Azure DevOps, CircleCI, Drone, Woodpecker
1. CLI: fleet scan --path ./repo
2. Load catalog (embedded catalog.json at compile time)
3. Project discovery: languages, manifests, lockfiles, configs, CI
4. Parallel detection: 11 detectors scan relevant files
- Override suppression: skip requirement IDs with active false_positive/accepted_risk overrides
5. SBOM generation: parse lockfiles -> CycloneDX 1.6 JSON
6. CBOM generation: scan source for crypto primitives -> CycloneDX cryptography BOM
7. Vulnerability enrichment: query OSV.dev for CVEs by PURL (optional)
8. Finding assembly: map detector results to catalog requirements
9. LLM review: send NeedsReview findings to LLM for evidence generation (optional)
10. Evidence generation: hash each finding, create EvidenceRecord
11. Attestation: sign evidence bundle with HMAC-SHA256 (optional)
12. Output: JSON report + SBOM + CBOM + Module A Markdown report
13. Upload: POST results to Fleet API (optional, for dashboard)
TablePurposeRecords
rulesetsCatalog versions (draft/published/archived)Immutable once published
assessed_productsProducts under assessment, linked to Fleet appsPer-product config
scansCI/CLI scan runs with summaryOne per pipeline execution
findingsPer-requirement assessment resultsLinked to scan
evidence_recordsImmutable evidence (append-only, no UPDATE)10-year retention
assessment_entriesCurrent compliance status per requirementUpserted on each scan
finding_overridesFalse-positive/negative/accepted-risk/deferredAuditable, revocable
remediationsFix tracking (planned -> verified)Linked to finding + scan
questionnaire_sessionsInterview/doc evidence sessionsPer-product
questionnaire_answersIndividual question responsesLinked to evidence
sbom_recordsSBOM/CBOM storage referencesLinked to scan + S3
Scanner detects pattern
Finding: pass / fail / needs_review / not_applicable
├─── LLM Review (optional) ──▶ pass / fail / inconclusive
Triage (API or dashboard)
├── Accept (confirm compliant)
├── Reject (confirm non-compliant) ──▶ Create Remediation
├── False Positive (suppress) ──▶ Override created, skipped in future scans
├── Accepted Risk (document) ──▶ Override created, treated as compliant
└── Defer (postpone) ──▶ Override created with review date

Evidence records have no updated_at column. They are append-only by design:

  • Each scan creates new evidence records
  • Old records are never modified or deleted
  • Content integrity verified via SHA-256 hash
  • Optional HMAC-SHA256 attestation signature
  • Designed for the CRA 10-year retention obligation (Article 23)
Feature Category (13)
└── Feature (54)
├── Risk (163)
│ └── Annex I Reference
└── Requirement (401)
├── Assessment Method
└── Evidence Type: Auto | Semi | Doc | Test

The catalog is authored in Markdown (resources/structure.md), compiled to JSON, and embedded in the Rust binary at compile time via include_bytes!.