feat(controls): ship a CRA catalog snapshot, map without the backend
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 5m55s

Control mapping was gated on BREAKPILOT_BASE_URL, so on staging (where
breakpilot-compliance is not reachable until the dsms migration) every
finding came back without control_refs. The catalog loader already
snapshots fetched bytes and falls back to them offline; this makes the
snapshot a first-class source:

- the provider takes an optional base URL and serves snapshots alone,
- the agent image ships compliance-agent/controls/snapshot (CRA Annex I,
  40 controls, built by breakpilot-compliance's build_cra_catalog) and
  the entrypoint seeds it into BREAKPILOT_SNAPSHOT_DIR if absent, so a
  snapshot refreshed from a live backend always wins,
- scripts/refresh-oscal-snapshot.sh regenerates the committed files.

master-controls stays DB-derived and unshipped, so the semantic pass is
still a no-op offline; run those environments with
BREAKPILOT_SEMANTIC_MAPPING=false.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
This commit is contained in:
Sharang ParnerkarandClaude Opus 5 committed 2026-09-12 20:20:04 +02:00
1 parent 7eb4d8054a
commit 3c8de961aa
9 files changed
+2935 -41

No files matched your search

+15
View File
@@ -16,4 +16,19 @@ if [ ! -e /nix/store ]; then
fi
fi
# Seed the OSCAL control-catalog snapshot. The image ships a catalog snapshot so
# control mapping works without the breakpilot-compliance backend
# (BREAKPILOT_BASE_URL unset). Copy-if-absent, so a snapshot refreshed from a
# live backend (or a mounted volume) always wins.
SNAP_DIR="${BREAKPILOT_SNAPSHOT_DIR:-/data/compliance-scanner/oscal}"
if [ -d /opt/breakpilot/oscal-snapshot ]; then
mkdir -p "$SNAP_DIR"
for f in /opt/breakpilot/oscal-snapshot/*.json; do
[ -e "$f" ] || continue
if [ ! -e "$SNAP_DIR/$(basename "$f")" ]; then
cp "$f" "$SNAP_DIR/" && echo "agent-entrypoint: seeded $(basename "$f") into $SNAP_DIR"
fi
done
fi
exec compliance-agent "$@"