Commit 1ee3694
CAGE Bot
feat(governance): add FlowSignal provider seam and TLS hardening
Implements Phase 1 (P0) of the FlowSignal integration plan and remediates
POAM-2026-011 (TLS 1.0/1.1 deprecation). This changeset combines governance
infrastructure enhancements with security hardening across the provider
adapter seam, consequence authority boundary, and cryptographic transport.
## TLS Hardening (POAM-2026-011, SC-8)
- New: `src/gateway/infrastructure/tls_context.py` — hardened TLS context
factory enforcing NIST SP 800-52 Rev. 2 (TLS 1.2+ minimum, explicit
OP_NO_TLSv1/TLSv1_1 disablement). Remediates POAM-2026-011.
- Updated: `tests/test_tls_enforcement.py` — exercises
`create_hardened_client_context()` factory instead of
`ssl.create_default_context()` directly (assertions unchanged in
strictness).
## FlowSignal Provider Adapter & Conformance
- Extended: `src/integrations/provider_01/provider.py` — tri-state decision
mapping (ALLOW/REFUSE/ESCALATE), backward-compatible with legacy
admitted/findings shape, fail-closed PARSE_ERROR on malformed responses.
- Extended: `tests/test_normative_provider_conformance.py` — 210-line
conformance suite addition with respx-mocked FlowSignal-specific cases
(decision mapping, tri-state semantics, backward compatibility).
- Extended: `src/gateway/governance/normative_provider.py` — explicit
Callable type hints for escalation hooks, protocol refinements for
provider adapter seam.
## DeferQueue & Governance Middleware
- Extended: `src/gateway/governance/defer_queue.py` — FlowSignal escalation
TTL override (300s), new DeferReason.FLOWSIGNAL_ESCALATION enum member,
extensible DLQ routing hook (additive, backward-compatible).
- Extended: `tests/test_defer_queue.py` — 299-line test expansion covering
TTL override, escalation semantics, DLQ publish callback.
- Extended: `src/gateway/server/governance_middleware.py` — middleware
integration for escalation flow (43-line addition).
- Extended: `tests/test_governance_middleware.py` — 159-line middleware
test expansion.
## ConsequenceAuthorityStore (Redis Atomic Consumption)
- New: `src/gateway/governance/consequence_authority_store.py` — distributed
single-use consumption primitive using Redis SET NX PX (atomic, lock-free,
binding-hash verification for substitution-attack detection). Key
namespace: flowsignal:token:* (90s TTL, 1.5× safety margin over 60s JWS
TTL). Fail-closed on Redis errors.
- New: `tests/test_consequence_authority_store.py` — 513-line hermetic unit
test suite (fakeredis, no live Redis dependency): happy path, replay,
substitution, TTL expiry, concurrency (asyncio.gather), Redis error
propagation, from_env() factory, key schema validation.
## Compliance Artifacts
- New: `compliance/lula/lula-validation-flowsignal.yaml` — ISO 42001 §A.8.4
validation for FlowSignal integration (FLOWSIGNAL-001). Asserts:
CAGE_NORMATIVE_PROVIDER env var sourcing, secretKeyRef-only mTLS secrets,
Redis namespace isolation, REDIS_URL presence. Region: ALL, Posture:
iso42001.
- Extended: `compliance/oscal/component-definition.yaml` — 69-line
FlowSignal component definition (UUID f10a5e8d-4b2c-5f99-8c3a-d41f7e8b9c2f)
with ISO 42001 A.8.4 control mapping, consequence authority operational
semantics, Lula validation linkage.
## Documentation
- New: `plans/flowsignal_integration_implementation_plan.md` — Phase 1-3
engineering plan (1083 lines), dependency tracking, risk mitigation
(R1-R8), compliance checklist, test strategy. Reference architecture note:
illustrative deployment pattern, not live production commitment.
## Test Results
Canonical suite is green: `uv run pytest tests/ -m "local or unit" -n auto
--dist=loadfile --tb=short` → 3027 passed, 67 skipped, 0 failed. Coverage:
72.78% (no regression). All new files carry Apache 2.0 license headers.
Secret-hygiene pass: clean (no pk-lf-*/sk-lf-*/hf_*/GOOG* credentials, no
hardcoded fallbacks).
## Exclusions
Not committed (per AGENTS.md):
- `patch_kms.py` — ad-hoc regex throwaway script, not production source.
- `.env`, `terraform.auto.tfvars`, `.mypy_cache/`, `.ruff_cache/`,
`.venv-1/`, `__pycache__/` — gitignored artifacts.
Refs: plans/flowsignal_integration_implementation_plan.md, POAM-2026-011,
NIST SP 800-52 Rev. 2 SC-8, ISO 42001 §A.8.4, local/PROVIDER_MAPPING.md.1 parent 3f861d1 commit 1ee3694
15 files changed
Lines changed: 3184 additions & 15 deletions
File tree
- compliance
- lula
- oscal
- docs
- plans
- src
- gateway
- governance
- infrastructure
- server
- integrations/provider_01
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
321 | 449 | | |
322 | 450 | | |
323 | 451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
0 commit comments