Repository navigation
Description
Found while simulating the before/after state for #814. Not a security exposure —
the opposite: a permission that should exist and does not.
Measured
$ aws iam simulate-principal-policy \
--policy-source-arn arn:aws:iam::966362334030:role/SpawnDashboardLambdaRole \
--action-names sts:AssumeRole \
--resource-arns arn:aws:iam::435415984226:role/SpawnDashboardCrossAccountReadRole
implicitDeny
lambda/dashboard-api/cross_account.go:21 assumes exactly that ARN:
return "arn:aws:iam::435415984226:role/SpawnDashboardCrossAccountReadRole"and getEC2ClientForRegion builds every cross-account EC2 client through it. The
role's policy grants sts:AssumeRole on no resource now that #814 removed
the one statement it had — and that statement named a different account and a
different role name (…CrossAccountRole, not …CrossAccountReadRole).
So the dashboard's cross-account instance listing has never worked. The two
findings explain each other: the grant was written for an account/role pair that
later changed, the code moved to the dev account, and the grant was never
updated — leaving a useless grant pointing somewhere forbidden and no grant
pointing anywhere useful.
Before fixing, decide whether the feature is wanted
This is the #783 question again. Two facts worth weighing:
lambda/dashboard-api/scripts/setup-cross-account-role.shdoes create
SpawnDashboardCrossAccountReadRolein the dev account and trusts
966362334030, so the resource half was built. Only the identity half is
missing.- That script's trust is
arn:aws:iam::966362334030:rootwith no ExternalId
and noArnLikeonaws:PrincipalArn, so any principal in the infra
account can assume it, and it carriesAmazonEC2ReadOnlyAccess+
AmazonDynamoDBReadOnlyAccess. Compare the reaper's trust, which was
deliberately narrowed to:rootplus anArnLikefor exactly this reason
(ttl-reaper: cross-account trust names a CFN-generated role ARN suffix — recreating the stack breaks EVERY account at once (#457 trap 1) #476). If the feature is kept, that trust should be narrowed the same way
before the grant is added — otherwise adding the grant widens real access.
If kept
Add a statement to SpawnDashboardLambdaPolicy granting sts:AssumeRole on that
one role ARN — scoped to the ARN, not arn:aws:iam::*:role/..., which is the
wildcard-account shape flagged elsewhere in the review. Then narrow the member-side
trust per (2), and verify with simulate-principal-policy plus an actual
dashboard request, not just the simulation.
If not kept
Remove cross_account.go's assume path and
scripts/setup-cross-account-role.sh, and say in the dashboard that instance
listing is infra-account only. Leaving a code path that silently fails on every
call is the shape this audit exists to remove.
Activity
scttfrdmn commentedon Oct 11, 2026
I went to do this and the live state does not match what I wrote on this issue. Correcting
before anyone acts on it.
The deployed trust is not
:root.SpawnDashboardCrossAccountReadRolein435415984226 currently trusts:
Three things follow:
966362334030:rootwith noExternalId, so any principal in the infra account couldassume it, and that it should be narrowed before adding the grant. The script does
write
:root(setup-cross-account-role.sh:36), but the live role does not match thescript — so either it was never created by it or it was hand-edited afterwards. The
live trust is already narrow.
AROA6B75PANHFXGFLBRS7is a deleted role. It matches no live role in 966362334030(
list-roles --query 'Roles[?RoleId==...]'→[]). A bareAROA…principal ID in atrust policy is what AWS leaves behind when a trusted role ARN is deleted. Harmless —
role unique IDs are never reused, so it cannot be re-granted by recreating a role of
the same name — but it is dead weight that obscures who is actually trusted.
Cognito_SpawnDashboard_Auth_Roleexists in infra (created 2026-01-15). That reframesthe architecture question: cross-account reads look like they were designed for
browser-side Cognito-authenticated callers, and
cross_account.goassuming the rolefrom the dashboard Lambda may be a later addition that was never wired up at either
end.
SpawnDashboardLambdaRoleis not in the trust at all, which is a second reasonthe assume fails beyond the missing identity-side grant.
So the decision this issue asks for is sharper than I framed it. It is not "keep the
feature and narrow the trust" — it is which caller is supposed to do cross-account
reads: the Lambda (add it to the trust, add the identity grant) or the browser via
Cognito (delete
cross_account.go's assume path). I am not guessing at that one.One decision-free defect regardless:
setup-cross-account-role.shwritesPrincipal: {"AWS": "arn:aws:iam::<infra>:root"}with noExternalIdand noArnLikeonaws:PrincipalArn. Re-running it would replace today's narrow trust with a wide one,and it carries
AmazonEC2ReadOnlyAccess+AmazonDynamoDBReadOnlyAccess. Compare thereaper's trust, deliberately narrowed to
:rootplus anArnLikefor exactly thisreason (#476). Worth fixing whichever way the architecture decision goes — unless the
answer is "delete the script", which is why I have not pre-emptively fixed it.
Org check done before touching any of this, per the project constraint: both 966362334030
and 435415984226 are in
o-v33p2ygcff(management 752123829273). Neither is 942542972736and neither is in
o-pygqyjjoym. No live IAM change made.