Repository navigation
feat(compliance)!: stamp deployment posture in batch attestations - #767
Merged
Merged
Conversation
lahlfors
force-pushed
the
fix/gate-w-tunnel-ordering
branch
from
November 15, 2026 18:53
cdb9c77 to
63af3d0
Compare
Stamp deployment_posture inside KMS-signed cage-evidence-batch/2 custody
attestations emitted by EvidenceCustodian and surface structural posture
provenance in CustodyVerifier without invalidating pre-stamping v1 archives.
- Bump EvidenceCustodian schema from cage-evidence-batch/1 to
cage-evidence-batch/2 with deployment_posture in {production, staging} inside
the JCS-canonicalized KMS signing preimage; refuse require_signature=True on
non-citable postures and refuse cross-posture v2 batches on cold-store cursor
recovery, archive verification, and metrics aggregation.
- Keep pre-stamping cage-evidence-batch/1 archives (gate-w-8956f505, fa77212)
citable=True by default while returning
citable_qualifications=["unstamped_v1_posture"] (vs. [] on v2) and
three-valued posture_status in {production, staging, unstamped_v1} (None when
!ok or empty).
- Add allow_qualifications=False, CLI --require-unqualified, HTTP
GET /v1/evidence/verify?require_unqualified=true, OSCAL Assessment Results
custody posture/qualification props, v1/v2 audit corroboration support, and
clean-room Gate W staging posture assertions.
BREAKING CHANGE: Signed custody batch attestations now emit schema
cage-evidence-batch/2 with a required deployment_posture field (EP-1 in
docs/BREAKING_CHANGES.md). External tools pinning
schema == "cage-evidence-batch/1" must accept cage-evidence-batch/2; strict
posture consumers should check posture_status and citable_qualifications == [].
Add next_gate_w_discharge to compliance/gate_w_certification.json tying residency_result_breakdown (POAM-2026-220), lula_result_breakdown.ratings_from_2026_11_14 (POAM-2026-219), and custody_posture_qualification (EP-1) to a single APAC_MAS (asia-southeast1) --fresh-project Gate W run so all three archive disclosures discharge together rather than piecemeal, and reconcile the posture-stamping note in README.md.
lahlfors
force-pushed
the
feat/attestation-posture-stamp
branch
from
November 15, 2026 19:06
5c66378 to
46af4af
Compare
lahlfors
added a commit
that referenced
this pull request
Nov 15, 2026
Open POAM-2026-221 documenting the vacuous GitHub Actions windows uncovered by failing check_stpa_freshness.py closed in #768: - ci.yml::stpa-freshness-check (49c0d09 #694 2026-11-08 through 9b2b745 #767 2026-11-15, 70 squash-merged PRs) caught ModuleNotFoundError for opentelemetry inside render_default_oscal_artifacts(raise_on_error=False) and fell back to commit-order checking on all 3 US_FED OSCAL files. - ci.yml::sbom-generate (8c6e936 #16, 2026-06-15..2026-11-15) and security-scan.yml::sbom-generation (1902c92, 2026-06-01..2026-11-15) ran cyclonedx against unsynced runner environments containing zero CAGE packages. Default render_default_oscal_artifacts() to raise_on_error=True, delete ContentCheck.UNAVAILABLE and the commit-order fallback from check_stpa_freshness.py so inability-to-check is unconditionally a failure, enforce MIN_PYTHON_SBOM_COMPONENTS=20 in generate_sbom.py and ci.yml, switch all six narrow-pip workflow jobs to uv sync, add an in-job red-before-green planted-drift canary on both STPA and US_FED OSCAL artifacts, qualify POAM-2026-176 and POAM-010 citations with dated notes, and guard workflow uv-sync parity in test_ci_workflow_dependency_sync.py.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #766 (
fix/gate-w-tunnel-ordering).Stamps
deployment_postureinside KMS-signed WORM batch attestations (cage-evidence-batch/2) emitted byEvidenceCustodian, surfaces structural posture provenance andv1qualification inCustodyVerifier, and binds all three post-8956f505archive disclosures (POAM-2026-220,POAM-2026-219,EP-1) to a singleAPAC_MAS(asia-southeast1)--fresh-projectGate W discharge incompliance/gate_w_certification.json:cage-evidence-batch/2posture stamping (EvidenceCustodian):"schema": "cage-evidence-batch/2"with"deployment_posture"("production"or"staging") inside the RFC 8785 JCS-canonicalized KMS signing payload (EVIDENCE_KMS_KEY).require_signature=Truewhendeployment_postureis outside{"production", "staging"}(dev,test,ci,local), ensuring permissive software/local runs write.attestation.unsigned.jsononly.v2batches during cold-store cursor recovery (EvidenceCustodian._recover_cursor_from_cold_store), archive verification (CustodyVerifier._check_posture_consistency), and authoritative custody-chain metrics reads (metrics._read_cold_store_records_async), while allowing seamlessv1->v2upgrades.citablequalification + three-valuedposture_status(CustodyVerifier):cage-evidence-batch/1archives (gate-w-8956f505,fa772122) remaincitable=Trueby default without requiring any opt-in flag, accompanied bycitable_qualifications=["unstamped_v1_posture"](vs.[]forv2), makingcitable and not citable_qualificationsa distinct machine-readable state (assert_citable(allow_qualifications=False), CLI--require-unqualified, HTTPGET /v1/evidence/verify?require_unqualified=true).posture_status("production"|"staging"|"unstamped_v1", orNonewhen!ok/ empty). Because"unstamped_v1"is neither"staging"nor"production", any consumer handling only the two stamped postures fails loudly rather than defaulting to"production".evidence-custody-posture-statusandevidence-custody-qualificationprops into OSCAL Assessment Results (oscal_exporter.py), supportsv1andv2preimage corroboration incage-conformance(AS-6), requiresposture_status == "staging"andcitable_qualifications == []on--fresh-projectclean-room Gate W runs (scripts/staging_lifecycle.sh), and updates OSCALau-9.3census/register artifacts,compliance/gate_w_certification.json(custody_posture_qualification+ combinednext_gate_w_discharge), andEP-1indocs/BREAKING_CHANGES.md.Security Bound on Accepting
cage-evidence-batch/1Accepting pre-stamping
cage-evidence-batch/1attestations alongsidecage-evidence-batch/2does not open a posture-downgrade path:"schema"and"deployment_posture"live inside the RFC 8785 JCS-canonicalized preimage signed byEVIDENCE_KMS_KEYand verified against out-of-band trust anchors (EVIDENCE_TRUST_ANCHORS_FILE/ KMS public key).cage-evidence-batch/2attestation as"cage-evidence-batch/1", stripping"deployment_posture", or mutating"staging"to"production"alters the canonical preimage and fails asymmetric signature verification without possession of the KMS signing key (TestPostureStampingAndV1Qualification::test_downgrade_or_posture_mutation_without_signing_key_breaks_signature).EvidenceCustodianemits onlycage-evidence-batch/2, andassert_citable()rejectsv1payloads carryingdeployment_posture,v2payloads missingdeployment_posture, andv2payloads carrying any posture outside{"production", "staging"}even if signed.Verification
uv run pytest(make test-fast): 10,884 passed, 75 skipped, 6 subtests passed (0failed), includingv1/v2posture stamping, structural qualification, cross-posture archive rejection, KMS preimage downgrade-attack resistance, CLI/HTTP--require-unqualified, OSCAL posture props,cage-conformancev1/v2corroboration, andstaging_lifecycle.sh --fresh-projectposture gate tests.uv run bandit -r src/ scripts/ -c pyproject.toml -ll -ii: 0 issues across 136,257 lines of code (src/: 108,245 lines;scripts/: 28,012 lines).python scripts/check_oscal_claim_census.py(209census entries validated,0errors)python scripts/check_poam_lula_divergence.py(0divergences)python scripts/check_doc_references.py(70doc files,0broken references)python scripts/check_import_boundaries.py,check_vendor_brands.py,check_gate_w_freshness.pyCAGE_DEPLOYMENT_REGION={US_FED,EU_ECB,APAC_MAS} python -m src.gateway.governance.oscal_ssp_exporter export --checkBREAKING CHANGE: Signed custody batch attestations now emit schema
cage-evidence-batch/2with a requireddeployment_posturefield (EP-1indocs/BREAKING_CHANGES.md). External tools pinningschema == "cage-evidence-batch/1"must acceptcage-evidence-batch/2; strict posture consumers should checkposture_statusandcitable_qualifications == [].