Repository navigation
Dashboard: no broadcast of ownerless sweeps; no cache under a shared session ARN (#1600, #1589) - #1625
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
scttfrdmn
force-pushed
the
hardening/server-side
branch
from
November 14, 2026 20:17
48cf86e to
7ea6aa1
Compare
…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
marked this pull request as ready for review
November 14, 2026 21:19
scttfrdmn
force-pushed
the
hardening/server-side
branch
from
November 14, 2026 21:19
7ea6aa1 to
0ef02a3
Compare
Merged
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.
Fixes #1600
Fixes #1589
What changes
#1600: ownerless sweep records are no longer broadcast.
dashboard-websocket-processorskipped its user filter when a record'suser_idwas empty, so the whole NewImage (account ID, params location, progress) went to every open dashboard socket.recipientsFornow returns no recipients for an emptyuser_id, and a connection with an emptyuser_idmatches nothing. The event is logged and dropped.#1589: no user-account cache under an assumed-role ARN.
getUserFromCredentialsHeaderandgetUserFromRequestkeyed thespawn-user-accountscache 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'scli_iam_arn. Anarn:...: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 cacheGetItemwith a row that maps the caller to a victim. For the shared Cognito ARN, both auth paths make no cacheGetItemorPutItemand 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.make checkis 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
spawn-user-accounts(966362334030, us-east-1) for rows whoseuser_idcontainsassumed-role/, especiallyCognitoIdentityCredentials: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.
sweep:updateevents still arrive. Then check the processor's log for anydropping sweep:update event with no user_idlines, count only.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 newassumed-role/row appears inspawn-user-accounts.