Skip to content

Detached sweeps and pipeline stages can launch with a nested-spawn role (spawn-instance-nested-*) #1372

Closed

Description

@scttfrdmn

Found in the v0.147.0 pre-release IAM review. Both halves are new in v0.147.0 and unreleased: the orchestrator PassRole on spawn-instance-* (#1332/#1354) and the nested-spawn role (#39, PR #1348).

  • --nested-spawn is refused for sweeps, but orchestratorPassableProfile (cmd/launch_sweep_detached_iam.go) accepts any instancerole.NamePrefix (spawn-instance-) profile. That includes aws.NestedSpawnRolePrefix (spawn-instance-nested-). A param row with iam_role: spawn-instance-nested-<hash> therefore passes the CLI check.
  • SpawnSweepCrossAccountRole (scripts/setup-sweep-cross-account-role.sh) may iam:PassRole role/spawn-instance-* to EC2. Simulated: the PassRole of role/spawn-instance-nested-f3113497 is allowed. The pipeline orchestrator's PassRole (lambda/pipeline-orchestrator/template.yaml) has the same shape.
  • So a sweep member or pipeline stage could hold a role that may call RunInstances and PassRole, without the --ttl requirement the --nested-spawn flag path enforces. The orchestrator would grant that capability to whoever writes the params, not only to callers who could pass the role themselves.

Fix, before the v0.147.0 tag:

  1. The CLI refuses a nested profile on every detached path.
  2. The sweep orchestrator (and the pipeline orchestrator, if it takes a role from user input) refuses it server-side.
  3. An explicit IAM Deny of iam:PassRole on role/spawn-instance-nested-* goes in both orchestrator roles, so the grant can't depend on the code.

Gates: the simulation denies the nested PassRole and still allows the other spawn-instance-* roles, and both code refusals are watched failing against a revert.

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

    component:spawntype:bugtype:security

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions