Skip to content

fix(drivers): preserve installed beta trust identity - #1110

Merged
frahlg merged 1 commit into
masterfrom
fix/beta-trust-identity
Sep 7, 2026
Merged

frahlg merged 1 commit into
masterfrom
fix/beta-trust-identity

Conversation

@frahlg

@frahlg frahlg commented Sep 7, 2026

Copy link
Copy Markdown
Member

Changing configured repository IDs could leave an installed official beta driver without its signed runtime policy, or bind it to a different repository that reused the name. The runtime now selects the official trust root from the installation's saved signature provenance and verifies the on-disk manifest again. A missing trust source stops the managed driver instead of granting legacy permissions.

The historical repository ID only locates the cache file. A different repository's in-memory cache cannot replace the saved signature check. No state schema, signing key, driver artifact, or network path changes.

Validation: six regressions fail against the published v3.0.3-beta.1 implementation and pass with this change. They cover added, removed and repeated name collisions, conflicting cached policy, missing manifests, another signer, and changed payloads. The complete driverrepo suite passes with the race detector, and make verify passes. The test fixture records synthetic official provenance through the state API and uses its own Ed25519 key; it does not possess the production private key.

This addresses the repository-trust finding in #1108. A lost or replaced cached manifest leaves the driver stopped with a verification error until a trusted artifact is restored.


Note

High Risk
Changes driver runtime trust and fail-closed behavior for active managed official installs; incorrect logic could block drivers or briefly weaken signature enforcement.

Overview
Fixes a trust bug where changing configured repository IDs could drop signed runtime policy for an installed official beta driver, or bind it to a different repo reusing the same alias and looser in-memory manifest data.

Runtime policy resolution now uses installation provenance (FTWSigned + official RepoURL): it pins the official beta trust root (keys/URL) while keeping the historical RepoID only to find the on-disk manifest cache. For those drivers, directManifestRuntimePolicy re-reads and re-verifies the cached envelope against the pinned key instead of trusting manifestFor()’s memory cache.

If an active managed driver has no resolvable trusted source, the manager errors and stops policy rather than returning nil and allowing legacy/unrestricted behavior. manager_test is updated so an unknown/mismatched beta repo ID must not yield a policy.

Adds beta_runtime_policy_test.go regressions for alias add/remove/collision, poisoned in-memory manifests, and missing/wrong-signer/tampered cache payloads.

Reviewed by Cursor Bugbot for commit f9cb680. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_3cc2319e-e3de-4e1f-89da-a838f6ed2928)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-07T18:17:04.032238Z f9cb680 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@frahlg
frahlg merged commit 2ad80de into master Sep 7, 2026
14 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f9cb680b62

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return nil, errors.New("control opt-in requires a configured Device Support trust root")
}
return nil, nil
return nil, errors.New("active managed driver has no trusted repository source")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Invoke autonomous default before rejecting missing trust

When an active control-capable managed driver’s repository is removed from configuration, this new error propagates through drivers.Registry.add before the driver is constructed, while the startup loop in go/cmd/ftw/main.go only logs the failure. Consequently, driver_default_mode is never invoked and hardware may remain in the forced mode issued before the restart; reject unrestricted operation only after arranging a default-mode transition or safe fallback.

AGENTS.md reference: AGENTS.md:L36-L36

Useful? React with 👍 / 👎.

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.

1 participant