Skip to content

MVP alpha.11: Runtime attestation post handshake gating v0 - #64

Merged
ZebulonRouseFrantzich merged 5 commits into
mvp/beta_close_gaps_and_polishfrom
change/runtime_attestation_post_handshake_gating_v0
May 5, 2026
Merged

MVP alpha.11: Runtime attestation post handshake gating v0#64
ZebulonRouseFrantzich merged 5 commits into
mvp/beta_close_gaps_and_polishfrom
change/runtime_attestation_post_handshake_gating_v0

Conversation

@ZebulonRouseFrantzich

Copy link
Copy Markdown
Contributor

This pull request introduces several improvements and refactorings to the runtime attestation verification, evidence state management, and related test utilities. The main focus is on making the attestation verification process more robust, normalizing data structures, improving cache application logic, and enhancing test coverage and clarity.

Key changes include:

Runtime Attestation Verification and Evidence State Management

  • Improved normalization and reconciliation of PostHandshakeAttestationInput and HardeningPosture in both the cloneRuntimeFactsSnapshot and RecordRuntimeEvidenceState functions, ensuring consistent state updates and more reliable attestation verification. [1] [2]
  • Refactored lifecycle update logic by extracting helper functions (runtimeFactsForLifecycleUpdateLocked, applyLifecycleToRuntimeFacts, etc.), and added new logic to reconcile authoritative provisioning posture between facts and evidence. This ensures that posture is set consistently according to the latest evidence and attestation results. [1] [2] [3]
  • Enhanced the logic for applying cached attestation verification by introducing a new function (isAttestationVerificationReplayPlaceholder) to more accurately determine when cached verification should be used, preventing incorrect cache application. [1] [2]

Testing Improvements and Utilities

  • Updated test fixtures and assertions for runtime facts and evidence to better reflect the new attestation input normalization and verification logic, including improved handling of replayed and partial verification records. [1] [2] [3] [4] [5] [6] [7]
  • Added a new broker_audit_helpers_test.go file with helper functions for more effective and readable audit event testing, such as finding specific events, decoding payloads, and asserting digest values.

These changes collectively improve the reliability, maintainability, and testability of the runtime attestation and evidence management subsystem.

Signed-off-by: Zebulon Rouse-Frantzich <zeb@runecode.org>
Signed-off-by: Zebulon Rouse-Frantzich <zeb@runecode.org>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors runtime attestation so launch receipts stay TOFU until a later post-handshake step, adds a new PostHandshakeRuntimeAttestationInput seam for evidence construction, and updates broker/artifact handling to persist and reconcile the new attestation state. It touches launcher-side session/attestation flow, launcherbackend evidence/posture derivation, and broker/store projections/tests.

Changes:

  • Move attestation construction from launch-time receipts to a new post-handshake attestation input/evidence path.
  • Add reconciliation/persistence logic so broker and artifact storage derive authoritative posture from persisted evidence instead of trusting raw receipt fields.
  • Expand tests and shared fixtures/helpers around runtime evidence, authoritative-state projection, and audit payload assertions.

Reviewed changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/launcherdaemon/runtime_attestation_support.go Splits launch-time binding from post-handshake attestation progress and receipt updates.
internal/launcherdaemon/runtime_attestation_support_test.go Adds tests for TOFU-at-launch and validated-session/post-handshake helpers.
internal/launcherdaemon/runtime_attestation_support_helpers.go Moves shared digest/canonicalization/session-proof helper logic into a helper file.
internal/launcherdaemon/runtime_attestation_support_handshake.go Adds secure-session handshake tuple construction and signing helpers.
internal/launcherdaemon/qemu_runtime_linux.go Wires post-hello/post-handshake facts updates into QEMU instance monitoring.
internal/launcherdaemon/qemu_launch_support_linux.go Removes launch-time trusted-attestation population from QEMU receipt building.
internal/launcherdaemon/qemu_controller_linux.go Passes richer launch state through controller startup and adds a binding lifecycle step.
internal/launcherdaemon/qemu_controller_linux_test.go Reworks QEMU attestation tests around fail-closed post-handshake evidence gating.
internal/launcherdaemon/container_controller_linux.go Removes launch-time attestation from container receipts and adds binding lifecycle step.
internal/launcherdaemon/container_controller_linux_test.go Updates container tests for TOFU-at-launch and post-handshake evidence requirements.
internal/launcherbackend/contract_runtime_evidence.go Threads post-handshake attestation input into runtime evidence splitting/building.
internal/launcherbackend/contract_runtime_evidence_types.go Introduces PostHandshakeRuntimeAttestationInput and adds launch-context linkage fields.
internal/launcherbackend/contract_runtime_evidence_test.go Expands evidence tests for post-handshake seams, fail-closed cases, and attested promotion.
internal/launcherbackend/contract_runtime_evidence_fixtures_test.go Normalizes fixtures for launch context, session validation, and post-handshake inputs.
internal/launcherbackend/contract_runtime_attestation_input.go Adds normalization for post-handshake attestation input records.
internal/launcherbackend/contract_runtime_attestation_input_test.go Adds normalization coverage for derived boot digests.
internal/launcherbackend/contract_runtime_attestation_evidence.go Refactors attestation fail-closed policy and verification requirements around persisted evidence.
internal/launcherbackend/contract_runtime_attestation_evidence_records.go Extracts attestation evidence/verification record construction and replay identity helpers.
internal/launcherbackend/contract_image_receipt_types.go Extends runtime facts snapshots with post-handshake attestation input.
internal/launcherbackend/contract_attestation_posture.go Tightens valid-attestation posture derivation to require evidence and verification digests.
internal/launcherbackend/contract_attestation_posture_test.go Adds posture tests for missing evidence/verification digests.
internal/brokerapi/service_runtime_facts.go Switches broker runtime handling to persisted/reconciled facts and authoritative posture derivation.
internal/brokerapi/service_runtime_audit_details.go Limits attestation reason-code emission to invalid posture cases.
internal/brokerapi/local_api_run_detail_state_authoritative_ops.go Projects richer attestation presence/digest/verification metadata into authoritative state.
internal/brokerapi/local_api_run_detail_state_authoritative_ops_test.go Tests new authoritative-state attestation presence/success/failure signals.
internal/brokerapi/local_api_ops_runtime_facts_test.go Moves shared launcher runtime facts fixtures and adds digest projection assertions.
internal/brokerapi/local_api_ops_runtime_facts_fixture_test.go Adds reusable launcher runtime facts fixtures with post-handshake attestation input.
internal/brokerapi/local_api_ops_runtime_facts_container_test.go Adds persisted-evidence restart coverage for container runtime facts.
internal/brokerapi/local_api_ops_posture_evidence_test.go Adds synthetic receipt-only attestation coverage across backends.
internal/brokerapi/broker_audit_test.go Adds audit transition tests for persisted attestation state changes.
internal/brokerapi/broker_audit_helpers_test.go Extracts reusable audit test helper functions.
internal/artifacts/store_runtime_facts.go Normalizes/persists post-handshake input and reconciles authoritative posture from evidence.
internal/artifacts/store_runtime_facts_test.go Updates cache/evidence tests for post-handshake attestation inputs.
internal/artifacts/store_runtime_attestation_cache.go Adjusts cached-verification replay placeholder detection.
internal/artifacts/backup_manifest.go Normalizes post-handshake attestation input when cloning runtime facts for backups.

Comment thread internal/launcherdaemon/runtime_attestation_support.go Outdated
Comment thread internal/launcherdaemon/runtime_attestation_support_handshake.go
Comment thread internal/launcherdaemon/container_controller_linux.go Outdated
Signed-off-by: Zebulon Rouse-Frantzich <zeb@runecode.org>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 44 out of 44 changed files in this pull request and generated 5 comments.

Comment thread internal/launcherdaemon/qemu_controller_linux.go
Comment thread internal/launcherdaemon/container_controller_linux.go
Comment thread internal/launcherdaemon/qemu_runtime_attestation_material_linux.go Outdated
Comment thread internal/launcherdaemon/qemu_runtime_linux.go Outdated
Comment thread internal/launcherdaemon/qemu_runtime_linux.go Outdated
Signed-off-by: Zebulon Rouse-Frantzich <zeb@runecode.org>
Signed-off-by: Zebulon Rouse-Frantzich <zeb@runecode.org>
@ZebulonRouseFrantzich
ZebulonRouseFrantzich merged commit c6c7932 into mvp/beta_close_gaps_and_polish May 5, 2026
5 checks passed
@ZebulonRouseFrantzich
ZebulonRouseFrantzich deleted the change/runtime_attestation_post_handshake_gating_v0 branch May 5, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants