Skip to content

SpawnSweepCrossAccountRole is provisioned only by a manual script; detached sweeps (the default) need it #1537

Description

@scttfrdmn

Found while fixing #1535 (PR #1536).

A detached parameter sweep, which is the default for spawn launch --param-file, needs SpawnSweepCrossAccountRole in the account its members launch in. The sweep orchestrator assumes it for every launch, tag and cancel (lambda/sweep-orchestrator/main.go defaultCrossAccountRole, pkg/sweep/detached.go).

Nothing in the product provisions it:

  • The only creator is scripts/setup-sweep-cross-account-role.sh, a manual script run with member-account credentials (SPAWN_MEMBER_ACCOUNT=…). The script itself carries Managed egress proxy for --no-public-ip bootstraps (no NAT gateway, no mirrors) #1515's six new statements, so every policy change is also a manual step for each account (CHANGELOG 0.160.0, "IAM (manual, per member account)").
  • spawn onboard creates spore-portal-onboard, not this role.
  • docs/ has no page describing it. grep -rn SpawnSweepCrossAccountRole docs README.md finds nothing.

So spore.host's default sweep mode depends on IAM that a user has to create by hand from a repo script. That is the "no IAM work for users" gap (#610): spore.host should provision this role, keep its policy current, and have a named deleter for it.

What #1536 does in the meantime: a detached sweep (and spawn resume --detach) checks the role exists with iam:GetRole and refuses before creating anything, rather than creating the IAM role, profile, proxies, S3 params and record and reporting "queued" for a sweep the orchestrator cannot launch. The refusal points at --no-detach, and on purpose does not tell the user to create the role.

Open questions:

Activity

  1. added this to the Later milestone on Nov 6, 2026
  2. added
    area:infra
    type:infra
    on Nov 6, 2026
  3. modified the milestones: Later, Hardening on Nov 8, 2026
  4. scttfrdmn commented on Nov 8, 2026

    @scttfrdmn
    ContributorAuthor

    PR #1561 (stacked on #1560; base main, rebase after #1560 merges). Answers to the open questions:

    • Who provisions: every detached sweep, and spawn sweep resume --detach, ensures the role in the compute account before anything else is created. If the script's role is already there, it is adopted. spawn sweep setup does the same on its own.
    • Keeping the policy in step: the policy is now Go (pkg/aws SweepCrossAccountPolicyDocument). It is written as SweepCrossAccountEC2Policy-v1 through fix(iam): version the spored grant policies so an older CLI cannot strip a newer one's grants (#1558) #1560's versioned writer, and converged on every detached sweep. An iamcoverage gate now fails on any grant the orchestrator does not call, as well as on any call it has no grant for.
    • Deleter: spawn sweep teardown. It refuses while a sweep in the account is running, unless --force. The manual script is deleted.
    • Guard: the role is refused for 942542972736 (hardcoded), for any Organizations management account, and for the shared infra account, before any IAM call.

    Decision for the owner: the trust has no ExternalId. That matches today, but not what the brief assumed. The orchestrator sends none at any of its three AssumeRole sites, and the script's trust had none. Requiring one would refuse every detached sweep. Adding it would need a record field, orchestrator and scheduler-handler changes, and an ordered Lambda deploy. It would also strand queued sweeps and scheduled sweeps. The reasons are in the PR body. Say if you want it anyway, as a separate issue.

  5. scttfrdmn commented on Nov 9, 2026

    @scttfrdmn
    ContributorAuthor

    Owner decision (2026-11-08): keep the trust as is, with no ExternalId. SpawnSweepCrossAccountRole's trust is exactly the infra sweep-orchestrator role ARN, with no condition. Writing a sweep record already requires infra-account credentials, so an ExternalId adds little, and adding one would strand queued and scheduled sweeps. PR #1561 implements this as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:infracomponent:spawntype:infra

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions