Skip to content

Detached sweeps ignore AWS_PROFILE: compute profile defaults to the hardcoded 'spore-host-dev' #1538

Closed

Description

@scttfrdmn

Bug: detached sweeps ignore AWS_PROFILE and launch in the spore-host-dev profile's account unless SPAWN_COMPUTE_PROFILE is set

pkg/config/endpoints.go:

func GetComputeProfile() string {
	if val, ok := os.LookupEnv("SPAWN_COMPUTE_PROFILE"); ok { ... }
	return "spore-host-dev"
}

LoadComputeAWSConfig, which the detached-sweep path uses for the account the members launch in, loads that profile. So with AWS_PROFILE=<anything> and no SPAWN_COMPUTE_PROFILE:

  • Detached sweeps launch in the wrong account. A detached sweep's members launch in whatever account the local spore-host-dev profile points at, not the caller's account. Foreground launches do use AWS_PROFILE.
  • A user without a spore-host-dev profile can't detach at all. The profile can't be loaded, so presumably the sweep fails.

Evidence (live, 2026-11-06, branch #1536 at 273aef33)

  • The run: AWS_PROFILE=aws (942542972736, an account with no SpawnSweepCrossAccountRole), then spawn launch mr --param-file p.yaml --sweep-name mr … (a default detached sweep).
  • What happened:
  • The control: the same command with SPAWN_COMPUTE_PROFILE=aws was correctly refused: "needs SpawnSweepCrossAccountRole in account 942542972736 … Nothing was created". No record, no params object and no role were created.

Why it matters

  • Users: a detached sweep silently runs in an account other than the one the user selected. That's wrong placement, cost in the wrong account, and data in the wrong account.
  • The trust boundary: the default being a spore.host dev account is a trust-boundary hazard in both directions. It matters especially for accounts where spore.host must not operate.

Suggested fix

  • With no SPAWN_COMPUTE_PROFILE, the compute profile should be the caller's own profile (SharedProfile() / the default chain), not a hardcoded team profile name.
  • If the hardcoded default exists for the spore.host team's own split-account setup, move it to config (~/.spawn/config.yaml), not code.
  • Print which compute account a detached sweep will launch in, before it's created.
  • Add a test: with AWS_PROFILE=x and no SPAWN_COMPUTE_PROFILE, the compute config resolves to x.
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:launchbugcomponent:spawntype:security

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions