Repository navigation
Move session tokens out of EC2 tags - #1603
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
Author
|
Live check before merge (owner; spore-host-dev, TTL on every launch, leak-check after)
|
This was referenced Nov 12, 2026
Contributor
Author
|
Partial live check (spore-host-dev, 2026-11-12):
Instance terminated, leak check clean. |
Contributor
Author
|
Live check passed end to end (spore-host-dev, 2026-11-12). The build was a local integration of this PR with #1607, on a c7i.large. Dev now has a wildcard cert (#712).
Teardown is clean: the instance is terminated, and the scratch bucket and `spawn-web` SG are deleted. Independent leak check: nothing left. Not run: DCV (`app launch desktop`), and dashboard-api, which belongs to #1605's deploy. |
spored now publishes only that a DCV or web-app session is ready (spawn:ready-status, spawn:ready-auth, a token-free spawn:ready-url). Clients mint the token locally and register its SHA-256 on the instance over SSM (spored access-token add); spored checks presented tokens against the registered hashes, which expire (12h default) and live on tmpfs. spored deletes the legacy token tags at start, dashboard-api stops returning them, and spawn app url prints a fresh link.
scttfrdmn
force-pushed
the
fix/sec-tokens-dashboard-auth
branch
from
November 12, 2026 19:25
92e9579 to
8ad8ca9
Compare
scttfrdmn
marked this pull request as ready for review
November 12, 2026 19:25
This was referenced Nov 12, 2026
Merged
scttfrdmn
added a commit
that referenced
this pull request
Nov 13, 2026
The session page embeds the DCV session token. #1603 made new pages 0600 and the sessions directory 0700, but ~/.spawn itself was still created 0755 by spawn cleanup's log, and pages older releases wrote stayed 0644. spawnHomeSubdir creates and tightens ~/.spawn and the subdirectory to 0700; getSessionsDir tightens existing pages to 0600; the sweeps state dir and the cleanup log follow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves DCV and web-app session tokens out of EC2 tags.
What changes
spawn:ready-token, andspawn:ready-urlno longer carries a token. It writesspawn:ready-status, a token-freespawn:ready-url, and a newspawn:ready-auth(token|none).spawn app launch,spawn connect(DCV) and the newspawn app url <instance>mint a 256-bit token locally and register only its SHA-256 on the instance over SSM:/usr/local/bin/spored access-token add --kind dcv|web --sha256 <hex> --ttl <n>s. spored keeps the hashes root-only on tmpfs (/run/spored/access-tokens, 0700/0600).Expiresmatches the token. Each connect gets a new token. A stop/start or reboot clears them all.spored access-token revoke-allrevokes them on demand. The DCV verifier also checks that the request names this instance's session.spawn:ready-tokenand the previous start'sspawn:ready-url/ready-status/ready-auth, so a client waking a stopped instance waits for this start's readiness.spawn:ready-tokenandspawn:ready-urlout of the instance tag passthrough.spawn:ready-auth), the CLI still uses the token that agent published and prints a warning namingspawn upgrade-spored.~/.spawn/sessionsis now 0700 and its files 0600.docs/reference/cli-iam-actions.mdis regenerated:spawn app launchandspawn app urlnow usessm:SendCommand/ssm:GetCommandInvocation.spawn connectalready did. The spored role already hasAmazonSSMManagedInstanceCore. No new IAM is created, and there is nothing to delete.Wire contract for other clients
A client that opens sessions (spawn-ts, the portal, MCP) mints a token, sends
spored access-token add …with the hash via SSMAWS-RunShellScript, and buildshttps://<host>:8443/?authToken=<t>#<session>orhttps://<host>/?spore_token=<t>.pkg/accesstokenis the reference implementation.Deploy checklist impact
spawn upgrade-sporedor a relaunch. Needs the owner's live check before merge (steps are in the PR comment).Tests
Unit tests with fakes: the token store (expiry, kind, symlink refusal, perms), the DCV verifier, the web gate (cookie expiry, expired/revoked/kind-mismatch), that neither handshake publishes a token, the stale-tag cleanup (also through the monitor tick), the spawn↔spored command contract, and the CLI registration (only the hash goes over SSM, retry while SSM comes up, older-agent detection). Also the
spawn app urlflow and the dashboard tag passthrough.make checkis green.semgrep scan --config=auto --erroron the changed paths is clean.