Skip to content

B1: only the Phobos server may call a person's keyring #52

Closed

Description

@jerryfane

Part of #46. Owner decision 2026-10-14 (via Jarvis, recorded on #46): per-person keyrings run on Cloudflare Containers (B1): keyring's Go binary unchanged, one container per person, controlled by one Durable Object (DO) per person. File mode for the owner's Mac stays the default and unchanged; everything here is opt-in. No Cloudflare account changes or spending without the owner's approval.

Depends on #45 (instance mode: encrypted state, admin API).

Problem

On the Mac, a role token works only from allow_sources. At Cloudflare, a leaked role token would work from anywhere on the internet.

Change

  • Callers must prove they are the Phobos router, not only hold a role token: Cloudflare Access service token checked by the Worker, or a second secret held by the router (never by the sandbox), checked by the Worker or DO before forwarding and/or by the keyring in container mode.
  • The sandbox's agent never holds this secret; the router adds it when forwarding the agent's call.
  • Decide where the check lives (Worker, DO or keyring) and test the refusal path.

Acceptance

  • A request with a valid role token but without the router proof is refused before it reaches the API (test).
  • The router proof never appears in the audit log or upstream requests.

Activity

  1. jerryfane commented on Oct 14, 2026

    @jerryfane
    ContributorAuthor

    Agreed with phobos-dev (gitmoot messages 313693, 313705, 313709): the caller proof is one X-Keyring-Caller: <secret> per Phobos server. The Worker checks it in constant time before the DO is touched and removes it before forwarding. phobos-dev found that file-mode keyring forwards unknown headers upstream (main f2ff6fc), so as a second layer the keyring in container mode never forwards X-Keyring-Caller upstream. File mode does not change.

  2. added a commit that references this issue on Oct 14, 2026
  3. jerryfane commented on Oct 14, 2026

    @jerryfane
    ContributorAuthor

    Done in #57 (merged 88777f2): the Worker checks X-Keyring-Caller in constant time before any Durable Object is touched and removes it; the DO and the keyring in container mode (#54) also never forward it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions