Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions compliance/risk_acceptance/THRESHOLD_TRACEABILITY_MATRIX.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Threshold IDs follow the pattern `THR-<CATEGORY>-<NNN>`:
| **THR-SEC-002** | OPA Circuit Breaker — Max Policy Evaluation Failures | 5 | count | IR-4, SC-7, SI-7 | OPA config in `deployment/opa_config.yaml`; `CircuitBreaker` in [`src/gateway/core/policy.py`](../../src/gateway/core/policy.py) (`failure_threshold=5`, `recovery_timeout=30.0`) | `lula-validation-cm6.yaml` | Structured gateway logs (`OPA circuit breaker: ... -> OPEN`); Prometheus metric planned | — | After 5 consecutive upstream failures (transport errors, HTTP 5xx, or HTTP 408/429), the circuit breaker opens for 30s and fast-fails to `"DENY"` before probing with a single `HALF_OPEN` request. Every failed call during the pre-open window also returns `"DENY"` (fail-closed); HTTP 4xx and local pool saturation (`httpx.PoolTimeout`) deny that request without tripping the breaker. |
| **THR-AUD-001** | Audit Log Retention Period | 90 | days | AU-11, AU-12 | GCS lifecycle policy in `infra/`; Langfuse trace retention configured in Langfuse admin | `lula-validation-au12.yaml` (AU-12 audit record generation) | `cage.audit.log_age_days` (gauge — alert if logs deleted early) | POAM-003 (AU-12 synthetic traces) | 90 days is the minimum for HIGH-impact systems per AU-11. Organization retains for 1 year for financial regulatory compliance. |
| **THR-AUD-002** | Lula Audit Run Cadence | 6 | hours | CA-7, AU-12 | Lula CronJob (`0 */6 * * *` standalone Terraform CronJob tracked under `POAM-2026-195`, retiring `385e502e:src/compliance_bridge/lula_scheduler.py` and `de5534ac:deployment/k8s/lula-cron.yaml`) | Self-validating (Lula run produces OSCAL assessment result) | `cage.lula.last_run_age_seconds` (gauge) | `POAM-2026-195` | 6-hour cadence provides near-real-time continuous monitoring per CA-7. |
| **THR-AUD-003** | SBOM Generation Cadence | 24 | hours | CM-8 | CI daily schedule in `.github/workflows/security-scan.yml` and `.github/workflows/sbom.yml` (`0 2 * * *`; unmanaged `de5534ac:deployment/k8s/sbom-cronjob.yaml` retired) | `lula-validation-cm6.yaml` (CM-8 component inventory) | `cage.sbom.last_generated_age_hours` (gauge) | POAM-006 | Daily CI SBOM generation and Artifact Registry image digests provide CM-8 component inventory. |
| **THR-AUD-003** | SBOM Generation Cadence | 24 (Python/FS) / per-push (images) | hours / event | CM-8 | Daily `0 2 * * *` + PR/push in [`.github/workflows/security-scan.yml`](../../.github/workflows/security-scan.yml) (Python `uv.lock` deps + repo filesystem); PR/push-only in [`.github/workflows/sbom.yml`](../../.github/workflows/sbom.yml) (4 container images; no `schedule` cron; unmanaged `de5534ac:deployment/k8s/sbom-cronjob.yaml` retired in `#686`, zero SBOM/CVE CronJobs in `infra/`) | — (`lula-validation-cm6.yaml` checks config settings only; no active CM-8 Lula spec) | — (CI workflow artifacts only; no runtime `cage.sbom.*` gauge) | POAM-006 (Open), POAM-2026-010 (Open), POAM-2026-221 | Daily CI Python/filesystem SBOM + Grype scan (`security-scan.yml`, restored in `#768` `b92a1719`) and build-time container SBOMs (`sbom.yml`); periodic in-cluster container scanning remains Open (`POAM-2026-010`). |
| **THR-OBS-001** | OpenTelemetry Trace Sampling Rate | 0.01 (1%) | probability | AU-2, AU-12, SA-8 | OTel SDK config in `src/governed_financial_advisor/infrastructure/telemetry/__init__.py`; `OTEL_TRACES_SAMPLER_ARG=0.01` env var | `lula-validation-au12.yaml` | `cage.otel.trace_sample_rate` (gauge) | — | **KNOWN RISK ACCEPTANCE** — see Section 5. 1% sampling is insufficient for full AU-12 audit evidence. Compensating control: all governance decisions (policy evaluations, confidence checks, trade blocks) are logged at 100% regardless of sampling rate. |
| **THR-OBS-002** | Langfuse Evidence Age Maximum (ISO 42001 A.5.2) | 172,800 | seconds (48 hr) | ISO 42001 A.5.2, AU-12, CA-7 | Freshness SLA monitor in `src/compliance_bridge/sla_monitor.py` (`evidence_age_seconds < 172800`) | `lula-validation-cm6.yaml` | `cage.langfuse.evidence_age_seconds` (gauge) | — | 48-hour evidence freshness window ensures Lula can validate continuous monitoring evidence. |
| **THR-OBS-003** | ISO 42001 A.5.2 Safety Rate Minimum | 0.99 (99%) | rate [0,1] | ISO 42001 A.5.2, RA-3 | Lula Rego in `compliance/lula/lula-validation-a52.yaml` → `safety_rate >= 0.99` | Lula A.5.2 validation manifest (`lula-validation-a52.yaml`) | `cage.iso42001.a52_safety_rate` (gauge) | — | 99% of all inference requests must pass safety checks. Derived from ISO 42001 A.5.2 monitoring requirements. |
Expand Down Expand Up @@ -150,10 +150,10 @@ This section provides a reverse lookup: for each NIST SP 800-53 control family,
| **AU-12** | Audit Record Generation | Lula cadence, OTel sampling, evidence age freshness | THR-AUD-002, THR-OBS-001, THR-OBS-002 | ⚠️ PARTIAL — POAM-003 (synthetic traces); AU-12 validated by Lula |
| **CM-6** | Configuration Settings | All thresholds in governance_thresholds.json are CM-6 configuration settings | ALL THR-\* | ✅ Validated by `schemas/thresholds.py` Pydantic enforcement + Lula |
| **CM-7** | Least Functionality | OPA circuit breaker (fail-closed) prevents unauthorized gateway functionality on policy engine failure | THR-SEC-002 | ✅ Implemented — fail-closed circuit breaker |
| **CM-8** | System Component Inventory | SBOM generation cadence | THR-AUD-003 | 🔄 IN PROGRESS — POAM-006; remediated by sbom-cronjob.yaml |
| **CM-8** | System Component Inventory | SBOM generation cadence | THR-AUD-003 | ⚠️ PARTIAL — POAM-006 (Open); CI workflows (`sbom.yml` on PR/push, `security-scan.yml` daily + PR/push; `de5534ac:deployment/k8s/sbom-cronjob.yaml` was unmanaged and retired in `#686`) |
| **IR-4** | Incident Handling | Drawdown thresholds trigger automated incident response (trade halt) | THR-FIN-002, THR-FIN-004 | ✅ Implemented — STPA validator auto-halt |
| **RA-3** | Risk Assessment | All financial guardrail thresholds derive from RA-3 risk assessment | THR-FIN-001 through THR-FIN-006, THR-CBF-001 | ✅ Threshold values documented with risk rationale |
| **RA-5** | Vulnerability Monitoring | SBOM generation (CM-8/RA-5 overlap) enables CVE cross-referencing | THR-AUD-003 | 🔄 IN PROGRESS — POAM-010; Grype integration added |
| **RA-5** | Vulnerability Monitoring | SBOM generation (CM-8/RA-5 overlap) enables CVE cross-referencing | THR-AUD-003 | ⚠️ PARTIAL — CI `pip-audit` + Trivy/Syft/Grype (`POAM-010`, Python SBOM leg restored `2026-11-15` under `POAM-2026-221`); in-cluster periodic scanning Open under `POAM-2026-010` |
| **SA-8** | Security Engineering | Confidence threshold, latency SLAs, CBF parameter reflect security engineering principles | THR-CONF-001, THR-LAT-001, THR-CBF-001 | ✅ Documented with STPA and formal methods derivation |
| **SC-7** | Boundary Protection | OPA circuit breaker enforces boundary between external input and trade execution | THR-SEC-002 | ✅ Implemented |
| **SC-8** | Transmission Confidentiality | Latency SLAs indirectly enforce SC-8 (slow responses may indicate TLS inspection); latency anomaly detection | THR-LAT-001 | ⚠️ PARTIAL — POAM-011 (no TLS assertion test) |
Expand Down Expand Up @@ -257,22 +257,22 @@ This section documents thresholds that represent **known risk acceptances** —

---

### 5.3 RA-003: SBOM Scanning Latency — Daily vs. Real-Time (THR-AUD-003)
### 5.3 RA-003: SBOM & Vulnerability Scanning Cadence Gap — No In-Cluster CronJob / Build-Only Container SBOMs (THR-AUD-003)

| Field | Value |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Risk Acceptance ID** | RA-003 |
| **Threshold** | THR-AUD-003 — SBOM Generation Cadence |
| **Current Value** | 24 hours (daily at 02:00 UTC) |
| **Ideal Value** | Per-build SBOM generation (on every CI push) |
| **Risk Accepted** | A new CVE disclosed after a container image is built but before the next daily SBOM scan (up to 23h 59m) would not be detected until the next scheduled scan. In a zero-day scenario, CAGE could run vulnerable code for up to 24 hours without automated detection. |
| **Why Not Per-Build?** | Full container image SBOM scanning (Syft + Grype) takes 3–8 minutes per image. The K8s CronJob scans all 4 CAGE images; doing this on every git push would add 15–30 minutes to CI and create GCS cost concerns for artifact storage. Per-build Python SBOM is implemented in CI (mitigates Python-specific risk). |
| **Current Value** | Python `uv.lock` & repo filesystem: daily (`0 2 * * *`) + PR/push in [`.github/workflows/security-scan.yml`](../../.github/workflows/security-scan.yml). Shipped container images (4 images): PR/push-only in [`.github/workflows/sbom.yml`](../../.github/workflows/sbom.yml) (no `schedule` cron; zero in-cluster SBOM/CVE `CronJob` in Terraform) |
| **Ideal Value** | Per-build SBOM generation plus scheduled daily re-scan of deployed container image digests |
| **Risk Accepted** | A CVE newly disclosed in an OS/container package after the most recent `main` image build is not automatically re-scanned against deployed container images until the next `sbom.yml` push/PR run or manual dispatch, because no periodic container-image `schedule` or in-cluster Kubernetes scanning `CronJob` is deployed (`POAM-2026-010`, Open). |
| **Correction (`2026-11-15`)** | Earlier versions of `RA-003` asserted (a) an active Kubernetes `CronJob` scanning all 4 CAGE images daily at `02:00 UTC` ("24h max" container exposure window) and (b) per-push Python dependency SBOM coverage via `security-scan.yml::sbom-generation`. Both assertions were inaccurate: **(a)** `de5534ac:deployment/k8s/sbom-cronjob.yaml` was an unmanaged pre-Terraform manifest retired in `#686` and Terraform (`infra/`) deploys no SBOM or vulnerability-scanning `CronJob` (`POAM-2026-010`, Open); **(b)** from `1902c92c` (`2026-06-01`) through `9b2b745d` (`2026-11-15`), `security-scan.yml::sbom-generation` ran `pip install cyclonedx-bom` without `uv sync` and emitted a 0-dependency Python SBOM (`POAM-2026-221`, remediated in `#768` `b92a1719` with `uv sync` + `expected_uv_lock_component_floor()`). |
| **Who Accepted** | Authorizing Official (AO) — [SIGNATURE PENDING] |
| **Acceptance Date** | Pending AO signature (target: 2026-04-30) |
| **Compensating Controls** | (1) Python dependency SBOM IS generated on every CI push via `sbom-generation` GitHub Actions job. (2) pip-audit runs on every PR. (3) Trivy filesystem scan runs on every PR. (4) GitHub Dependabot alerts provide near-real-time CVE notification independent of SBOM pipeline. |
| **Residual Risk** | Low — container image CVE exposure window is 24h max; Python dependency exposure is near-zero due to per-build scanning. |
| **Review Date** | 2026-09-30 |
| **POAM Ref** | POAM-006 (being remediated), POAM-010 |
| **Acceptance Date** | Pending AO signature |
| **Compensating Controls** | (1) `security-scan.yml::python-dependency-audit` (`uv sync --frozen --all-groups --all-extras` + `pip-audit`) and `security-scan.yml::sbom-generation` (restored in `#768` `b92a1719`, `POAM-2026-221`) run on every PR, `main` push, and daily at `02:00 UTC`. (2) `sbom.yml` builds and Trivy-scans all 4 Wolfi container images on PRs/pushes touching `src/`, `Dockerfile*`, `pyproject.toml`, or `uv.lock`. (3) Trivy filesystem scan runs on every PR and daily. (4) GitHub Dependabot alerts provide CVE notifications on `uv.lock`. |
| **Residual Risk** | Moderate — Python dependency exposure is bounded to ≤24h (`security-scan.yml` daily schedule), while deployed container image digests lack scheduled in-cluster or daily registry re-scanning until `POAM-2026-010` closes. |
| **Review Date** | 2026-12-31 |
| **POAM Ref** | `POAM-006` (Open), `POAM-010` (Closed on CI `pip-audit` + Trivy; Python SBOM leg qualified under `POAM-2026-221`), `POAM-2026-010` (Open — in-cluster CronJob), `POAM-2026-221` (Closed at `b92a1719`) |

---

Expand Down
Loading
Loading