Skip to content

enroll: no provisioning path for the three broker token files on non-muse seats (secrets/queue/shell legs) #12898

Closed

Description

@dezren39

Summary

A freshly enrolled non-muse fleet seat has no provisioning path at all for the three shared broker token files its client verbs require:

Client file (on the seat) Server-side counterpart (laptop) Used by
~/tools/secrets-broker-token ~/.config/secrets-broker/token session broker sends it as X-Agent-Token to the secrets-broker (port 4800); named in every fleet secrets broker request (DEFAULT_SECRETS_TOKEN_FILE, fleet-config)
~/tools/queue-broker-token ~/.config/queue-broker/token session-proxy queue requests name this file (fleet-queue client transport, port 4801)
~/tools/laptop-agent-token ~/tools/laptop-agent-token (laptop) fleet laptop-agent reads it directly ("token file … unreadable" when absent); also the session broker's default token (port 4799)

Verified 2026-11-23: on the archer seat each file is 65 bytes, mode 0600, and its sha256 is identical to the laptop server file's sha256 (hashes compared, values never printed). They are copies of the laptop's service tokens.

Why fresh seats never get them

  • scripts/muse/bootstrap.sh never mentions any of the three files (grep of main @ 6ceb906: no hits). Its phases provision only the BWS token, the optional 1Password token, the fleet binary, and the tailnet.
  • On the muse seat the files exist only because the restore phase brings back the old sandbox's ~/tools from restic — i.e. by accident of the home backup, not by design.
  • The enrollment helper skips restore,persist,init for non-muse kinds (correctly — a grok seat must not restore the Muse home), which removes the only accidental path and leaves no replacement.

Observed consequences (grok seat, 2026-11-22)

  • fleet secrets list → secrets-broker HTTP 502 (the local session broker synthesizes 502 when a request fails; reading the named token file is the first step of its request path). list has no fallback — only get falls through to bws.
  • Queue leg: doctor fails, cannot read token file ~/tools/queue-broker-token.
  • Shell leg: doctor fails, laptop-agent-token unreadable.
  • Bridge leg knock-on: resolving message-bridge.fleet-token (not a BWS name; derived from the owner token when the broker answers) goes through the broken broker leg first, whose retry policy (fleet-secrets: 120 s budget, 10 s per attempt, 502 = retryable Unavailable) burns ~120 s per name — two names ≈ 4 minutes — before the bws fallback can derive the token. That is the "bridge hello hangs with no timeout" symptom, and why the grok seat's manual fleet agent enroll exited 0 (any one intake leg up — GitHub — is enough) while reporting registered: false (that field is computed at enroll time from the bridge leg only; it is not stored in agent.json), and why no grok row exists in the bridge registry (fleet bridge agents, verified 2026-11-23).

Also verified: Bitwarden holds no copy of the queue-broker or laptop-agent tokens under any name, and the BWS name secrets-broker.token does not hash-match the secrets-broker client token file — so "fetch them from BWS" is not currently a route either.

Fix shape (needs an owner decision on the secret-distribution route)

Give the enrollment flow an explicit token-provisioning step for these three files, e.g. one of:

  1. Publish the three service tokens to BWS under dedicated names and have the bootstrap token phase fetch them by name (0600) like it does other secrets — requires creating those BWS entries from the laptop's files first.
  2. Transfer them over the tailnet from the laptop during enrollment (the laptop-agent port answers, but that leg itself needs the laptop-agent token — a bootstrap-order problem).

Until one lands, a new seat can only be completed by a manual, operator-side copy of the three files from the laptop (paths in the table above) to the seat's ~/tools/, mode 0600.

Related

No secret values are included in this report.

Activity

  1. developing-today commented on Nov 23, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · distribution route DECIDED + provisioned (archer, 2026-11-22 ~23:55 CST, on Drew's relayed question from the grok seat: "SSH key or BWS?" — BWS chosen: it is the canonical store, needs no laptop authorized_keys change, and fixes provisioning for every future seat, not just this one)

    The three shared service tokens are now published in Bitwarden Secrets Manager under dedicated names, created from the laptop's server files with values transferred entirely on the laptop (never through chat/logs), and verified byte-equal (trimmed) against the source files, 3 of 3:

    • fleet.secrets-broker-token ← laptop ~/.config/secrets-broker/token
    • fleet.queue-broker-token ← laptop ~/.config/queue-broker/token
    • fleet.laptop-agent-token ← laptop ~/tools/laptop-agent-token

    Note: the pre-existing BWS name secrets-broker.token is a DIFFERENT value (does not hash-match the client token) and was left untouched; the new fleet.* names are the client-token source of truth.

    Seat fetch procedure (any enrolled seat with a BWS access token): list secrets, get the three fleet.* values, write them to ~/tools/secrets-broker-token, ~/tools/queue-broker-token, ~/tools/laptop-agent-token with mode 0600, then re-run fleet agent enroll + fleet agent doctor.

    Remaining for this issue: teach the bootstrap token phase to fetch these names automatically so new seats self-provision (the durable code fix). The grok seat is unblocked as soon as it performs the fetch + retest.

  3. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 event: picked-up
    by: Lane GP (archer seat, sandbox fix lane per Drew's agent work loop)

    Picked up via fleet agent next (shortlist). Premise + ownership check (fresh gh REST): #12898 OPEN; the BWS distribution route is decided and provisioned (comment 7092823739 — fleet.secrets-broker-token, fleet.queue-broker-token, fleet.laptop-agent-token published and byte-verified); the one remaining slice is the durable code fix: teach the bootstrap token phase in scripts/muse/bootstrap.sh to fetch those three names automatically so new seats self-provision. No live claim by another worker (no comments after the decision record).

    Working this slice now: laptop worktree off main, bootstrap token-phase change + test, PR to follow.

  4. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 event: progress
    by: Lane GP (archer seat)

    PR open: #12970 — the bootstrap token phase now fetches the three fleet.* BWS names and writes them 0600 to ~/tools/{secrets-broker,queue-broker,laptop-agent}-token, so a fresh seat self-provisions. A name the seat's BWS token cannot see warns and continues (the check phase names the legs that stay down) rather than failing enrollment. New test scripts/tests/test_muse_bootstrap_tokens.py runs the real script (--only token) against a fake bws: 3 passed; existing fleet-bootstrap tests still pass. Merging once the head-SHA guard verifies.

  5. added a commit that references this issue on Nov 23, 2026
  6. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 event: merged
    by: Lane GP (archer seat)

    #12898 is complete. The durable code fix has landed: PR #12970 merged (353f24ad4b4, head-SHA guarded at 446ea9a10ab), verified present on origin/main.

    What the bootstrap token phase does now (scripts/muse/bootstrap.sh): after the BWS access token is stored and verified, it fetches the three shared broker tokens from BWS by name — fleet.secrets-broker-token, fleet.queue-broker-token, fleet.laptop-agent-token (published from the laptop's server files 2026-11-22 per the route decision, comment 7092823739) — and writes them 0600 to ~/tools/secrets-broker-token, ~/tools/queue-broker-token, ~/tools/laptop-agent-token, whitespace-normalized to exactly one token line (the laptop files' byte shape). Values are never printed, logged or put in argv. A name the seat's BWS token cannot see is a warning, not a failure — enrollment continues and the check phase names the legs that stay down — so a seat whose BWS access doesn't yet include the fleet project isn't blocked, and every seat that can see the names self-provisions with no operator copy step.

    Verification: new scripts/tests/test_muse_bootstrap_tokens.py runs the real script (--only token) in a throwaway HOME against a fake bws — all three files provisioned byte-exact at 0600, secret values absent from stdout/stderr, missing name warns and continues, rerun idempotent — 3 passed. Existing test_fleet_bootstrap.py muse-bootstrap tests still pass; bash -n clean; --help exits 0.

    Remaining, tracked elsewhere: the grok seat's own fetch + retest lives on #12885 (it can now either run the manual fetch from comment 7092823739 or re-run bootstrap). Nothing else waits on this issue.

  7. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Released by archer (Lane GP, outcome: done). Bootstrap auto-provisioning of the three broker token files landed via PR #12970 (merged 353f24ad4b4); #12898 closed as completed with the record at comment 7093039313.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions