Skip to content

fix: refuse to issue trace claim when hardware TEE session report is missing - #426

Open
qubeena07 wants to merge 1 commit into
agentrust-io:mainfrom
qubeena07:fix/session-close-fail-closed-tee
Open

fix: refuse to issue trace claim when hardware TEE session report is missing#426
qubeena07 wants to merge 1 commit into
agentrust-io:mainfrom
qubeena07:fix/session-close-fail-closed-tee

Conversation

@qubeena07

Copy link
Copy Markdown

Summary

Closes #372.

When the per session TEE attestation call failed inside create_session, close_session still fell back to the shared startup report and signed a claim off of it. That startup report carries no chain root commitment, so a strict verifier already rejects it, but the runtime handed the claim out anyway as if nothing was wrong.

This change makes close_session raise TeeFault instead of issuing that unbound claim, but only when the platform is a real hardware TEE. In software only dev mode the fallback still succeeds, since that binding was already best effort there and this is not a regression for that path.

Changes

  • src/cmcp_runtime/session/manager.py: close_session now checks whether the per session report is missing and the startup report provider is not software only, and raises TeeFault before building the claim.
  • tests/unit/test_session_manager.py: added a test asserting TeeFault is raised on a hardware platform, and clarified the existing dev mode fallback test.

Test plan

  • pytest tests/unit/ passes locally, 837 passed, 7 skipped
  • ruff check src/ tests/ clean
  • mypy on the changed module clean
  • bandit -r src/ clean

…missing

When the per session TEE attestation call failed, close_session still fell
back to the shared startup report and signed a claim anyway. That report
carries no chain root commitment, so a strict verifier rejects it, but the
runtime handed it out as if everything was fine. Now on a hardware platform
this path raises TeeFault instead of issuing an unbound claim. Software only
dev mode keeps the old fallback behavior since that binding was already best
effort there.

Fixes agentrust-io#372

Signed-off-by: Dipika Ranabhat <qubeena7@gmail.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

harden: fail closed at runtime when per-session attested report cannot be produced

2 participants