Repository navigation
dashboard-api: retire SpawnDashboardCrossAccountReadRole; read EC2 as the caller (#1585) - #1633
Merged
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/1585-retire-dashboard-read-role
branch
from
November 14, 2026 20:17
2ce9dd7 to
5dd0299
Compare
… the caller (#1585) The read role in 435415984226 trusted the Cognito identity-pool role every Google/GitHub/Globus sign-in gets, so any of them could list every tenant's instances there from the browser. The live mitigation removed the Cognito role's AssumeRole and EC2 read; this removes what still assumed the role. EC2 reads now use the caller's own verified credentials in the caller's own account, with no AssumeRole; an identity-pool session is not acted as and gets a 403 before any EC2 call. Terminate stays refused (#1349) and now makes no EC2 call. setup-cross-account-role.sh and the SPAWN_DASHBOARD_CROSS_ACCOUNT_ROLE override are removed. The IAM coverage gate checks the reads against the caller's `spawn list` grants from the generated CLI reference. The browser side is spore-host/spore-host#742.
scttfrdmn
marked this pull request as ready for review
November 14, 2026 22:32
scttfrdmn
force-pushed
the
hardening/1585-retire-dashboard-read-role
branch
from
November 14, 2026 22:32
5dd0299 to
f053b6c
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 #1585
What changes
The live mitigation (2026-11-11) removed EC2 read and the AssumeRole into 435415984226 from
Cognito_SpawnDashboard_Auth_Role. This PR removes what still assumed the role:lambda/dashboard-api/cross_account.go:getEC2ClientForRegionnow builds the EC2 client on the caller's own verified credentials, in the caller's own account. There is no AssumeRole and no role ARN, and theSPAWN_DASHBOARD_CROSS_ACCOUNT_ROLEoverride is gone. A portal sign-in (spore-portal-launchin its own account) or a CLI user's own keys read their own account, so IAM bounds what each caller sees. The Lambda role is never used for these reads..../assumed-role/<role>/CognitoIdentityCredentials) are not acted as. Their role has no EC2 access, so/api/instances,/api/instances/{id}and/api/cost-summaryreturn a 403 naming the portal andspawn listbefore any EC2 call. Previously they made a denied call in every region and returned an empty list.handleTerminateInstancemakes no EC2 call at all and returns the 403 namingspawn terminate <id>.terminateCancellingSpotand its tests are removed with it.lambda/dashboard-api/scripts/setup-cross-account-role.sh.spawn listrow of the generateddocs/reference/cli-iam-actions.md, meaning what a spawn user already holds. ThecallerAssumeRoleProvidercut is gone, and so are the two permanent Dashboard: terminate and sweep cancel in a member account have no role that may do them (owner decision) #1349 ledger entries, because the calls no longer exist.sts.assumeRoleinto the role (spore-hostweb/js/main.js:296), plus spore-host scripts that create the role and re-grant EC2 to the Cognito role. I filed Dashboard: remove the browser's AssumeRole into SpawnDashboardCrossAccountReadRole and the scripts that grant it (spawn#1585) spore-host#742 for those.Tests
cross_account_test.go: nil credentials refuse in the client builder and in all three read paths. The client signs with exactly the caller's access key. No non-test file containsstscreds,AssumeRole(, the role ARN or the override, and the setup script is gone.isIdentityPoolSessionis covered, and terminate returns 403 naming the CLI. The iamcoverage gate passes.make checkis clean apart from the known space-in-path failures. Semgrep is clean.Live deletion for the owner
Delete
SpawnDashboardCrossAccountReadRolefrom 435415984226, and from any other accountsetup-cross-account-role.shor spore-host'ssetup-dashboard-cross-account-role.shwas run in:To find other copies, run
aws iam get-role --role-name SpawnDashboardCrossAccountReadRolein each onboarded account. The role has the tagsspawn:purpose=dashboard-readandspawn:managed=true.Also, list key names only for
spawn-dashboard-api's environment. If it setsSPAWN_DASHBOARD_CROSS_ACCOUNT_ROLE, remove that key and keep the rest.Deploy
spawn-dashboard-api: code-only. No IAM change in the infra account.Live checks
aws iam simulate-principal-policy --policy-source-arn arn:aws:iam::966362334030:role/Cognito_SpawnDashboard_Auth_Role --action-names sts:AssumeRole --resource-arns arn:aws:iam::435415984226:role/SpawnDashboardCrossAccountReadRolereturns implicitDeny.--action-names ec2:DescribeInstancesalso returns implicitDeny. This confirms the 2026-11-11 mitigation.spawn liston/api/instancesand causes no EC2 calls (check CloudTrail in 966362334030 forDescribeInstancesbyCognitoIdentityCredentialssessions, count only).DELETE /api/instances/<id>returns the 403 namingspawn terminate.aws iam get-role --role-name SpawnDashboardCrossAccountReadRole --profile spore-host-devreturns NoSuchEntity.