Skip to content

Dashboard: no broadcast of ownerless sweeps; no cache under a shared session ARN (#1600, #1589) - #1625

Merged
scttfrdmn merged 1 commit into
mainfrom
hardening/server-side
Nov 14, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
hardening/server-side

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Fixes #1600
Fixes #1589

What changes

#1600: ownerless sweep records are no longer broadcast. dashboard-websocket-processor skipped its user filter when a record's user_id was empty, so the whole NewImage (account ID, params location, progress) went to every open dashboard socket. recipientsFor now returns no recipients for an empty user_id, and a connection with an empty user_id matches nothing. The event is logged and dropped.

#1589: no user-account cache under an assumed-role ARN. getUserFromCredentialsHeader and getUserFromRequest keyed the spawn-user-accounts cache on the caller's STS ARN. Every Cognito identity-pool user shares one ARN (.../Cognito_SpawnDashboard_Auth_Role/CognitoIdentityCredentials), so a single row written for it would map every later web sign-in to one user's cli_iam_arn. An arn:...:assumed-role/... caller now never reads or writes the cache on either path. It is resolved from a verified email claim on each request, as the portal-role path already is. IAM user ARNs (per person) are still cached.

Tests

  • recipients_test.go: an owner's record reaches only that owner's connections. An ownerless record and an unknown owner reach none.
  • assumed_role_cache_test.go: a fake STS/DynamoDB endpoint answers every cache GetItem with a row that maps the caller to a victim. For the shared Cognito ARN, both auth paths make no cache GetItem or PutItem and refuse the caller. The test fails against main, which resolves the caller to the victim. A contrast test shows an IAM user still reads the cache.
  • Local: make check is clean apart from the known space-in-path failures (TestSetupAllRunsEveryStepFromAnyDirectory, check-build-tags). Semgrep is clean on the changed paths.

Deploy (no IAM change)

  • spawn-dashboard-api: code-only.
  • spawn-dashboard-websocket-processor: code-only.

Live checks for the owner

  1. Before deploy, deployed state for security: Dashboard identity cache is keyed on the STS ARN, which all Cognito identity-pool users share #1589. Scan spawn-user-accounts (966362334030, us-east-1) for rows whose user_id contains assumed-role/, especially CognitoIdentityCredentials:
    aws dynamodb scan --table-name spawn-user-accounts --region us-east-1 --projection-expression user_id --filter-expression "contains(user_id, :r)" --expression-attribute-values '{":r":{"S":"assumed-role/"}}'
    After this deploys, nothing reads those rows, but delete any you find.
  2. After deploy, security: WebSocket fan-out broadcasts sweep records that lack user_id to every connected user #1600. Open the dashboard as a user who owns a sweep and confirm sweep:update events still arrive. Then check the processor's log for any dropping sweep:update event with no user_id lines, count only.
  3. After deploy, security: Dashboard identity cache is keyed on the STS ARN, which all Cognito identity-pool users share #1589. A portal (spore-portal-launch) sign-in and a CLI-credential call still work. A Cognito-identity-pool call with no email claim is refused, and no new assumed-role/ row appears in spawn-user-accounts.

@codecov

codecov Bot commented Nov 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn force-pushed the hardening/server-side branch from 48cf86e to 7ea6aa1 Compare November 14, 2026 20:17
…session ARN (#1600, #1589)

dashboard-websocket-processor sent a sweep record with no user_id to every
open connection. It now goes to nobody, and a connection with no user
matches nothing (recipientsFor).

dashboard-api keyed its user-account cache on the caller's STS ARN, which
every Cognito identity-pool user shares
(Cognito_SpawnDashboard_Auth_Role/CognitoIdentityCredentials). An
assumed-role ARN now never reads or writes the cache, on either auth path,
so such a caller is resolved from a verified email claim on every request.
IAM user ARNs are still cached.
@scttfrdmn
scttfrdmn marked this pull request as ready for review November 14, 2026 21:19
@scttfrdmn
scttfrdmn force-pushed the hardening/server-side branch from 7ea6aa1 to 0ef02a3 Compare November 14, 2026 21:19
@scttfrdmn
scttfrdmn merged commit 468f4b4 into main Nov 14, 2026
9 checks passed
@scttfrdmn
scttfrdmn deleted the hardening/server-side branch November 14, 2026 21:39
@scttfrdmn scttfrdmn mentioned this pull request Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant